17 #ifndef HH_SENF_Packets_80221Bundle_TLVParser_ 18 #define HH_SENF_Packets_80221Bundle_TLVParser_ 1 60 # include SENF_PARSER() 72 void value(std::string
const &
id );
83 std::string valueAsString()
const;
92 bool valueEquals(
MIHFId const &
id)
const;
94 bool valueEquals(std::string
const &
id )
const;
101 void dump(std::ostream & os)
const;
102 void maxIdLength(boost::uint8_t maxl)
const;
112 template <
class OutputIterator>
113 struct binaryNAIEncoder {
114 binaryNAIEncoder(OutputIterator &
i);
115 void operator()(boost::uint8_t v);
119 template <
class OutputIterator>
120 static boost::function_output_iterator<binaryNAIEncoder<OutputIterator> >
121 getNAIEncodedOutputIterator(OutputIterator &
i);
123 struct binaryNAIDecoder {
125 bool operator()(boost::uint8_t v);
129 template <
class Iterator>
130 static boost::filter_iterator<binaryNAIDecoder, Iterator>
131 getNAIDecodedIterator(Iterator begin, Iterator end);
133 struct ValueSetterVisitor :
public boost::static_visitor<> {
136 void operator()( boost::blank )
const {
137 parser.
value( std::string());
139 template <
typename MIHFIdType>
140 void operator()( MIHFIdType
const &
id )
const {
145 struct ValueEqualsVisitor :
public boost::static_visitor<bool> {
148 bool operator()( boost::blank )
const {
151 template <
typename MIHFIdType>
152 bool operator()( MIHFIdType
const &
id )
const {
169 void dump(std::ostream & os)
const;
184 void dump(std::ostream & os)
const;
194 # include SENF_PARSER() 205 void dump(std::ostream & os)
const;
214 # include SENF_PARSER() 225 void dump(std::ostream & os)
const;
233 # include SENF_PARSER() 244 void dump(std::ostream & os)
const;
#define SENF_PARSER_INHERIT(base)
Define parser inheritance.
MIHFSrcIdTLVParser(data_iterator i, state_type s)
void maxLength(MIHLengthParser::value_type maxl) const
set maximum value of TLV length field
Parse 8bit unsigned byte aligned integer.
unspecified_keyword_type parser
senf::GenericTLVParserBase< MIHBaseTLVParser > base
Parser for 802.21 source MIHF_ID TLV.
void dump(std::ostream &os) const
#define SENF_PARSER_LABEL(name)
Define offset label.
Parser for 802.21 Status TLV.
void finalize()
shrink size of the TLV length field to minimum
Base class for generic TLV parsers.
#define SENF_PARSER_FIELD(name, type)
Define normal parser field.
boost::uint32_t value_type
#define SENF_PARSER_FINALIZE(name)
Generate parser control members.
MIHFDstIdTLVParser(data_iterator i, state_type s)
void defaultInit() const
Default implementation.
bool valueEquals(MIHFId const &id) const
Packet data STL-sequence view.
#define SENF_PARSER_INIT()
Define parser initialization routine.
#define SENF_PARSER_FIELD_RO(name, type)
Define parser field (read-only)
boost::uint8_t value_type
data_iterator i() const
Return beginning of data to parse.
#define SENF_PARSER_SKIP(skip)
Skip bytes.
static value_type const max_value
void swap(MIHFSrcIdTLVParser src, MIHFDstIdTLVParser dst)
Re-validating data iterator.
PacketInterpreterBase::range value() const
MIHLengthParser ::value_type idLength() const
TLVParserBase public header.
Parse 32bit unsigned byte aligned integer.
void validate(size_type size) const
Validate size of data container.
Parser for 802.21 destination MIHF_ID TLV.
Parser for a generic TLV packet.
Base class for MIH TLV parsers.
detail::packet::iterator data_iterator
Raw data iterator type.
void value(MIHFId const &id)
MIHGenericTLVParser(data_iterator i, state_type s)
MIHLengthParser length_() const