/** \file
\brief VectorParser public header */
-#ifndef HH_VectorParser_
-#define HH_VectorParser_ 1
+#ifndef HH_SENF_Packets_VectorParser_
+#define HH_SENF_Packets_VectorParser_ 1
// Custom includes
#include <boost/iterator/iterator_facade.hpp>
VectorParser makes use of a policy template argument, \a AuxPolicy, to customize the way the
containers size is obtained. You will normally not instantiate VectorParser directly, you
will use the \ref SENF_PARSER_VECTOR() helper macro.
+
+ Some basic vector access methods are defined as parser members. To access the complete list
+ API however you will need to instantiate a container wrapper for the vector. See \ref
+ packet_usage_fields_collection.
+ \see
+ \ref How to access \ref packet_usage_fields_collection \n
+ SENF_PARSER_VECTOR() macro used to define vector fields \n
+ VectorParser_Container vector container wrapper API
+
\ingroup parsecollection
*/
template <class ElementParser, class AuxPolicy>
*/
template <class ElementParser, class AuxPolicy>
class VectorParser_Container
- : private AuxPolicy
+ : private AuxPolicy::WrapperPolicy
{
public:
///////////////////////////////////////////////////////////////////////////
SENF_PARSER_VECTOR ( vec, vec_size_, senf::UInt32Parser );
\endcode
+ \warning Realize, that the \a size field is controlled by the vector parser. This field
+ should therefore be declared either read-only or private and must be changed only via
+ the vector parser.
+
Further additional tags are supported which modify the way, the \a size field is
interpreted:
<table class="senf fixedcolumn">
<tr><td>\c bytes(\a size)</td><td>\a size gives the size of the vector in bytes not the
number of contained elements</td></tr>
+
+ <tr><td>\c packetSize()</td><td>Use the size of the packet to get the vector size. The
+ vector will occupy all space up to the end of the packet.</td></tr>
<tr><td>\c transform(\a transform, \a size)</td><td>The \a transform is applied to the \a
size value, the value is not used directly</td>
The tags are applied to the \a size parameter:
\code
SENF_PARSER_VECTOR ( vec, transform(MyTransform, vec_size_), senf::UInt32Parser );
+ SENF_PARSER_VECTOR ( vec, packetSize(), senf::UInt32Parser );
\endcode
\param[in] name field name
\param[in] size name of field giving the vector size
\param[in] elt_type vector element type
+ \see
+ How to use \ref packet_usage_fields_collection \n
+ senf::VectorParser the vector parser API for vector field access
+ senf::VectorParser_Container the vector parser container API for vector field access
+
\hideinitializer
\ingroup packetparsermacros
*/
///////////////////////////////hh.e////////////////////////////////////////
#endif
-#if !defined(HH_Packets__decls_) && !defined(HH_VectorParser_i_)
-#define HH_VectorParser_i_
+#if !defined(HH_SENF_Packets_Packets__decls_) && !defined(HH_SENF_Packets_VectorParser_i_)
+#define HH_SENF_Packets_VectorParser_i_
//#include "VectorParser.cci"
#include "VectorParser.ct"
#include "VectorParser.cti"