ADTF
3.14.3
|
Decoder for static structures defined by a DataDefinition definition. More...
Public Types | |
typedef DecoderElement< DecoderElementAccess< const StaticDecoder > > | Element |
Static decoder element. | |
typedef ChildElements< DecoderElementAccess< const StaticDecoder > > | Elements |
Iterator container to iterate all elements of the static decoder. More... | |
Public Member Functions | |
StaticDecoder () | |
Default constructor. | |
StaticDecoder (const StaticDecoder &)=delete | |
Noncopyable. | |
StaticDecoder & | operator= (const StaticDecoder &)=delete |
Noncopyable. | |
StaticDecoder (StaticDecoder &&) | |
Move constructor. | |
StaticDecoder & | operator= (StaticDecoder &&) |
Move assignment operator. | |
virtual a_util::result::Result | isValid () const |
Element | getElement (const CodecIndex &codec_index) const |
Retrieves an element instance based on the codec index of that element. More... | |
Element | getElement (const std::string &full_element_name) const |
Retrieves an element instance based on the full name of the element. More... | |
const Elements & | getElements () const |
Retrieves the elements of the static decoder to get element information. More... | |
size_t | getElementChildCount (const CodecIndex &codec_index=CodecIndex()) const |
Retrieves the amount of child elements for the given codec index. More... | |
std::string | getElementFullName (const CodecIndex &codec_index) const |
Retrieves the full name of the element within its main structure. More... | |
std::string | getElementName (const CodecIndex &codec_index) const |
Retrieves the name of the element within its structured element. More... | |
const std::string & | getElementBaseName (const CodecIndex &codec_index) const |
Retrieves the base name of the element within its structured element. More... | |
template<typename T > | |
T | getElementValue (const CodecIndex &codec_index) const |
Returns the current value of the given element as a T if supported. More... | |
a_util::variant::Variant | getElementVariantValue (const CodecIndex &codec_index) const |
Returns the current value of the given element as a variant. More... | |
void | getElementVariantValue (const CodecIndex &codec_index, a_util::variant::Variant &value) const |
Returns the current value of the given element as a variant. More... | |
std::string | getElementStringValue (const CodecIndex &codec_index) const |
Returns the current value of the given element as a string. More... | |
void | getElementRawValue (const CodecIndex &index, void *value, size_t value_size) const |
Returns the current value of the given element as a variant. More... | |
const void * | getElementAddress (const CodecIndex &index) const |
size_t | getStaticBufferSize () const |
Gets the static buffer size in bytes for the main structure. More... | |
size_t | getStaticBufferSize (DataRepresentation rep) const |
Gets the static buffer size in bytes for the main structure. More... | |
DataRepresentation | getRepresentation () const |
Returns the current data representation the decoder decodes from. More... | |
CodecIndex | resolve (size_t leaf_index) const |
size_t | getElementCount () const |
is the leaf count More... | |
a_util::result::Result | getElement (size_t leaf_index, const ddl::StructElement *&legacy_struct_element) const |
Returns the StructElement of the element with given leaf index. More... | |
void | resolve (CodecIndex &codec_index) const |
The codec index will be resolved for fast access. More... | |
Protected Member Functions | |
StaticDecoder (std::shared_ptr< const StructAccess > codec_access, const void *data, size_t data_size, DataRepresentation representation) | |
For internal use only. | |
Protected Attributes | |
std::shared_ptr< const StructAccess > | _codec_access |
const void * | _data = nullptr |
For internal use only. | |
size_t | _data_size = 0 |
For internal use only. | |
const ddl::codec::ElementAccessor * | _element_accessor |
For internal use only. | |
Private Attributes | |
ddl::access_element::StructElementLegacy< const StaticDecoder > | _legacy_element |
For internal use only. | |
Element | _first_element |
Decoder for static structures defined by a DataDefinition definition.
Definition at line 31 of file repo/src/libraries/mediadescription/include/ddl/codec_preview/static_codec.h.
typedef ChildElements<DecoderElementAccess<const StaticDecoder> > Elements |
Iterator container to iterate all elements of the static decoder.
Definition at line 83 of file repo/src/libraries/mediadescription/include/ddl/codec_preview/static_codec.h.
Element getElement | ( | const CodecIndex & | codec_index | ) | const |
Retrieves an element instance based on the codec index of that element.
[in] | codec_index | The codec index. |
throws | std::runtime_error if not found. |
Element getElement | ( | const std::string & | full_element_name | ) | const |
Retrieves an element instance based on the full name of the element.
[in] | full_element_name | The full name of the element in point notation (i.e. "element1.child_element[4].element_value" ). |
throws | std::runtime_error if not found. |
a_util::result::Result getElement | ( | size_t | leaf_index, |
const ddl::StructElement *& | legacy_struct_element | ||
) | const |
Returns the StructElement of the element with given leaf index.
[in] | leaf_index | The leaf index of the element. |
[out] | legacy_struct_element | the struct element legacy description. |
const void* getElementAddress | ( | const CodecIndex & | index | ) | const |
[in] | index | The index of the element. |
const std::string& getElementBaseName | ( | const CodecIndex & | codec_index | ) | 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] | codec_index | The codec index of the element. |
throws | std::runtime_error if not found. |
size_t getElementChildCount | ( | const CodecIndex & | codec_index = CodecIndex() | ) | const |
Retrieves the amount of child elements for the given codec index.
[in] | codec_index | The codec index of the element. |
0 | has no children. May be a leaf element. |
>0 | has children. May be a structured element. |
throws | std::runtime_error if not found. |
size_t getElementCount | ( | ) | const |
is the leaf count
std::string getElementFullName | ( | const CodecIndex & | codec_index | ) | 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] | codec_index | The codec index of the element. |
throws | std::runtime_error if not found. |
std::string getElementName | ( | const CodecIndex & | codec_index | ) | 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] | codec_index | The codec index of the element. |
throws | std::runtime_error if not found. |
void getElementRawValue | ( | const CodecIndex & | index, |
void * | value, | ||
size_t | value_size | ||
) | const |
Returns the current value of the given element as a variant.
[in] | index | The index of the element. |
[out] | value | The will be set to the current value. |
[in] | value_size | Size of the memory in value (if set to 0: unsafe usage of value without size check) |
throws | std::runtime_error if not found. |
const Elements& getElements | ( | ) | const |
Retrieves the elements of the static decoder to get element information.
std::string getElementStringValue | ( | const CodecIndex & | codec_index | ) | 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] | codec_index | The index of the element. |
throws | std::runtime_error if not found. |
|
inline |
Returns the current value of the given element as a T if supported.
[in] | codec_index | The index of the element. |
T | The type of the value to retrieve. |
throws | std::runtime_error if not found. |
Definition at line 140 of file repo/src/libraries/mediadescription/include/ddl/codec_preview/static_codec.h.
References ValueGetter< DecoderType, ValueType >::getValue().
a_util::variant::Variant getElementVariantValue | ( | const CodecIndex & | codec_index | ) | const |
Returns the current value of the given element as a variant.
[in] | codec_index | The index of the element. |
throws | std::runtime_error if not found. |
void getElementVariantValue | ( | const CodecIndex & | codec_index, |
a_util::variant::Variant & | value | ||
) | const |
Returns the current value of the given element as a variant.
[in] | codec_index | The index of the element. |
[out] | value | Variant to return the current value to, type will be set. |
throws | std::runtime_error if not found. |
DataRepresentation 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 getStaticBufferSize | ( | DataRepresentation | rep | ) | const |
Gets the static buffer size in bytes for the main structure.
[in] | rep | The data representation for which the buffer size should be returned. |
|
virtual |
ERR_INVALID_ARG | The passed data is not large enough. |
Reimplemented in Decoder.
void resolve | ( | CodecIndex & | codec_index | ) | const |
The codec index will be resolved for fast access.
[in] | The | codec index to resolve. |
throws | std::runtime_error if not found. |
CodecIndex resolve | ( | size_t | leaf_index | ) | const |
[in] | leaf_index | The leaf index of the element. |
throws | std::runtime_error if not found. |