Alchemy  1.0
A framework to robustly process network messages and structured data
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Types | Public Member Functions | Static Public Attributes | List of all members
Hg::detail::DataProxy< array_trait, IdxT, FormatT > Struct Template Reference

A template to provide access to sequences of data fields. More...

#include <array_proxy.h>

Inheritance diagram for Hg::detail::DataProxy< array_trait, IdxT, FormatT >:
Hg::Datum< IdxT, FormatT > Hg::detail::FieldTypes< FieldT, TraitT >

Public Types

typedef value_type::const_iterator const_iterator
 A const iterator to a value_type index.
 
typedef value_type::const_reference const_reference
 Const Reference to an element in the array.
 
typedef
value_type::const_reverse_iterator 
const_reverse_iterator
 A const reverse iterator to a value_type index.
 
typedef index_type::value_type data_type
 The value type of the element extracted at the current index defined in the parent TypeList.
 
typedef
detail::DefineFieldType< IdxT,
format_type >::type 
field_type
 Type mapping for the message format type to the actual value_type.
 
typedef field_type::index_type index_type
 The type extracted at the current index defined in the parent TypeList.
 
typedef value_type::iterator iterator
 An iterator to a value_type index.
 
typedef value_type::reference reference
 Reference to an element in the array.
 
typedef
value_type::reverse_iterator 
reverse_iterator
 A reverse iterator to a value_type index.
 
typedef std::conditional
< std::is_base_of< array_trait,
index_type >::value,
index_type, typename
field_type::value_type >::type 
value_type
 The data type managed by this Array. This is the type of data that will be written to the attached buffer. More...
 
- Public Types inherited from Hg::Datum< IdxT, FormatT >
typedef
detail::DefineFieldType< Idx,
FormatT >::type 
field_type
 Type mapping for the message format type to the actual value_type.
 
typedef FormatT 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

 DataProxy ()
 Default Constructor.
 
 DataProxy (const DataProxy &proxy)
 Copy Constructor. More...
 
 DataProxy (const datum_type &datum)
 Value Constructor: Construct a proxy directly from a datum instance. More...
 
 DataProxy (const value_type &value)
 Value Constructor: Construct a proxy directly from a datum instance. More...
 
const_reference at (size_t idx) const
 Accesses the value at the specified index in the array data..
 
reference at (size_t idx)
 Accesses the value at the specified index in the array data..
 
const_reference back () const
 Accesses the value at the specified index in the array data..
 
reference back ()
 Accesses the value at the specified index in the array data..
 
iterator begin ()
 Returns an iterator to the first item in the array.
 
iterator end ()
 Returns an iterator to the item one passed the end of the array.
 
const_reference front () const
 Accesses the value at the specified index in the array data..
 
reference front ()
 Accesses the value at the specified index in the array data..
 
 operator reference ()
 Conversion operator to a base Datum Type. More...
 
 operator value_type () const
 Value Conversion Operator (value_type) More...
 
DataProxyoperator= (const datum_type &value)
 Value assignment.
 
DataProxyoperator= (const value_type &value)
 Value assignment.
 
const_reference operator[] (size_t idx) const
 Accesses the value at the specified index in the array data..
 
reference operator[] (size_t idx)
 Accesses the value at the specified index in the array data..
 
reverse_iterator rbegin ()
 Returns an iterator to the last item of the array moving in reverse.
 
reverse_iterator rend ()
 Returns an iterator to the item one passed the beginning of the array, moving in reverse.
 
void set (const value_type &value)
 Updates the value of this ArrayProxy with a std::array type. More...
 
void set (const data_type(&value)[k_extent])
 Updates the value of this Array with a native array type. More...
 
size_t size () const
 Returns the number of valid objects managed by this array structure.
 
size_t size_of () const
 Returns the number of bytes that are required to hold this array in a buffer.
 
- Public Member Functions inherited from Hg::Datum< IdxT, FormatT >
 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_typeget () const
 Returns the current value of this Datum. More...
 
value_typeget ()
 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...
 
Datumoperator= (const Datum &rhs)
 Assignment Operator. More...
 
Datumoperator= (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_typedata () const
 Returns the value of the data buffer.
 
void data (const value_type &value)
 Returns the value of the data buffer.
 
value_typereference ()
 Returns a reference to the internal data storage. More...
 

Static Public Attributes

static const size_t k_extent = array_size<index_type>::value
 The number of elements in the array.
 
- Static Public Attributes inherited from Hg::Datum< IdxT, FormatT >
static const size_t k_offset
 The offset in the buffer where this msg field is located.
 

Additional Inherited Members

- Protected Member Functions inherited from Hg::Datum< IdxT, FormatT >
const value_typeget_data () const
 Returns the value of the data buffer.
 
value_typeget_reference ()
 Returns a reference to the internal data storage. More...
 
void set_data (const value_type &value)
 Returns the value of the data buffer.
 
- 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.

 

Detailed Description

template<size_t IdxT, typename FormatT>
struct Hg::detail::DataProxy< array_trait, IdxT, FormatT >

A template to provide access to sequences of data fields.

IdxT The index of the array field represented by this proxy. FormatType The type list format that contains the array field.

Definition at line 57 of file array_proxy.h.

Member Typedef Documentation

template<size_t IdxT, typename FormatT >
typedef std::conditional< std::is_base_of<array_trait, index_type>::value, index_type, typename field_type::value_type >::type Hg::detail::DataProxy< array_trait, IdxT, FormatT >::value_type

The data type managed by this Array. This is the type of data that will be written to the attached buffer.

The index_type is redefined here in order to capture and convert array definitions like this: "(&T) [N]" To the form: std::array<T,N>

Definition at line 99 of file array_proxy.h.

Constructor & Destructor Documentation

template<size_t IdxT, typename FormatT >
Hg::detail::DataProxy< array_trait, IdxT, FormatT >::DataProxy ( const DataProxy< array_trait, IdxT, FormatT > &  proxy)
inline

Copy Constructor.

Makes a complete copy of an existing Proxy object.

Parameters
proxyA reference to the Another instance of a DataProxy.

Definition at line 141 of file array_proxy.h.

template<size_t IdxT, typename FormatT >
Hg::detail::DataProxy< array_trait, IdxT, FormatT >::DataProxy ( const datum_type datum)
inline

Value Constructor: Construct a proxy directly from a datum instance.

Parameters
datumA reference to a datum object used to initilize this.

Definition at line 151 of file array_proxy.h.

template<size_t IdxT, typename FormatT >
Hg::detail::DataProxy< array_trait, IdxT, FormatT >::DataProxy ( const value_type value)
inline

Value Constructor: Construct a proxy directly from a datum instance.

Parameters
datumA reference to a datum object used to initilize this.

Definition at line 160 of file array_proxy.h.

Member Function Documentation

template<size_t IdxT, typename FormatT >
Hg::detail::DataProxy< array_trait, IdxT, FormatT >::operator reference ( )
inline

Conversion operator to a base Datum Type.

Note
The converted Datum base provides access to the Attach and Flush functions of the Datum.

Definition at line 224 of file array_proxy.h.

template<size_t IdxT, typename FormatT >
Hg::detail::DataProxy< array_trait, IdxT, FormatT >::operator value_type ( ) const
inline

Value Conversion Operator (value_type)

Allows the entire BitSet to be extracted and assigned as a value to the host value type.

Definition at line 235 of file array_proxy.h.

template<size_t IdxT, typename FormatT >
void Hg::detail::DataProxy< array_trait, IdxT, FormatT >::set ( const value_type value)
inline

Updates the value of this ArrayProxy with a std::array type.

Parameters
valueThe array which will initialize this object.

Definition at line 199 of file array_proxy.h.

template<size_t IdxT, typename FormatT >
void Hg::detail::DataProxy< array_trait, IdxT, FormatT >::set ( const data_type(&)  value[k_extent])
inline

Updates the value of this Array with a native array type.

Parameters
valueThe array which will initialize this object.

Definition at line 211 of file array_proxy.h.


The documentation for this struct was generated from the following file: