D4Enum.cc
// -*- mode: c++; c-basic-offset:4 -*-
// This file is part of libdap, A C++ implementation of the OPeNDAP Data
// Access Protocol.
// Copyright (c) 2013 OPeNDAP, Inc.
// Author: James Gallagher <jgallagher@opendap.org>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
#include "config.h"
// #define DODS_DEBUG
#include <cassert>
#include <sstream>
#include <libxml/encoding.h>
#include "Byte.h" // synonymous with UInt8 and Char
#include "Int8.h"
#include "Int16.h"
#include "UInt16.h"
#include "Int32.h"
#include "UInt32.h"
#include "Int64.h"
#include "UInt64.h"
#include "D4Group.h"
#include "D4Enum.h"
#include "D4EnumDefs.h"
#include "D4Attributes.h"
#include "Float32.h"
#include "Float64.h"
#include "D4StreamMarshaller.h"
#include "D4StreamUnMarshaller.h"
#include "Operators.h"
#include "InternalErr.h"
#include "dods-datatypes.h"
#include "dods-limits.h"
#include "util.h"
#include "debug.h"
using std::cerr;
using std::endl;
namespace libdap {
// Private
void D4Enum::m_duplicate(const D4Enum &src)
{
d_buf = src.d_buf;
d_element_type = src.d_element_type;
d_enum_def = src.d_enum_def;
#if 0
// The enum_def is a weak pointer managed by D4Group. We just copy it
// and do not delete it. jhrg 1019/15
d_enum_def = src.d_enum_def == 0 ? 0 : new D4EnumDef(*(src.d_enum_def));
#endif
d_is_signed = src.d_is_signed;
}
std::vector<BaseType *> *
D4Enum::transform_to_dap2(AttrTable *){
BaseType *my_pretty_pony;
DBG(cerr << __func__ << "() - BEGIN" << endl;);
switch (d_element_type) {
case dods_byte_c:
case dods_int8_c:
case dods_uint8_c:
{
Byte *var = new Byte(name());
dods_byte val;
this->value(&val);
var->set_value(val);
my_pretty_pony = var;
break;
}
case dods_uint16_c:
{
UInt16 *var = new UInt16(name());
dods_uint16 val;
this->value(&val);
var->set_value(val);
my_pretty_pony = var;
break;
}
case dods_uint32_c:
{
UInt32 *var = new UInt32(name());
dods_uint32 val;
this->value(&val);
var->set_value(val);
my_pretty_pony = var;
break;
}
case dods_uint64_c:
{
UInt64 *var = new UInt64(name());
dods_uint64 val;
this->value(&val);
var->set_value(val);
my_pretty_pony = var;
break;
}
case dods_int16_c:
{
Int16 *var = new Int16(name());
dods_int16 val;
this->value(&val);
var->set_value(val);
my_pretty_pony = var;
break;
}
case dods_int32_c:
{
Int32 *var = new Int32(name());
dods_int32 val;
this->value(&val);
var->set_value(val);
my_pretty_pony = var;
break;
}
case dods_int64_c:
{
Int64 *var = new Int64(name());
dods_int64 val;
this->value(&val);
var->set_value(val);
my_pretty_pony = var;
break;
}
default:
{
ostringstream oss;
oss << __func__ << "() - ERROR! Unknown D4Enum type:"<< d_element_type << " name: " << name() << endl;
throw InternalErr(__FILE__,__LINE__,oss.str());
break;
}
}
DBG( cerr << __func__ << "() - Processing Enum type:"<<
my_pretty_pony->type_name() << " name: " << my_pretty_pony->name() << endl;);
AttrTable d2_attrs = *(this->attributes()->get_AttrTable(name()));
my_pretty_pony->set_attr_table(d2_attrs);
// cerr << "D4Enum::transform_to_dap2() - my_pretty_pony attrs: "<< endl;
// my_pretty_pony->get_attr_table().print(cerr);
long long my_value;
this->value(&my_value);
DBG(cerr << __func__ << "() - value: "<< my_value << endl;);
string my_label="";
AttrTable *enum_def = new AttrTable();
enum_def->set_name("d4:enum_def");
D4EnumDef::D4EnumValueIter dIter = d_enum_def->value_begin();
D4EnumDef::D4EnumValueIter dEnd = d_enum_def->value_end();
while( dIter!=dEnd){
long long a_value = (*dIter).value;
string a_label = (*dIter).label;
ostringstream oss;
oss << a_value;
DBG(cerr << __func__ << "() - a_value: "<< a_value << endl;);
enum_def->append_attr(a_label,my_pretty_pony->type_name(),oss.str());
if(a_value == my_value){
my_label = (*dIter).label;
}
dIter++;
}
if(!my_label.empty())
my_pretty_pony->get_attr_table().append_attr("d4:enum_label","String",my_label);
my_pretty_pony->get_attr_table().append_container(enum_def,enum_def->get_name());
vector<BaseType *> *result = new vector<BaseType *>();
result->push_back(my_pretty_pony);
DBG(cerr << __func__ << "() - END" << endl;);
return result;
}
void D4Enum::m_check_value(int64_t v) const
{
switch (d_element_type) {
case dods_byte_c:
case dods_uint8_c:
if ((uint64_t)v > DODS_UCHAR_MAX || v < 0) {
ostringstream oss;
oss << "The value " << v << " will not fit in an unsigned byte. (" << __func__ << ")";
throw Error(oss.str());
}
break;
case dods_uint16_c:
if ((uint64_t)v > DODS_USHRT_MAX || v < 0) {
ostringstream oss;
oss << "The value " << v << " will not fit in an unsigned 16-bit integer. (" << __func__ << ")";
throw Error(oss.str());
}
break;
case dods_uint32_c:
if ((uint64_t)v > DODS_UINT_MAX || v < 0) {
ostringstream oss;
oss << "The value " << v << " will not fit in an unsigned 32-bit integer. (" << __func__ << ")";
throw Error(oss.str());
}
break;
case dods_uint64_c:
// If 'v' can never be bigger than ULLONG_MAX
break;
case dods_int8_c:
if (v > DODS_SCHAR_MAX || v < DODS_SCHAR_MIN) {
ostringstream oss;
oss << "The value " << v << " will not fit in an unsigned byte. (" << __func__ << ")";
throw Error(oss.str());
}
break;
case dods_int16_c:
if (v > DODS_SHRT_MAX || v < DODS_SHRT_MIN) {
ostringstream oss;
oss << "The value " << v << " will not fit in an unsigned byte. (" << __func__ << ")";
throw Error(oss.str());
}
break;
case dods_int32_c:
if (v > DODS_INT_MAX || v < DODS_INT_MIN) {
ostringstream oss;
oss << "The value " << v << " will not fit in an unsigned byte. (" << __func__ << ")";
throw Error(oss.str());
}
break;
case dods_int64_c:
// There's no value 'v' can have that won't fit into a 64-bit int.
break;
default:
assert(!"illegal type for D4Enum");
}
}
D4Enum::D4Enum(const string &name, const string &enum_type) :
BaseType(name, dods_enum_c, true /*is_dap4*/), d_buf(0), d_element_type(dods_null_c), d_enum_def(0)
{
d_element_type = get_type(enum_type.c_str());
if (!is_integer_type(d_element_type)) d_element_type = dods_uint64_c;
set_is_signed(d_element_type);
}
D4Enum::D4Enum(const string &name, Type type) :
BaseType(name, dods_enum_c, true /*is_dap4*/), d_buf(0), d_element_type(type), d_enum_def(0)
{
if (!is_integer_type(d_element_type)) d_element_type = dods_uint64_c;
set_is_signed(d_element_type);
}
D4Enum::D4Enum(const string &name, const string &dataset, Type type) :
BaseType(name, dataset, dods_enum_c, true /*is_dap4*/), d_buf(0), d_element_type(type), d_enum_def(0)
{
if (!is_integer_type(d_element_type)) d_element_type = dods_uint64_c;
set_is_signed(d_element_type);
}
// Explicit instantiation of the template member function 'value(T *)'.
// This is required in order to have the library contain these member
// functions when its own code does not use them. Normally, C++ instantiates
// templates when they are used, and this forces that process so the
// library file contains the various versions of the member function.
template void D4Enum::value<dods_byte>(dods_byte *v) const;
template void D4Enum::value<dods_int16>(dods_int16 *v) const;
template void D4Enum::value<dods_uint16>(dods_uint16 *v) const;
template void D4Enum::value<dods_int32>(dods_int32 *v) const;
template void D4Enum::value<dods_uint32>(dods_uint32 *v) const;
template void D4Enum::value<dods_int64>(dods_int64 *v) const;
template void D4Enum::value<dods_uint64>(dods_uint64 *v) const;
template void D4Enum::set_value<dods_byte>(dods_byte v, bool check_value);
template void D4Enum::set_value<dods_int16>(dods_int16 v, bool check_value);
template void D4Enum::set_value<dods_uint16>(dods_uint16 v, bool check_value);
template void D4Enum::set_value<dods_int32>(dods_int32 v, bool check_value);
template void D4Enum::set_value<dods_uint32>(dods_uint32 v, bool check_value);
template void D4Enum::set_value<dods_int64>(dods_int64 v, bool check_value);
template void D4Enum::set_value<dods_uint64>(dods_uint64 v, bool check_value);
void
D4Enum::set_enumeration(D4EnumDef *enum_def) {
d_enum_def = enum_def;
d_element_type = enum_def->type();
}
void
D4Enum::compute_checksum(Crc32 &checksum)
{
DBG(cerr << __func__ << ": element type: " << ::libdap::type_name(d_element_type) << endl);
switch (d_element_type) {
case dods_byte_c:
case dods_uint8_c:
case dods_int8_c: {
dods_byte v = static_cast<dods_byte>(d_buf);
checksum.AddData(reinterpret_cast<uint8_t*>(&v), sizeof(uint8_t));
break;
}
case dods_uint16_c:
case dods_int16_c: {
dods_int16 v = static_cast<dods_int16>(d_buf);
checksum.AddData(reinterpret_cast<uint8_t*>(&v), sizeof(uint16_t));
break;
}
case dods_uint32_c:
case dods_int32_c: {
dods_int32 v = static_cast<dods_int32>(d_buf);
checksum.AddData(reinterpret_cast<uint8_t*>(&v), sizeof(uint32_t));
break;
}
case dods_uint64_c:
case dods_int64_c:
checksum.AddData(reinterpret_cast<uint8_t*>(&d_buf), sizeof(uint64_t));
break;
default:
assert(!"illegal type for D4Enum");
}
}
void
D4Enum::set_is_signed(Type t)
{
switch (t) {
case dods_byte_c:
case dods_uint8_c:
case dods_uint16_c:
case dods_uint32_c:
case dods_uint64_c:
d_is_signed = false;
break;
case dods_int8_c:
case dods_int16_c:
case dods_int32_c:
case dods_int64_c:
d_is_signed = true;
break;
default:
assert(!"illegal type for D4Enum");
throw InternalErr(__FILE__, __LINE__, "Illegal type");
}
}
void
D4Enum::serialize(D4StreamMarshaller &m, DMR &, /*ConstraintEvaluator &,*/ bool)
{
if (!read_p())
read(); // read() throws Error
switch (d_element_type) {
case dods_byte_c:
case dods_uint8_c:
m.put_byte(d_buf);
break;
case dods_uint16_c:
m.put_uint16(d_buf);
break;
case dods_uint32_c:
m.put_uint32(d_buf);
break;
case dods_uint64_c:
m.put_uint64(d_buf);
break;
case dods_int8_c:
m.put_int8(d_buf);
break;
case dods_int16_c:
m.put_int16(d_buf);
break;
case dods_int32_c:
m.put_int32(d_buf);
break;
case dods_int64_c:
m.put_int64(d_buf);
break;
default:
assert(!"illegal type for D4Enum");
}
}
void
D4Enum::deserialize(D4StreamUnMarshaller &um, DMR &)
{
switch (d_element_type) {
case dods_byte_c:
case dods_uint8_c: {
dods_byte v;
um.get_byte(v);
d_buf = v;
break;
}
case dods_uint16_c: {
dods_uint16 v;
um.get_uint16(v);
d_buf = v;
break;
}
case dods_uint32_c: {
dods_uint32 v;
um.get_uint32(v);
d_buf = v;
break;
}
case dods_uint64_c: {
dods_uint64 v;
um.get_uint64(v);
d_buf = v;
break;
}
case dods_int8_c: {
dods_int8 v;
um.get_int8(v);
d_buf = v;
break;
}
case dods_int16_c: {
dods_int16 v;
um.get_int16(v);
d_buf = v;
break;
}
case dods_int32_c: {
dods_int32 v;
um.get_int32(v);
d_buf = v;
break;
}
case dods_int64_c: {
dods_int64 v;
um.get_int64(v);
d_buf = v;
break;
}
default:
assert(!"illegal type for D4Enum");
}
}
unsigned int D4Enum::val2buf(void *val, bool)
{
if (!val)
throw InternalErr("The incoming pointer does not contain any data.");
switch (d_element_type) {
case dods_byte_c:
case dods_uint8_c:
d_buf = *(dods_byte*)val;
break;
case dods_uint16_c:
d_buf = *(dods_uint16*)val;
break;
case dods_uint32_c:
d_buf = *(dods_uint32*)val;
break;
case dods_uint64_c:
d_buf = *(dods_uint64*)val;
break;
case dods_int8_c:
d_buf = *(dods_int8*)val;
break;
case dods_int16_c:
d_buf = *(dods_int16*)val;
break;
case dods_int32_c:
d_buf = *(dods_int32*)val;
break;
case dods_int64_c:
d_buf = *(dods_int64*)val;
break;
default:
assert(!"illegal type for D4Enum");
}
return width();
}
unsigned int D4Enum::buf2val(void **val)
{
if (!val)
throw InternalErr("NULL pointer");
switch (d_element_type) {
case dods_byte_c:
case dods_uint8_c:
if (!*val) *val = new dods_byte;
*(dods_byte *) * val = d_buf;
break;
case dods_uint16_c:
if (!*val) *val = new dods_uint16;
*(dods_uint16 *) * val = d_buf;
break;
case dods_uint32_c:
if (!*val) *val = new dods_uint32;
*(dods_uint32 *) * val = d_buf;
break;
case dods_uint64_c:
if (!*val) *val = new dods_uint64;
*(dods_uint64 *) * val = d_buf;
break;
case dods_int8_c:
if (!*val) *val = new dods_int8;
*(dods_int8*) * val = d_buf;
break;
case dods_int16_c:
if (!*val) *val = new dods_int16;
*(dods_int16 *) * val = d_buf;
break;
case dods_int32_c:
if (!*val) *val = new dods_int32;
*(dods_int32 *) * val = d_buf;
break;
case dods_int64_c:
if (!*val) *val = new dods_int64;
*(dods_int64 *) * val = d_buf;
break;
default:
assert(!"illegal type for D4Enum");
}
return width();
}
void D4Enum::print_val(ostream &out, string space, bool print_decl_p)
{
if (print_decl_p) {
print_decl(out, space, false);
out << " = ";
}
DBG(cerr << "Enum union value: " << hex << d_buf << dec << endl);
if (is_signed()) {
int64_t v;
value(&v);
out << v;
}
else {
uint64_t v;
value(&v);
out << v;
}
if (print_decl_p)
out << ";" << endl;
}
void
D4Enum::print_xml_writer(XMLWriter &xml, bool constrained)
{
if (constrained && !send_p())
return;
if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*)"Enum") < 0)
throw InternalErr(__FILE__, __LINE__, "Could not write Enum element");
if (!name().empty())
if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*)name().c_str()) < 0)
throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name");
string path = d_enum_def->name();
// Not every D4EnumDef is a member of an instance of D4EnumDefs - the D4EnumDefs instance
// holds a reference to the D4Group that holds the Enum definitions.
// TODO Should this be changed - so the EnumDef holds a reference to its parent Group?
if (d_enum_def->parent()) {
// print the FQN for the enum def; D4Group::FQN() includes the trailing '/'
path = static_cast<D4Group*>(d_enum_def->parent()->parent())->FQN() + path;
}
if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "enum", (const xmlChar*)path.c_str()) < 0)
throw InternalErr(__FILE__, __LINE__, "Could not write attribute for enum");
attributes()->print_dap4(xml);
if (get_attr_table().get_size() > 0)
get_attr_table().print_xml_writer(xml);
if (xmlTextWriterEndElement(xml.get_writer()) < 0)
throw InternalErr(__FILE__, __LINE__, "Could not end Enum element");
}
bool
D4Enum::ops(BaseType *b, int op)
{
// Get the arg's value.
if (!read_p() && !read())
throw InternalErr(__FILE__, __LINE__, "This value not read!");
// Get the second arg's value.
if (!b->read_p() && !b->read())
throw InternalErr(__FILE__, __LINE__, "This value not read!");
switch (b->type()) {
case dods_int8_c:
return Cmp<dods_int64, dods_int8>(op, d_buf, static_cast<Int8*>(b)->value());
case dods_byte_c:
return SUCmp<dods_int64, dods_byte>(op, d_buf, static_cast<Byte*>(b)->value());
case dods_int16_c:
return Cmp<dods_int64, dods_int16>(op, d_buf, static_cast<Int16*>(b)->value());
case dods_uint16_c:
return SUCmp<dods_int64, dods_uint16>(op, d_buf, static_cast<UInt16*>(b)->value());
case dods_int32_c:
return Cmp<dods_int64, dods_int32>(op, d_buf, static_cast<Int32*>(b)->value());
case dods_uint32_c:
return SUCmp<dods_int64, dods_uint32>(op, d_buf, static_cast<UInt32*>(b)->value());
#if 0
// FIXME
case dods_int64_c:
return Cmp<dods_int64, dods_int64>(op, d_buf, static_cast<D4Enum*>(b)->value());
case dods_uint64_c:
return SUCmp<dods_int64, dods_uint64>(op, d_buf, static_cast<D4Enum*>(b)->value());
#endif
case dods_float32_c:
return Cmp<dods_int64, dods_float32>(op, d_buf, static_cast<Float32*>(b)->value());
case dods_float64_c:
return Cmp<dods_int64, dods_float64>(op, d_buf, static_cast<Float64*>(b)->value());
default:
return false;
}
return false;
}
void
D4Enum::dump(ostream &strm) const
{
strm << DapIndent::LMarg << "D4Enum::dump - (" << (void *) this << ")" << endl;
DapIndent::Indent();
BaseType::dump(strm);
strm << DapIndent::LMarg << "value: " << d_buf << endl;
DapIndent::UnIndent();
}
} // namespace libdap
libdap::BaseType::read
virtual bool read()
Read data into a local buffer.
Definition: BaseType.cc:890
libdap::Int8
Holds an 8-bit signed integer value.
Definition: Int8.h:42
libdap::Int64
Holds a64-bit signed integer.
Definition: Int64.h:49
libdap::BaseType::read_p
virtual bool read_p()
Has this variable been read?
Definition: BaseType.cc:471
libdap::BaseType::name
virtual string name() const
Returns the name of the class instance.
Definition: BaseType.cc:311
libdap::BaseType::print_decl
virtual void print_decl(FILE *out, string space=" ", bool print_semi=true, bool constraint_info=false, bool constrained=false)
Print an ASCII representation of the variable structure.
Definition: BaseType.cc:994
libdap::D4Attributes::get_AttrTable
AttrTable * get_AttrTable(const std::string name)
copy attributes from DAP4 to DAP2
Definition: D4Attributes.cc:343
libdap::BaseType::dump
virtual void dump(ostream &strm) const
dumps information about this object
Definition: BaseType.cc:282
libdap::D4Enum::val2buf
unsigned int val2buf(void *, bool)
Loads class data.
Definition: D4Enum.cc:498
libdap::AttrTable
Contains the attributes for a dataset.
Definition: AttrTable.h:142
libdap::D4Enum::width
virtual unsigned int width(bool=false) const
Return the number of bytes in an instance of an Enum. This returns the number of bytes an instance of...
Definition: D4Enum.h:175
libdap::AttrTable::get_name
virtual string get_name() const
Get the name of this attribute table.
Definition: AttrTable.cc:237
libdap::D4StreamUnMarshaller
Read data from the stream made by D4StreamMarshaller.
Definition: D4StreamUnMarshaller.h:65
libdap::UInt16
Holds an unsigned 16-bit integer.
Definition: UInt16.h:57
Crc32
Definition: crc.h:76
libdap::BaseType::BaseType
BaseType(const string &n, const Type &t, bool is_dap4=false)
The BaseType constructor.
Definition: BaseType.cc:125
libdap::AttrTable::print_xml_writer
void print_xml_writer(XMLWriter &xml)
Definition: AttrTable.cc:1424
libdap::D4Enum::print_val
virtual void print_val(ostream &out, string space="", bool print_decl_p=true)
Prints the value of the variable.
Definition: D4Enum.cc:584
libdap::Type
Type
Identifies the data type.
Definition: Type.h:94
libdap::Float32
Holds a 32-bit floating point value.
Definition: Float32.h:61
libdap
Definition: AlarmHandler.h:35
libdap::InternalErr
A class for software fault reporting.
Definition: InternalErr.h:64
libdap::BaseType::FQN
virtual std::string FQN() const
Definition: BaseType.cc:323
libdap::D4EnumDef
Definition: D4EnumDefs.h:42
libdap::BaseType::var
virtual BaseType * var(const string &name="", bool exact_match=true, btp_stack *s=0)
Returns a pointer to a member of a constructor class.
Definition: BaseType.cc:749
libdap::D4Enum
Holds a DAP4 enumeration.
Definition: D4Enum.h:61
libdap::D4Enum::serialize
virtual void serialize(D4StreamMarshaller &m, DMR &dmr, bool filter=false)
Serialize a D4Enum Use the (integer) data type associated with an Enumeration definition to serialize...
Definition: D4Enum.cc:402
libdap::DMR
Definition: DMR.h:55
libdap::D4StreamMarshaller
Marshaller that knows how to marshal/serialize dap data objects to a C++ iostream using DAP4&#39;s receiv...
Definition: D4StreamMarshaller.h:71
libdap::Int16
Holds a 16-bit signed integer value.
Definition: Int16.h:59
libdap::AttrTable::append_container
virtual AttrTable * append_container(const string &name)
Add a container to the attribute table.
Definition: AttrTable.cc:409
libdap::D4Enum::dump
virtual void dump(ostream &strm) const
dumps information about this object
Definition: D4Enum.cc:700
libdap::BaseType::type
virtual Type type() const
Returns the type of the class instance.
Definition: BaseType.cc:356
libdap::get_type
ObjectType get_type(const string &value)
Definition: mime_util.cc:326
libdap::D4Enum::compute_checksum
virtual void compute_checksum(Crc32 &checksum)
include the data for this variable in the checksum DAP4 includes a checksum with every data response...
Definition: D4Enum.cc:329
libdap::Byte::set_value
virtual bool set_value(const dods_byte value)
Definition: Byte.cc:233
libdap::D4Enum::transform_to_dap2
virtual std::vector< BaseType * > * transform_to_dap2(AttrTable *parent_attr_table)
DAP4 to DAP2 transform.
Definition: D4Enum.cc:91
libdap::BaseType::attributes
virtual D4Attributes * attributes()
Definition: BaseType.cc:590
libdap::UInt64
Holds a 64-bit unsigned integer.
Definition: UInt64.h:49
Crc32::AddData
void AddData(const uint8_t *pData, const uint32_t length)
Definition: crc.h:98
libdap::D4Enum::deserialize
virtual void deserialize(D4StreamUnMarshaller &um, DMR &dmr)
Definition: D4Enum.cc:440
libdap::D4Enum::print_xml_writer
virtual void print_xml_writer(XMLWriter &xml, bool constrained)
Definition: D4Enum.cc:615
libdap::BaseType::get_attr_table
virtual AttrTable & get_attr_table()
Definition: BaseType.cc:573
libdap::AttrTable::append_attr
virtual unsigned int append_attr(const string &name, const string &type, const string &value)
Add an attribute to the table.
Definition: AttrTable.cc:306
libdap::BaseType
The basic data type for the DODS DAP types.
Definition: BaseType.h:117
libdap::BaseType::type_name
virtual string type_name() const
Returns the type of the class instance as a string.
Definition: BaseType.cc:370
libdap::Float64
Holds a 64-bit (double precision) floating point value.
Definition: Float64.h:60
libdap::BaseType::set_attr_table
virtual void set_attr_table(const AttrTable &at)
Definition: BaseType.cc:581
libdap::Byte
Holds a single byte.
Definition: Byte.h:60
libdap::D4Enum::value
void value(T *v) const
Get the value of an Enum Get the value of this instance. The caller is responsible for using a type T...
Definition: D4Enum.h:140
libdap::D4Group
Definition: D4Group.h:43
libdap::XMLWriter
Definition: XMLWriter.h:39
libdap::Error
A class for error processing.
Definition: Error.h:90
libdap::D4Enum::ops
virtual bool ops(BaseType *b, int op)
Evaluate relational operators.
Definition: D4Enum.cc:650
libdap::AttrTable::set_name
virtual void set_name(const string &n)
Set the name of this attribute table.
Definition: AttrTable.cc:244
libdap::UInt32
Holds a 32-bit unsigned integer.
Definition: UInt32.h:59
libdap::type_name
string type_name(Type t)
Definition: util.cc:760
libdap::BaseType::send_p
virtual bool send_p()
Should this variable be sent?
Definition: BaseType.cc:545
libdap::D4Enum::buf2val
unsigned int buf2val(void **)
Reads the class data.
Definition: D4Enum.cc:537
libdap::is_integer_type
bool is_integer_type(Type t)
Definition: util.cc:906
libdap::Int32
Holds a 32-bit signed integer.
Definition: Int32.h:65
libdap::BaseType::dataset
virtual string dataset() const
Returns the name of the dataset used to create this instance.
Definition: BaseType.cc:349