ADTF
|
Decoder Base Class. More...
Public Types | |
typedef ddl::codec::DecoderElement< sample_decoder_access< const cSampleDecoderBase > > | tElement |
Iterator value element type for the codec to get value, set value and get element information. More... | |
typedef ddl::codec::ChildElements< sample_decoder_access< const cSampleDecoderBase > > | tElements |
Iterator container to iterate all elements of the decoder. More... | |
Public Types inherited from cDecoderLegacy | |
typedef ddl::StructElement | DefinedStructElementType |
type definition for the old access_element API. | |
Public Member Functions | |
cSampleDecoderBase (cSampleDecoderBase &&) | |
cSampleDecoderBase & | operator= (cSampleDecoderBase &&) |
tResult | IsValid () const |
Returns the validation state of the coder. More... | |
tElement | GetElement (const tCodecIndex &oCodecIndex) const |
Retrieves an element for the codec index. More... | |
tElement | GetElement (const std::string &strElementFullName) const |
Retrieves an element for the given name. More... | |
const tElements & | GetElements () const |
Retrieves the elements of the decoder to get element information and the values. More... | |
size_t | GetElementChildCount (const tCodecIndex &oCodecIndex) const |
Retrieves the amount of child elements for the given codec index. More... | |
std::string | GetElementFullName (const tCodecIndex &oCodecIndex) const |
Retrieves the full name of the element within its main structure. More... | |
std::string | GetElementName (const tCodecIndex &oCodecIndex) const |
Retrieves the name of the element within its structured element. More... | |
const std::string & | GetElementBaseName (const tCodecIndex &oCodecIndex) const |
Retrieves the base name of the element within its structured element. More... | |
size_t | GetStaticBufferSize () const |
Gets the static buffer size in bytes for the main structure. More... | |
size_t | GetStaticBufferSize (ddl::tDataRepresentation oRep) const |
Gets the static buffer size in bytes for the main structure. More... | |
ddl::tDataRepresentation | GetRepresentation () const |
Returns the current data representation the decoder decodes from. More... | |
template<typename T > | |
T | GetElementValue (const tCodecIndex &oCodecIndex) const |
Gets the elements value as value of type T. More... | |
template<typename T > | |
T | GetElementValue (const penguin::tLeafCodecIndex &oLeafCodecIndex) const |
Gets the elements value as value of type T. More... | |
a_util::variant::Variant | GetElementVariantValue (const tCodecIndex &oCodecIndex) const |
Returns the current value of the given element as a variant. More... | |
void | GetElementVariantValue (const tCodecIndex &oCodecIndex, a_util::variant::Variant &oValue) const |
Returns the current value of the given element as a variant. More... | |
std::string | GetElementStringValue (const tCodecIndex &oCodecIndex) const |
Returns the current value of the given element as a string. More... | |
void | GetElementRawValue (const tCodecIndex &oCodecIndex, void *pValue, size_t szValueSize) const |
Copies the elements value to the given memory pointer in @pValue. More... | |
const void * | GetElementAddress (const tCodecIndex &oCodecIndex) const |
Gets the elements value memory pointer into the given data. More... | |
void | Resolve (tCodecIndex &oCodecIndex) const |
retrieves the lyoutinformation for the given codec index. More... | |
Public Member Functions inherited from cDecoderLegacy | |
tCodecIndex | Resolve (tCodecLeafIndex nElementLeafIndex) const |
Legacy: Retrieves a codec index with element information for the given leaf index. More... | |
adtf_util::cVariant | GetElementValue (tCodecLeafIndex nElementLeafIndex) const |
Legacy: Get the Element Value. More... | |
tResult | GetElementValue (tCodecLeafIndex nElementLeafIndex, adtf_util::cVariant &oValue) const |
Legacy: Get the Element Value. More... | |
tResult | GetElementValue (const char *strElementName, adtf_util::cVariant &oValue) const |
Legacy: Get the Element Value. More... | |
tResult | GetElementValue (tCodecLeafIndex nElementLeafIndex, void *pValue) const |
Legacy: Copies the Element Value memory into the memory pointer. More... | |
tResult | GetElementValue (const char *strElementName, void *pValue) const |
Legacy: Get the Element Value pointer. More... | |
adtf_util::cString | GetElementValueString (tCodecLeafIndex nElementLeafIndex) const |
Legacy: Get the Element Value as string (resolved to the enum element name if is enum type) More... | |
tResult | GetElement (tCodecLeafIndex nElementLeafIndex, const ddl::StructElement *&pElement) const |
Get the Element StructElement information. More... | |
const void * | GetElementAddress (tCodecLeafIndex nElementIndex) const |
Legacy: Get the Element StructElement information. More... | |
size_t | GetElementCount () const |
Legacy: Get the Element Leaf count. More... | |
Protected Member Functions | |
void | ResetFirst () |
Protected Member Functions inherited from cDecoderLegacy | |
virtual const ddl::codec::StaticDecoder * | getDecoder () const =0 |
Get the base ddl::Decoder. More... | |
Private Attributes | |
tElement | m_oFirstElement |
Additional Inherited Members | |
Static Public Member Functions inherited from cDecoderLegacy | |
static const char * | GetStructElementName (const ddl::StructElement *pElement) |
Legacy: Get the Struct Element Name for access_element legacy support. More... | |
Decoder Base Class.
Definition at line 35 of file sample_codec.h.
typedef ddl::codec::DecoderElement<sample_decoder_access<const cSampleDecoderBase> > tElement |
Iterator value element type for the codec to get value, set value and get element information.
Definition at line 59 of file sample_codec.h.
typedef ddl::codec::ChildElements<sample_decoder_access<const cSampleDecoderBase> > tElements |
Iterator container to iterate all elements of the decoder.
Definition at line 94 of file sample_codec.h.
tElement GetElement | ( | const std::string & | strElementFullName | ) | const |
Retrieves an element for the given name.
[in] | strElementFullName | The full name of the element in point notation (i.e. "element1.child_element[4].element_value" ). |
throws | tResult if not found. |
tElement GetElement | ( | const tCodecIndex & | oCodecIndex | ) | const |
Retrieves an element for the codec index.
You may use a valid codec index retrieved by the cSampleCodecFactory, but no other! This is to prepare for decoding in advance:
[in] | oCodecIndex | The codec index retrieved by the used cSampleCodecFactory for this decoder. |
throws | tResult if not found. |
const void* GetElementAddress | ( | const tCodecIndex & | oCodecIndex | ) | const |
Gets the elements value memory pointer into the given data.
[in] | oCodecIndex | The codec index of the element. |
throws | tResult if not found. |
const std::string& GetElementBaseName | ( | const tCodecIndex & | oCodecIndex | ) | const |
Retrieves the base name of the element within its structured element.
If the element is an array you get the elements base name respresentation : "element_name" for each array element. If the element is not an array you get the elements name respresentation is also the base name respresentation: "element_name" .
[in] | oCodecIndex | The codec index of the element. |
throws | tResult if not found. |
size_t GetElementChildCount | ( | const tCodecIndex & | oCodecIndex | ) | const |
Retrieves the amount of child elements for the given codec index.
[in] | oCodecIndex | The codec index of the element. |
0 | has no children. May be a leaf element. |
>0 | has children. May be a structured element. |
throws | tResult if not found. |
std::string GetElementFullName | ( | const tCodecIndex & | oCodecIndex | ) | const |
Retrieves the full name of the element within its main structure.
If the element is an array you get the elements array name respresentation: "main_element.element_name[0]" or main_element.element_name[1] ... etc. If the element is not an array you get the elements name respresentation: "main_element.element_name".
[in] | oCodecIndex | The codec index of the element. |
throws | tResult if not found. |
std::string GetElementName | ( | const tCodecIndex & | oCodecIndex | ) | const |
Retrieves the name of the element within its structured element.
If the element is an array you get the elements array name respresentation: "element_name[0]" or element_name[1] ... etc. If the element is not an array you get the elements name respresentation: "element_name".
[in] | oCodecIndex | The codec index of the element. |
throws | tResult if not found. |
void GetElementRawValue | ( | const tCodecIndex & | oCodecIndex, |
void * | pValue, | ||
size_t | szValueSize | ||
) | const |
Copies the elements value to the given memory pointer in @pValue.
[in] | oCodecIndex | The codec index of the element. |
[out] | pValue | The memory pointer to copy the value memory to. |
[in] | szValueSize | size in bytes of the memory in pValue (if szValueSize is set to 0 there is no check for memory size.) |
throws | tResult if not found or szValueSize is lower then elment value memory. |
const tElements& GetElements | ( | ) | const |
Retrieves the elements of the decoder to get element information and the values.
std::string GetElementStringValue | ( | const tCodecIndex & | oCodecIndex | ) | const |
Returns the current value of the given element as a string.
If this element is a enum type the enum types element name will be set.
[in] | oCodecIndex | The index of the element. |
throws | tResult if not found. |
|
inline |
Gets the elements value as value of type T.
You may use a valid codec index retrieved by the cSampleCodecFactory, but no other! This is to prepare for decoding in advance:
[in] | oCodecIndex | The codec index of the element. |
T | The type of the value to return. |
throws | tResult if not found. |
Definition at line 218 of file sample_codec.h.
References cDecoderLegacy::getDecoder().
|
inline |
Gets the elements value as value of type T.
You may use a valid codec index retrieved by the cSampleCodecFactory, but no other! This is to prepare for decoding in advance:
[in] | oCodecIndex | The codec index of the element. |
T | The type of the value to return. |
throws | tResult if not found. |
Definition at line 184 of file sample_codec.h.
References cDecoderLegacy::getDecoder().
a_util::variant::Variant GetElementVariantValue | ( | const tCodecIndex & | oCodecIndex | ) | const |
Returns the current value of the given element as a variant.
[in] | oCodecIndex | The index of the element. |
throws | tResult if not found. |
void GetElementVariantValue | ( | const tCodecIndex & | oCodecIndex, |
a_util::variant::Variant & | oValue | ||
) | const |
Returns the current value of the given element as a variant.
[in] | oCodecIndex | The index of the element. |
[out] | oValue | Variant to return the current value to, type will be set. |
throws | tResult if not found. |
ddl::tDataRepresentation GetRepresentation | ( | ) | const |
Returns the current data representation the decoder decodes from.
size_t GetStaticBufferSize | ( | ) | const |
Gets the static buffer size in bytes for the main structure.
size_t | size in bytes of the structure depending on the current representation (GetRepresentation) |
size_t GetStaticBufferSize | ( | ddl::tDataRepresentation | oRep | ) | const |
Gets the static buffer size in bytes for the main structure.
eRep | option to retrieve size in bytes for the deserialized or serialized representation. |
size_t | size in bytes of the structure depending on the given representation eRep |
tResult IsValid | ( | ) | const |
Returns the validation state of the coder.
ERR_NOERROR | if everything is okay |
error | code + error description. |
Referenced by decoding_sample_reader< ReaderImplementation >::GetLastDecoder(), and decoding_sample_reader< ReaderImplementation >::GetNextDecoder().
void Resolve | ( | tCodecIndex & | oCodecIndex | ) | const |
retrieves the lyoutinformation for the given codec index.
[in] | oCodecIndex | The codec index of the element to retrieve. |