66 template void D4Enum::value<dods_byte>(
dods_byte *v)
const;
67 template void D4Enum::value<dods_int16>(
dods_int16 *v)
const;
68 template void D4Enum::value<dods_uint16>(
dods_uint16 *v)
const;
69 template void D4Enum::value<dods_int32>(
dods_int32 *v)
const;
70 template void D4Enum::value<dods_uint32>(
dods_uint32 *v)
const;
71 template void D4Enum::value<dods_int64>(
dods_int64 *v)
const;
72 template void D4Enum::value<dods_uint64>(
dods_uint64 *v)
const;
74 template void D4Enum::set_value<dods_byte>(
dods_byte v);
75 template void D4Enum::set_value<dods_int16>(
dods_int16 v);
76 template void D4Enum::set_value<dods_uint16>(
dods_uint16 v);
77 template void D4Enum::set_value<dods_int32>(
dods_int32 v);
78 template void D4Enum::set_value<dods_uint32>(
dods_uint32 v);
79 template void D4Enum::set_value<dods_int64>(
dods_int64 v);
80 template void D4Enum::set_value<dods_uint64>(
dods_uint64 v);
84 d_enum_def = enum_def;
85 d_element_type = enum_def->
type();
91 switch (d_element_type) {
95 checksum.
AddData(reinterpret_cast<uint8_t*>(&d_buf.
ui8),
sizeof(uint8_t));
99 checksum.
AddData(reinterpret_cast<uint8_t*>(&d_buf.
ui16),
sizeof(uint16_t));
103 checksum.
AddData(reinterpret_cast<uint8_t*>(&d_buf.
ui32),
sizeof(uint32_t));
107 checksum.
AddData(reinterpret_cast<uint8_t*>(&d_buf.
ui64),
sizeof(uint64_t));
111 assert(!
"illegal type for D4Enum");
134 switch (d_element_type) {
162 assert(!
"illegal type for D4Enum");
169 switch (d_element_type) {
197 assert(!
"illegal type for D4Enum");
204 throw InternalErr(
"The incoming pointer does not contain any data.");
206 switch (d_element_type) {
234 assert(!
"illegal type for D4Enum");
245 switch (d_element_type) {
281 assert(!
"illegal type for D4Enum");
318 if (constrained && !
send_p())
321 if (xmlTextWriterStartElement(xml.
get_writer(), (
const xmlChar*)
"Enum") < 0)
322 throw InternalErr(__FILE__, __LINE__,
"Could not write Enum element");
325 if (xmlTextWriterWriteAttribute(xml.
get_writer(), (
const xmlChar*)
"name", (
const xmlChar*)
name().c_str()) < 0)
326 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
329 string path = d_enum_def->
name();
333 if (d_enum_def->
parent()) {
337 if (xmlTextWriterWriteAttribute(xml.
get_writer(), (
const xmlChar*)
"enum", (
const xmlChar*)path.c_str()) < 0)
338 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for enum");
345 if (xmlTextWriterEndElement(xml.
get_writer()) < 0)
346 throw InternalErr(__FILE__, __LINE__,
"Could not end Enum element");
355 throw InternalErr(__FILE__, __LINE__,
"This value not read!");
359 throw InternalErr(__FILE__, __LINE__,
"This value not read!");
363 return Cmp<dods_int64, dods_int8>(op, d_buf,
static_cast<Int8*
>(b)->
value());
365 return SUCmp<dods_int64, dods_byte>(op, d_buf,
static_cast<Byte*
>(b)->
value());
367 return Cmp<dods_int64, dods_int16>(op, d_buf,
static_cast<Int16*
>(b)->
value());
369 return SUCmp<dods_int64, dods_uint16>(op, d_buf,
static_cast<UInt16*
>(b)->
value());
371 return Cmp<dods_int64, dods_int32>(op, d_buf,
static_cast<Int32*
>(b)->
value());
373 return SUCmp<dods_int64, dods_uint32>(op, d_buf,
static_cast<UInt32*
>(b)->
value());
377 return Cmp<dods_int64, dods_int64>(op, d_buf,
static_cast<D4Enum*
>(b)->
value());
379 return SUCmp<dods_int64, dods_uint64>(op, d_buf,
static_cast<D4Enum*
>(b)->
value());
382 return Cmp<dods_int64, dods_float32>(op, d_buf,
static_cast<Float32*
>(b)->
value());
384 return Cmp<dods_int64, dods_float64>(op, d_buf,
static_cast<Float64*
>(b)->
value());
404 << (
void *)
this <<
")" << endl ;
virtual bool read()
Read data into a local buffer.
Holds an 8-bit signed integer value.
virtual void set_enumeration(D4EnumDef *enum_def)
virtual bool read_p()
Has this variable been read?
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.
xmlTextWriterPtr get_writer()
virtual void put_int16(dods_int16 val)
D4EnumDefs * parent() const
unsigned int val2buf(void *, bool)
Loads class data.
virtual void get_int32(dods_int32 &val)
virtual void get_uint64(dods_uint64 &val)
virtual void get_int8(dods_int8 &val)
virtual void get_byte(dods_byte &val)
Read data from the stream made by D4StreamMarshaller.
virtual void get_int64(dods_int64 &val)
Holds an unsigned 16-bit integer.
virtual void put_byte(dods_byte val)
void print_xml_writer(XMLWriter &xml)
virtual void print_val(ostream &out, string space="", bool print_decl_p=true)
Prints the value of the variable.
Type type() const
Returns the type of the class instance.
Holds a 32-bit floating point value.
virtual void put_uint16(dods_uint16 val)
A class for software fault reporting.
Holds a DAP4 enumeration.
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...
Marshaller that knows how to marshal/serialize dap data objects to a C++ iostream using DAP4's receiv...
Holds a 16-bit signed integer value.
virtual void get_uint16(dods_uint16 &val)
virtual void dump(ostream &strm) const
dumps information about this object
virtual void compute_checksum(Crc32 &checksum)
include the data for this variable in the checksum DAP4 includes a checksum with every data response...
virtual D4Attributes * attributes()
virtual void put_uint32(dods_uint32 val)
virtual std::string FQN() const
virtual void put_int8(dods_int8 val)
void AddData(const uint8_t *pData, const uint32_t length)
string name() const
Returns the name of the class instance.
virtual void deserialize(D4StreamUnMarshaller &um, DMR &dmr)
virtual void get_int16(dods_int16 &val)
static ostream & LMarg(ostream &strm)
virtual void print_xml_writer(XMLWriter &xml, bool constrained)
virtual AttrTable & get_attr_table()
virtual void put_uint64(dods_uint64 val)
virtual void get_uint32(dods_uint32 &val)
The basic data type for the DODS DAP types.
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...
Holds a 64-bit (double precision) floating point value.
void value(T *v) const
Copy the value of this Enum into v. Template member function that can be used to read the value of th...
virtual bool ops(BaseType *b, int op)
Evaluate relational operators.
Holds a 32-bit unsigned integer.
virtual void put_int32(dods_int32 val)
virtual bool send_p()
Should this variable be sent?
unsigned int buf2val(void **)
Reads the class data.
virtual void put_int64(dods_int64 val)
virtual void dump(ostream &strm) const
dumps information about this object
void print_dap4(XMLWriter &xml) const
Holds a 32-bit signed integer.