Alchemy
1.0
A framework to robustly process network messages and structured data
|
A type-wrapper that provides transparent access to a range of memory in a message buffer as if it were the specified type itself. More...
#include <datum.h>
Public Types | |
typedef detail::DefineFieldType< Idx, format_t >::type | field_type |
Type mapping for the message format type to the actual value_type. | |
typedef format_t | format_type |
format of the parent TypeList. | |
typedef field_type::index_type | index_type |
The type extracted at the current index defined in the parent TypeList. | |
typedef field_type::value_type | value_type |
The data type managed by this Datum. This is the type of data that will be written to the attached buffer. | |
Public Types inherited from Hg::detail::FieldTypes< FieldT, TraitT > | |
typedef FieldT | index_type |
The type at the index of the parent type container. | |
typedef field_data_t < index_type >::value_type | value_type |
The specified value type for the current Datum. | |
Public Member Functions | |
Datum () | |
Default Constructor. | |
Datum (Datum &datum) | |
Copy Constructor. More... | |
void | clear () |
Zeros the datum. | |
bool | equivalent (const value_type &rhs) const |
Indicates equivalency for a value_type and this Datum's value. More... | |
const value_type & | get () const |
Returns the current value of this Datum. More... | |
value_type & | get () |
Returns a reference to the value managed in this datum. | |
bool | less (const value_type &rhs) const |
Compares a value_type against this Datum's value for less-than relationship. More... | |
operator value_type () const | |
Operator to value_type. More... | |
bool | operator!= (const value_type &rhs) const |
Inequality Value Comparison (value_type) More... | |
bool | operator< (const value_type &rhs) const |
less Than Value Comparison (value_type) More... | |
bool | operator<= (const value_type &rhs) const |
less Than or equal Value Comparison (value_type) More... | |
Datum & | operator= (const Datum &rhs) |
Assignment Operator. More... | |
Datum & | operator= (value_type rhs) |
Assignment Operator (value_type) More... | |
bool | operator== (const value_type &rhs) const |
Equality Value Comparison (value_type) More... | |
bool | operator> (const value_type &rhs) const |
Greater Than Value Comparison (value_type) More... | |
bool | operator>= (const value_type &rhs) const |
Greater Than or equal Value Comparison (value_type) More... | |
void | set (const value_type &value) |
Updates the value of this Datum. More... | |
Public Member Functions inherited from Hg::detail::FieldTypes< FieldT, TraitT > | |
const value_type & | data () const |
Returns the value of the data buffer. | |
void | data (const value_type &value) |
Returns the value of the data buffer. | |
value_type & | reference () |
Returns a reference to the internal data storage. More... | |
Static Public Attributes | |
static const size_t | k_offset = OffsetOf<Idx, format_t>::value |
The offset in the buffer where this msg field is located. | |
Protected Member Functions | |
const value_type & | get_data () const |
Returns the value of the data buffer. | |
value_type & | get_reference () |
Returns a reference to the internal data storage. More... | |
void | set_data (const value_type &value) |
Returns the value of the data buffer. | |
Additional Inherited Members | |
Protected Attributes inherited from Hg::detail::FieldTypes< FieldT, TraitT > | |
value_type | m_data |
This is a local copy of the data value to shadow the value held in the buffer. | |
A type-wrapper that provides transparent access to a range of memory in a message buffer as if it were the specified type itself.
The Datum<> is intended to be used as if it were the direct field itself. All details of byte-order and memory-alignment are handled internally by the buffers the Datum<> instance is mapped to.
Idx | [size_t] The index of this element in the TypeList definition. Idx must be < length<T>::value. |
format_t | [typename] The TypeList that contains this elements definition. T must be an indexable type container. |
|
inline |
|
inline |
Returns the current value of this Datum.
If a buffer is attached to this message field, the value will be read from the buffer. Otherwise the data will be returned. This const version will not update the data from the buffer.
|
inlineprotected |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Assignment Operator (value_type)
Allows assignment to this Datum type from it's parameter type, value_type. This function is the key to allowing the Datum to behave as if the assignment was performed directly on the the managed type.
rhs | A value of the Datum value_type that will be used to directly modify the value of the object. |
|
inline |
|
inline |
|
inline |
|
inline |