esp8266ndn
NDN Arduino library for ESP8266 and more
|
TLV decoder that understands Packet Format v0.3 evolvability guidelines. More...
#include <ev-decoder.hpp>
Classes | |
class | DefaultIsCritical |
class | DefaultUnknownCb |
Static Public Member Functions | |
template<typename... E> | |
static bool | decode (const Decoder::Tlv &input, std::initializer_list< uint32_t > topTypes, const E &... defs) |
Decode input TLV with a sequence of element definitions. More... | |
template<typename... E> | |
static bool | decodeValue (const Decoder &input, const E &... defs) |
Decode input TLV-VALUE with a sequence of element definitions. More... | |
template<typename UnknownCallback , typename IsCritical , typename... E> | |
static bool | decodeEx (const Decoder::Tlv &input, std::initializer_list< uint32_t > topTypes, const UnknownCallback &unknownCb, const IsCritical &isCritical, const E &... defs) |
Decode input TLV with a sequence of element definitions. More... | |
template<typename UnknownCallback , typename IsCritical , typename... E> | |
static bool | decodeValueEx (const Decoder &input, const UnknownCallback &unknownCb, const IsCritical &isCritical, const E &... defs) |
Decode input TLV-VALUE with a sequence of element definitions. More... | |
template<int type, bool repeatable = false, int order = 0, typename Fn = void, typename R = detail::EvdElementDefFn<type, repeatable, order, Fn>> | |
static R | def (const Fn &f, decltype(&Fn::operator())=nullptr) |
Create an element definition. More... | |
template<int type, bool repeatable = false, int order = 0, typename Decodable = void, typename R = detail::EvdElementDefDecodable<type, repeatable, order, Decodable>> | |
static R | def (Decodable *decodable, decltype(&Decodable::decodeFrom)=nullptr) |
Create an element definition. More... | |
template<int type, bool repeatable = false, int order = 0, typename R = detail::EvdElementDefIgnore<type, repeatable, order>> | |
static R | defIgnore () |
Create an element definition to ignore a field. More... | |
template<int type, typename NniClass = tlv::NNI, int order = 0, typename ValueType = void, typename R = detail::EvdElementDefNni<type, order, NniClass, ValueType>> | |
static R | defNni (ValueType *value) |
Create an element definition for Non-Negative Integer field. More... | |
TLV decoder that understands Packet Format v0.3 evolvability guidelines.
|
inlinestatic |
Decode input TLV with a sequence of element definitions.
Compare to decodeEx(), decode() does not allow customizing unknownCb and isCritical.
|
inlinestatic |
Decode input TLV with a sequence of element definitions.
UnknownCallback | `bool (*)(const Decoder::Tlv& d, int& currentOrder)`, return true to indicate TLV has been accepted. |
IsCritical | `bool (*)(uint32_t type)` |
E | ElementDef |
input | TLV element from Decoder. |
topTypes | a list of acceptable top-level TLV-TYPE numbers; if empty, top-level TLV-TYPE is not checked. |
unknownCb | callback to handle TLV with TLV-TYPE number not in defs. |
isCritical | callback to determine whether an unrecognized TLV-TYPE number is 'critical' and should cause a decode error. |
defs | a sequence of ElementDef to recognize each sub TLV element. |
|
inlinestatic |
Decode input TLV-VALUE with a sequence of element definitions.
Compare to decodeValueEx(), decodeValue() does not allow customizing unknownCb and isCritical.
|
inlinestatic |
Decode input TLV-VALUE with a sequence of element definitions.
|
inlinestatic |
Create an element definition.
type | TLV-TYPE number. |
repeatable | whether the TLV can be repeated. |
order | customized order number. Elements must appear in the TLV-VALUE in a certain order. By default, the order of defs passed to decode() determines the expected order. This parameter allows overriding the default order. |
Fn | `bool (*)(const Decoder::Tlv&)` or `void (*)(const Decoder::Tlv&)` |
f | function to process TLV element. |
|
inlinestatic |
Create an element definition.
Decodable | class with `bool decodeFrom(const Decoder::Tlv&)` method. |
|
inlinestatic |
Create an element definition to ignore a field.
|
inlinestatic |
Create an element definition for Non-Negative Integer field.
NniClass | either tlv::NNI or a fixed-length variant. |