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 | List of all members
Hg::detail::DataProxy< vector_trait, IdxT, FormatT > Struct Template Reference

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

#include <vector_proxy.h>

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

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 vector.
 
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 raw 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 vector.
 
typedef
value_type::reverse_iterator 
reverse_iterator
 A reverse iterator to a value_type index.
 
- 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...
 
void assign (size_t count, const data_type &value)
 Replaces the contents of the container.
 
template<typename InputIt >
void assign (InputIt first, InputIt last)
 Replaces the contents of the container.
 
const_reference at (size_t idx) const
 Accesses the value at the specified index in the vector data..
 
reference at (size_t idx)
 Accesses the value at the specified index in the vector data..
 
const_reference back () const
 Accesses the value at the specified index in the vector data..
 
reference back ()
 Accesses the value at the specified index in the vector data..
 
iterator begin ()
 Returns an iterator to the first item in the vector.
 
size_t capacity () const
 Returns the number of elements that this vector can hold based on the current allocated space.
 
void clear ()
 Releases all allocated memory dedicated for storing entry data.
 
bool empty ()
 Indicates if the vector does not have any space allocated for data.
 
iterator end ()
 Returns an iterator to the item one passed the end of the vector.
 
iterator erase (iterator pos)
 Removes the specified element from this container. More...
 
iterator erase (iterator first, iterator last)
 Removes the range of specified elements from this container. More...
 
const_reference front () const
 Accesses the value at the specified index in the vector data..
 
reference front ()
 Accesses the value at the specified index in the vector 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 vector data..
 
reference operator[] (size_t idx)
 Accesses the value at the specified index in the vector data..
 
void pop_back ()
 Removes the last element in the container. More...
 
void push_back (const_reference value)
 Removes the specified element from this container. More...
 
reverse_iterator rbegin ()
 Returns an iterator to the last item of the vector moving in reverse.
 
reverse_iterator rend ()
 Returns an iterator to the item one passed the beginning of the vector, moving in reverse.
 
void reserve (size_t new_cap)
 Insures that space is reserved to hold at least new_cap elements.
 
void resize (size_t count)
 Changes the number of elements stored. More...
 
void resize (size_t count, data_type value)
 Changes the number of elements stored. More...
 
void set (const value_type &value)
 Updates the value of this VectorProxy with a std::vector type. More...
 
template<size_t ExtentT>
void set (const data_type(&value)[ExtentT])
 Updates the value of this Vector with a native array type. More...
 
size_t size () const
 Returns the number of valid objects managed by this vector structure.
 
void swap (DataProxy &other)
 Exchanges the contents of this DataProxy container with those of other. This version does not invoke any move, copy, or swap operations on the individual elements. More...
 
void swap (value_type &other)
 Exchanges the contents of the container with those of other. This version does not invoke any move, copy, or swap operations on the individual elements. More...
 
- 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...
 

Additional Inherited Members

- 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.
 
- 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< vector_trait, IdxT, FormatT >

A template to provide access to sequences of data fields.

IdxT FormatType

Definition at line 39 of file vector_proxy.h.

Constructor & Destructor Documentation

template<size_t IdxT, typename FormatT >
Hg::detail::DataProxy< vector_trait, IdxT, FormatT >::DataProxy ( const DataProxy< vector_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 107 of file vector_proxy.h.

template<size_t IdxT, typename FormatT >
Hg::detail::DataProxy< vector_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 117 of file vector_proxy.h.

template<size_t IdxT, typename FormatT >
Hg::detail::DataProxy< vector_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 126 of file vector_proxy.h.

Member Function Documentation

template<size_t IdxT, typename FormatT >
iterator Hg::detail::DataProxy< vector_trait, IdxT, FormatT >::erase ( iterator  pos)
inline

Removes the specified element from this container.

Parameters
posIterator that points to the element to be removed.
Returns
The iterator that follows the last item removed is returned.
Note
All iterators at or after this point of erasure will be invalidated.

Definition at line 332 of file vector_proxy.h.

template<size_t IdxT, typename FormatT >
iterator Hg::detail::DataProxy< vector_trait, IdxT, FormatT >::erase ( iterator  first,
iterator  last 
)
inline

Removes the range of specified elements from this container.

Parameters
firstIterator that points to the first element to be removed.
lastIterator that points to the last element to be removed.
Returns
The iterator that follows the last item removed is returned.
Note
All iterators at or after this point of erasure will be invalidated.

Definition at line 345 of file vector_proxy.h.

template<size_t IdxT, typename FormatT >
Hg::detail::DataProxy< vector_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 235 of file vector_proxy.h.

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

Value Conversion Operator (value_type)

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

Definition at line 246 of file vector_proxy.h.

template<size_t IdxT, typename FormatT >
void Hg::detail::DataProxy< vector_trait, IdxT, FormatT >::pop_back ( )
inline

Removes the last element in the container.

Note
: Iterators that point to the last element and end will be invalidated after this call.

Definition at line 365 of file vector_proxy.h.

template<size_t IdxT, typename FormatT >
void Hg::detail::DataProxy< vector_trait, IdxT, FormatT >::push_back ( const_reference  value)
inline

Removes the specified element from this container.

Parameters
posIterator that points to the element to be removed.
Returns
The iterator that follows the last item removed is returned.
Note
All iterators at or after this point of erasure will be invalidated.

Definition at line 357 of file vector_proxy.h.

template<size_t IdxT, typename FormatT >
void Hg::detail::DataProxy< vector_trait, IdxT, FormatT >::resize ( size_t  count)
inline

Changes the number of elements stored.

Parameters
nThe number of elements the container should now hold.

Definition at line 180 of file vector_proxy.h.

template<size_t IdxT, typename FormatT >
void Hg::detail::DataProxy< vector_trait, IdxT, FormatT >::resize ( size_t  count,
data_type  value 
)
inline

Changes the number of elements stored.

Parameters
nThe number of elements the container should now hold.
valueDefault value to initialize elements if the resize causes new elements to be added to the container.

Definition at line 189 of file vector_proxy.h.

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

Updates the value of this VectorProxy with a std::vector type.

Parameters
valueThe vector which will initialize this object.

Definition at line 197 of file vector_proxy.h.

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

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

Parameters
valueThe array which will initialize this object.

Definition at line 211 of file vector_proxy.h.

template<size_t IdxT, typename FormatT >
void Hg::detail::DataProxy< vector_trait, IdxT, FormatT >::swap ( DataProxy< vector_trait, IdxT, FormatT > &  other)
inline

Exchanges the contents of this DataProxy container with those of other. This version does not invoke any move, copy, or swap operations on the individual elements.

Iterators and references will remain valid, with the exception to the end iterators.

Parameters
otherThe other vector to swap elements.

Definition at line 380 of file vector_proxy.h.

template<size_t IdxT, typename FormatT >
void Hg::detail::DataProxy< vector_trait, IdxT, FormatT >::swap ( value_type other)
inline

Exchanges the contents of the container with those of other. This version does not invoke any move, copy, or swap operations on the individual elements.

Iterators and references will remain valid, with the exception to the end iterators.

Parameters
otherThe other vector to swap elements.

Definition at line 392 of file vector_proxy.h.


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