#include <ltkcpp_base.h>
Public Member Functions | |
CDecoder (const CTypeRegistry *pTypeRegistry) | |
Constructor to build a decoder for the given type registry. | |
virtual CMessage * | decodeMessage (void)=0 |
Decodes a message into the return value CMessage. | |
Public Attributes | |
CErrorDetails | m_ErrorDetails |
The error details from the last decode operation. | |
Protected Attributes | |
const CTypeRegistry * | m_pRegistry |
By way of example, this is how the CDecoder and CDecoderStream classes work. This example is for decoding a binary frame.
+-------------------+ +---------------+ | | | | | CDecoder --------------->| CTypeRegistry | | | | | +--|----------------+ +---------------+ | ^ pointer | | to next | | +-------------------+ byte | | | | pointer to msg end | ^---- CDecoderStream ----------------+ | | | | | | | +-------------------+ | | | ^ | | | | | | | +-------------------+ ptr to | | | | | TLV end | | ^---- CDecoderStream ------------+ | | | | | | | | | +-------------------+ | | | | ^ | | | | | | | | | +-------------------+ | | | | | | | | | ^---- CDecoderStream --------+ | | | | | | | | | +-------------------+ | | | | | | | +-------------------+ | | | | | | | v v v v +---------------------------------------------------------------+ | Binary Frame Buffer | +---------------------------------------------------------------+
|_________________| Nested TLVs |________________||___________________________| Nested TLVs |_________________________________________________| Message
In the case of binary frame the references are to bytes within the buffer. Lookups are by type number.
In the case of an XML DOM tree, the references are to nodes in the DOM tre. Lookups are by string name.
Definition at line 1209 of file ltkcpp_base.h.