|
| MessageFactory (const ByteBlock &bb, const Protocol *protocol) |
| Constructor: Analyze a TLV message in memory. More...
|
|
| MessageFactory (const void *addr, size_t size, const Protocol *protocol) |
| Constructor: Analyze a TLV message in memory. More...
|
|
void | buildErrorResponse (MessagePtr &msg) const |
| Return the error response for the peer. More...
|
|
TAG | commandTag () const |
| Get the message tag. More...
|
|
size_t | count (TAG tag) const |
| Get actual number of occurences of a parameter. More...
|
|
uint16_t | errorInformation () const |
| Get the "error information" resulting from the analysis of the message. More...
|
|
MessagePtr | errorResponse () const |
| Return the error response for the peer. More...
|
|
tlv::Error | errorStatus () const |
| Get the "error status" resulting from the analysis of the message. More...
|
|
MessagePtr | factory () const |
| Return the fully rebuilt message. More...
|
|
void | factory (MessagePtr &msg) const |
| Return the fully rebuilt message. More...
|
|
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr> |
INT | get (TAG tag) const |
| Get an integer parameter. More...
|
|
void | get (TAG tag, ByteBlock ¶m) const |
| Get an opaque byte block parameter. More...
|
|
void | get (TAG tag, Parameter ¶m) const |
| Get the location of a parameter. More...
|
|
void | get (TAG tag, std::string ¶m) const |
| Get a string parameter. More...
|
|
void | get (TAG tag, std::vector< bool > ¶m) const |
| Get a boolean parameter. More...
|
|
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr> |
void | get (TAG tag, std::vector< INT > ¶m) const |
| Get an integer parameter. More...
|
|
void | get (TAG tag, std::vector< Parameter > ¶m) const |
| Get the location of all occurences of a parameter. More...
|
|
void | get (TAG tag, std::vector< std::string > ¶m) const |
| Get a string parameter. More...
|
|
void | getCompound (TAG tag, MessagePtr ¶m) const |
| Get a compound TLV parameter. More...
|
|
template<class MSG > |
void | getCompound (TAG tag, MSG ¶m) const |
| Get a compound TLV parameter (template version). More...
|
|
void | getCompound (TAG tag, std::vector< MessagePtr > ¶m) const |
| Get a compound TLV parameter. More...
|
|
template<class MSG > |
void | getCompound (TAG tag, std::vector< MSG > ¶m) const |
| Get a compound TLV parameter (template version). More...
|
|
VERSION | protocolVersion () const |
| Get the protocol version number. More...
|
|
Factory class for TLV messages.
The following methods should be used by the application to deserialize messages:
The following types and methods should be used by the constructors of the ts::tlv::Message subclasses.
The get() and getCompound() methods retrieve the value of parameters. For each parameter type, two versions are available.
- The first version returns the first occurence of a parameter and is typically used when the cardinality of a parameter is 1 or 0 to 1. In the later case, the message deserialization routine should first check the availability of the parameter using count().
- The second version returns all occurences of the parameter in a vector.
An exception is thrown when the parameter is not present (first version) or when the actual size of the parameter does not match the expected size of the type. In both cases, this should not happen in properly written message classes since the validity of the parameters were checked by the constructor of the MessageFactory.