|
| unsigned int | buf2val (void **) override |
| void | compute_checksum (Crc32 &checksum) override |
| | D4Enum (const D4Enum &src) |
| | D4Enum (const string &name, const string &dataset, Type type) |
| | D4Enum (const string &name, const string &enum_type) |
| | D4Enum (const string &name, Type type) |
| void | deserialize (D4StreamUnMarshaller &um, DMR &dmr) override |
| void | dump (ostream &strm) const override |
| | dumps information about this object
|
| Type | element_type () |
| virtual D4EnumDef * | enumeration () const |
| bool | is_signed () const |
| D4Enum & | operator= (const D4Enum &rhs) |
| bool | ops (BaseType *b, int op) override |
| void | print_val (ostream &out, string space="", bool print_decl_p=true) override |
| void | print_xml_writer (XMLWriter &xml, bool constrained) override |
| BaseType * | ptr_duplicate () override |
| void | serialize (D4StreamMarshaller &m, DMR &dmr, bool filter=false) override |
| | Serialize a D4Enum Use the (integer) data type associated with an Enumeration definition to serialize the value of a D4Enum variable. This send just the bits that correspond to the declared type, not all 64-bits of storage used by a scalar D4Enum.
|
| void | set_element_type (Type type) |
| virtual void | set_enumeration (D4EnumDef *enum_def) |
| void | set_is_signed (Type t) |
| template<typename T> |
| void | set_value (T v, bool check_value=true) |
| | Set the value of the Enum Template member function to set the value of the Enum. The libdap library contains versions of this member function for dods_byte, ..., dods_uint64 types for the parameter v.
|
| std::vector< BaseType * > * | transform_to_dap2 (AttrTable *parent_attr_table) override |
| | Convert an Enum to a DAP2 int type.
|
| unsigned int | val2buf (void *, bool) override |
| template<typename T> |
| 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 than can hold the value.
|
| unsigned int | width (bool=false) const override |
| | Return the number of bytes in an instance of an Enum. This returns the number of bytes an instance of Enum will use in memory or on the wire (i.e., in a serialization of the type). On the wire this type uses the minimum number of bytes for the given Enum type - an Enum with type Byte uses one byte, Int16 uses two, and so on. In memory, a single instance uses 64-bits but a vector of these will use the same number of bytes per value as the on-the-wire representation.
|
| int64_t | width_ll (bool=false) const override |
Holds a DAP4 enumeration.
- Note
- When constructed a type for the Enum must be specified. If it is not an integer type, the Enum will use unsigned int 64. This is not the same as the enumeration type that is defined using the Enumeration XML element in the DMR - that information is stored in additional fields and used for checking values and printing the variable's declaration, but not for the internal storage of values.
- Todo
- Note the hack to remove the union...
Definition at line 53 of file D4Enum.h.
| unsigned int libdap::D4Enum::width |
( |
bool | = false | ) |
const |
|
inlineoverride |
Return the number of bytes in an instance of an Enum. This returns the number of bytes an instance of Enum will use in memory or on the wire (i.e., in a serialization of the type). On the wire this type uses the minimum number of bytes for the given Enum type - an Enum with type Byte uses one byte, Int16 uses two, and so on. In memory, a single instance uses 64-bits but a vector of these will use the same number of bytes per value as the on-the-wire representation.
- Note
- The private method m_type_width() returns the byte width used for the on-the-wire representation of values.
- Returns
- The number of bytes used by a value.
Definition at line 164 of file D4Enum.h.