Classes

struct  senf::ArrayParser< elements, ElementParser >
 Fixed size collection of fixed size elements. More...
 
class  senf::ListParser< ListPolicy >
 Arbitrary sequential element collection. More...
 
class  senf::VariantParser< AuxPolicy, Parsers >
 Variant parser. More...
 
struct  senf::VectorParser< ElementParser, AuxPolicy >
 Collection of fixed-size elements. More...
 

Detailed Description

Collection parsers are parsers which build collections from other parsers. Examples are a vector of 16bit unsigned integers or a list of lists of 32bit numbers and so on.

Collection parsers provide a (reduced) STL sequence like interface. It depends on the type of collection parser, what kind of sequence is modelled (e.g. random access sequence, forward sequence etc). Most collections will also provide a kind of container wrapper to allow extensive manipulations of the collection contents. A container wrapper is initialized with the collection parser and then provides a more complete sequence interface. Additionally, the collection wrapper has a longer lifetime than an ordinary parser: While a parser will be invalidated whenever the collection is changed, the container wrapper will stay valid as long as the collection is changed through the wrapper (directly or indirectly, where indirectly means that a sub-field or sub-collection of the collection is changed). Some collections may provide even more lifetime guarantees but this guarantee should be met by all collection wrappers.

Warning
Parser lifetime has to be tightly checked when working with collection parsers since every change of the collections size will invalidate all parsers and iterators referencing the complete packet chain. Collection wrappers do not invalidate if the change is after the collection.