Collection of fixed-size elements. More...
#include <senf/Packets/VectorParser.hh>
Public Types | |
typedef ElementParser | value_type |
typedef detail::ArrayParser_iterator< value_type > | iterator |
typedef iterator | const_iterator |
typedef VectorParser_Container< ElementParser, AuxPolicy > | container_type |
Public Types inherited from senf::PacketParserBase | |
typedef detail::packet::iterator | data_iterator |
Raw data iterator type. More... | |
typedef detail::packet::size_type | size_type |
Unsigned integral type. More... | |
typedef detail::packet::difference_type | difference_type |
Signed integral type. More... | |
typedef detail::packet::byte | byte |
Unsigned 8bit value, the raw value type. More... | |
typedef PacketData * | state_type |
Type of the 'state' parameter. More... | |
typedef PacketParserBase | parser_base_type |
Base type of the next parser. More... | |
Public Member Functions | |
VectorParser (data_iterator i, state_type s) | |
VectorParser (AuxPolicy policy, data_iterator i, state_type s) | |
Additional sizer specific constructor. More... | |
size_type | bytes () const |
void | init () const |
container_type | container () const |
size_type | size () const |
bool | empty () const |
iterator | begin () const |
iterator | end () const |
value_type | operator[] (difference_type i) const |
value_type | front () const |
value_type | back () const |
template<class InputIterator > | |
void | assign (InputIterator first, InputIterator last) |
template<class Value > | |
void | push_back (Value const &value, size_type n=1) const |
value_type | push_back_space (size_type n=1) const |
template<class Value > | |
void | push_front (Value const &value, size_type n=1) const |
value_type | push_front_space (size_type n=1) const |
void | resize (size_type n) const |
template<class Value > | |
void | resize (size_type n, Value value) const |
Public Member Functions inherited from senf::PacketParserBase | |
data_iterator | i () const |
Return beginning of data to parse. More... | |
data_iterator | i (size_type offset) const |
Return iterator offset bytes from the start. More... | |
state_type | state () const |
Return state of this parser. More... | |
PacketData & | data () const |
Access the packets raw data container. More... | |
void | init () const |
Default implementation. More... | |
Static Public Attributes | |
static const size_type | init_bytes = AuxPolicy::aux_bytes |
Additional Inherited Members | |
Protected Member Functions inherited from senf::PacketParserBase | |
ParserProtector | protect () const |
PacketParserBase (data_iterator i, state_type s) | |
Standard constructor. More... | |
PacketParserBase (data_iterator i, state_type s, size_type size) | |
Size checking constructor. More... | |
bool | check (size_type size) const |
Check size of data container. More... | |
void | validate (size_type size) const |
Validate size of data container. More... | |
template<class Parser > | |
Parser | parse (data_iterator i) const |
Create sub-parser. More... | |
template<class Parser , class Arg > | |
Parser | parse (Arg const &arg, data_iterator i) const |
Create sub-parser. More... | |
template<class Parser > | |
Parser | parse (size_type n) const |
Create sub-parser. More... | |
template<class Parser , class Arg > | |
Parser | parse (Arg const &arg, size_type n) const |
Create sub-parser. More... | |
void | defaultInit () const |
Default implementation. More... | |
Packet | packet () const |
Get packet this parser is parsing from. More... | |
void | resize (size_type oldSize, size_type newSize) |
Resize data container. More... | |
Collection of fixed-size elements.
A Vector is a collection of fixed-size elements of which the size of the collection can be determined directly (that is without traversing the collection). This allows very efficient random access to the elements of the collection.
A vector is a model of an STL random-access sequence. The parser only provides a reduced interface, the container wrapper however completes this interface.
VectorParser makes use of a policy template argument, AuxPolicy, to customize the way the containers size is obtained. You will normally not instantiate VectorParser directly, you will use the 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 Collection parsers.
Definition at line 58 of file VectorParser.hh.
typedef iterator senf::VectorParser< ElementParser, AuxPolicy >::const_iterator |
Definition at line 78 of file VectorParser.hh.
typedef VectorParser_Container<ElementParser,AuxPolicy> senf::VectorParser< ElementParser, AuxPolicy >::container_type |
Definition at line 79 of file VectorParser.hh.
typedef detail::ArrayParser_iterator<value_type> senf::VectorParser< ElementParser, AuxPolicy >::iterator |
Definition at line 77 of file VectorParser.hh.
typedef ElementParser senf::VectorParser< ElementParser, AuxPolicy >::value_type |
Definition at line 76 of file VectorParser.hh.
senf::VectorParser< ElementParser, AuxPolicy >::VectorParser | ( | data_iterator | i, |
state_type | s | ||
) |
senf::VectorParser< ElementParser, AuxPolicy >::VectorParser | ( | AuxPolicy | policy, |
data_iterator | i, | ||
state_type | s | ||
) |
Additional sizer specific constructor.
This constructor may be used, if the sizer needs additional parameters.
void senf::VectorParser< ElementParser, AuxPolicy >::assign | ( | InputIterator | first, |
InputIterator | last | ||
) |
value_type senf::VectorParser< ElementParser, AuxPolicy >::back | ( | ) | const |
iterator senf::VectorParser< ElementParser, AuxPolicy >::begin | ( | ) | const |
size_type senf::VectorParser< ElementParser, AuxPolicy >::bytes | ( | ) | const |
container_type senf::VectorParser< ElementParser, AuxPolicy >::container | ( | ) | const |
bool senf::VectorParser< ElementParser, AuxPolicy >::empty | ( | ) | const |
iterator senf::VectorParser< ElementParser, AuxPolicy >::end | ( | ) | const |
value_type senf::VectorParser< ElementParser, AuxPolicy >::front | ( | ) | const |
void senf::VectorParser< ElementParser, AuxPolicy >::init | ( | ) | const |
value_type senf::VectorParser< ElementParser, AuxPolicy >::operator[] | ( | difference_type | i | ) | const |
void senf::VectorParser< ElementParser, AuxPolicy >::push_back | ( | Value const & | value, |
size_type | n = 1 |
||
) | const |
value_type senf::VectorParser< ElementParser, AuxPolicy >::push_back_space | ( | size_type | n = 1 | ) | const |
void senf::VectorParser< ElementParser, AuxPolicy >::push_front | ( | Value const & | value, |
size_type | n = 1 |
||
) | const |
value_type senf::VectorParser< ElementParser, AuxPolicy >::push_front_space | ( | size_type | n = 1 | ) | const |
void senf::VectorParser< ElementParser, AuxPolicy >::resize | ( | size_type | n | ) | const |
void senf::VectorParser< ElementParser, AuxPolicy >::resize | ( | size_type | n, |
Value | value | ||
) | const |
size_type senf::VectorParser< ElementParser, AuxPolicy >::size | ( | ) | const |
|
static |
Definition at line 71 of file VectorParser.hh.