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 Member Functions | Static Public Attributes | Protected Attributes | List of all members
Hg::msg_view< MsgT, ByteOrderT > Class Template Reference

The MsgView object to manage structured access over an opaque buffer. More...

#include <msg_view.h>

Public Member Functions

 msg_view ()
 Default constructor.
 
template<size_t SizeT>
 msg_view (std::array< byte_t, SizeT > &data)
 Value constructor. More...
 
 msg_view (std::vector< byte_t > &data)
 Value constructor. More...
 
 msg_view (const byte_t *pData, size_t length)
 Value constructor. More...
 
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.
 
size_t size () const
 Returns the number of valid objects managed by this array structure.
 

Static Public Attributes

static const bool k_has_dynamic = has_dynamic<format_type>::value
 Indicates if the format of this message contains fields that are potentially dynamically allocated.
 

Protected Attributes

raw_pointer m_pFirst
 A pointer to the first element.
 
raw_pointer m_pLast
 A pointer to the last element + 1.
 

Detailed Description

template<typename MsgT, typename ByteOrderT = Hg::HostByteOrder>
class Hg::msg_view< MsgT, ByteOrderT >

The MsgView object to manage structured access over an opaque buffer.

Definition at line 27 of file msg_view.h.

Constructor & Destructor Documentation

template<typename MsgT , typename ByteOrderT = Hg::HostByteOrder>
template<size_t SizeT>
Hg::msg_view< MsgT, ByteOrderT >::msg_view ( std::array< byte_t, SizeT > &  data)
inline

Value constructor.

Create a view from an array of bytes.

Parameters
viewA reference to an array of bytes, to which this view will be mapped.

Definition at line 81 of file msg_view.h.

template<typename MsgT , typename ByteOrderT = Hg::HostByteOrder>
Hg::msg_view< MsgT, ByteOrderT >::msg_view ( std::vector< byte_t > &  data)
inline

Value constructor.

Create a view from an vector of bytes.

Parameters
viewA reference to a vector of bytes, to which this view will be mapped.

Definition at line 100 of file msg_view.h.

template<typename MsgT , typename ByteOrderT = Hg::HostByteOrder>
Hg::msg_view< MsgT, ByteOrderT >::msg_view ( const byte_t pData,
size_t  length 
)
inline

Value constructor.

Create a view from an existing array of bytes.

Parameters
pDataA pointer to an array of bytes, to which this view will be mapped.
lengthThe number of bytes in the buffer.

Definition at line 120 of file msg_view.h.


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