Decoder for static structures defined by a DDL definition.
More...
#include <static_codec.h>
|
| cStaticDecoder (std::shared_ptr< const cStructLayout > pLayout, const void *pData, size_t nDataSize, tDataRepresentation eRep) |
| For internal use only.
|
|
virtual const tStructLayoutElement * | GetLayoutElement (size_t nIndex) const |
| For internal use only.
|
|
◆ DefinedStructElementType
◆ GetElement()
Access information about an element.
- Parameters
-
[in] | nIndex | The index of the element. |
[out] | pElement | Pointer that will be updated to point to the element information. |
- Return values
-
ERR_INVALID_INDEX | Invalid element index. |
Referenced by cSampleDecoder::operator=().
◆ GetElementAddress()
const void * GetElementAddress |
( |
size_t | nIndex | ) |
const |
◆ GetElementCount()
virtual size_t GetElementCount |
( |
| ) |
const |
|
virtual |
- Returns
- The amount of elements contained in the data structure.
Reimplemented in cDecoder.
◆ GetElementValue() [1/2]
Returns the current value of the given element as a variant.
- Parameters
-
[in] | nIndex | The index of the element. |
[out] | oValue | The will be set to the current value. |
- Return values
-
ERR_INVALID_INDEX | Invalid element index. |
◆ GetElementValue() [2/2]
tResult GetElementValue |
( |
size_t | nIndex, |
|
|
void * | pValue ) const |
Returns the current value of the given element by copying its data to the passed-in location.
- Parameters
-
[in] | nIndex | The index of the element. |
[out] | pValue | The location where the value should be copied to. |
- Return values
-
ERR_INVALID_INDEX | Invalid element index. |
Referenced by cSampleDecoder::operator=().
◆ GetElementValueString()
Returns the current value of the given element as a string.
- Parameters
-
[in] | nIndex | The index of the element. |
- Return values
-
◆ GetLayoutElement()
virtual const tStructLayoutElement * GetLayoutElement |
( |
size_t | nIndex | ) |
const |
|
protectedvirtual |
For internal use only.
Reimplemented in cDecoder.
◆ GetRepresentation()
- Returns
- The data representation which this decoder handles.
◆ GetStaticBufferSize()
size_t GetStaticBufferSize |
( |
tDataRepresentation | eRep = tDataRepresentation::Deserialized | ) |
const |
- Parameters
-
[in] | eRep | The data representation for which the buffer size should be returned. |
- Returns
- The size of the structure in the requested data representation.
◆ GetStructElementName()
static const char * GetStructElementName |
( |
const tStructElement * | pElement | ) |
|
|
static |
Access information about an element.
- Parameters
-
[in] | pElement | pointer to the element to retriev the name from |
- Return values
-
ERR_INVALID_INDEX | Invalid element index. |
◆ IsValid()
- Returns
- Whether or not the decoder is valid.
- Return values
-
ERR_INVALID_ARG | The passed data is not large enough. |
Reimplemented in cDecoder.
◆ m_nDataSize
◆ m_pData
◆ m_pElementAccessor
const cElementAccessor* m_pElementAccessor |
|
protected |
◆ m_pLayout
std::shared_ptr<const cStructLayout> m_pLayout |
|
protected |