ADTF
cScriptStructure

A wrapper for adtf::mediadescription::structure. More...

Inheritance diagram for cScriptStructure:
[legend]

Public Member Functions

Q_INVOKABLE QObject * add (const QString &strElementName, const QJSValue &oElementType, quint64 nArraySize=1)
 Adds an element to the structure definition. More...
 
- Public Member Functions inherited from DDStructure
 DDStructure ()=delete
 Construct a new DDStructure object.
 
 DDStructure (DDStructure &&other)
 Construct a new DDStructure object. More...
 
 DDStructure (const DDStructure &other)
 Construct a new DDStructure object. More...
 
DDStructureoperator= (DDStructure &&other)
 move assignment operator More...
 
DDStructureoperator= (const DDStructure &other)
 copy assignment operator More...
 
 ~DDStructure ()=default
 Destroy the DDStructure object.
 
 DDStructure (const std::string &name, const uint32_t struct_version=1, dd::OptionalSize alignment={}, const std::string &comment={}, const dd::Version &ddl_version={})
 Construct a new DDStructure object. More...
 
 DDStructure (const std::string &name, const std::string &xml_string, const dd::Version &ddl_xml_file_version_to_parse=dd::Version(0, 0))
 Construct a new DDStructure object. More...
 
DDStructureaddElement (const std::string &element_name, const dd::DataType &data_type, size_t array_size=1)
 Adds one element to the struct using a (POD) DataType. More...
 
DDElementRef createElement (const std::string &element_name, const dd::DataType &data_type, size_t array_size=1)
 Creates one element to the struct using a (POD) DataType. More...
 
DDStructureaddElement (const std::string &element_name, const dd::DataType &data_type, size_t array_size, size_t alignment)
 Adds one element to the struct using a (POD) DataType. More...
 
DDElementRef createElement (const std::string &element_name, const dd::DataType &data_type, size_t array_size, size_t alignment)
 Creates one element to the struct using a (POD) DataType. More...
 
DDStructureaddElement (const std::string &element_name, const DDDataType &data_type, size_t array_size=1)
 Adds one element to the struct using a (POD) DataType. More...
 
DDElementRef createElement (const std::string &element_name, const DDDataType &data_type, size_t array_size=1)
 Creates one element to the struct using a (POD) DataType. More...
 
DDStructureaddElement (const std::string &element_name, const DDDataType &data_type, size_t array_size, size_t alignment)
 Adds one element to the struct using a (POD) DataType. More...
 
DDElementRef createElement (const std::string &element_name, const DDDataType &data_type, size_t array_size, size_t alignment)
 Creates one element to the struct using a (POD) DataType. More...
 
template<typename PREDEF_DATA_TYPE >
DDStructureaddElement (const std::string &element_name, size_t array_size=1, const std::string &special_type_name={})
 Adds one element to the struct using a (POD) DataType. More...
 
template<typename PREDEF_DATA_TYPE >
DDElementRef createElement (const std::string &element_name, size_t array_size=1, const std::string &special_type_name={})
 Create one element to the struct using a (POD) DataType. More...
 
template<typename PREDEF_DATA_TYPE >
DDStructureaddElement (const std::string &element_name, size_t array_size, size_t alignment, const std::string &special_type_name={})
 Adds one element to the struct using a (POD) DataType. More...
 
template<typename PREDEF_DATA_TYPE >
DDElementRef createElement (const std::string &element_name, size_t array_size, size_t alignment, const std::string &special_type_name={})
 Creates one element to the struct using a (POD) DataType. More...
 
DDStructureaddElement (const std::string &element_name, const DDEnum &enum_type, size_t array_size, const std::string &constant_value={})
 Adds one element to the struct using the convenience class DDEnum. More...
 
DDElementRef createElement (const std::string &element_name, const DDEnum &enum_type, size_t array_size, const std::string &constant_value={})
 Creates one element to the struct using the convenience class DDEnum. More...
 
DDStructureaddElement (const std::string &element_name, const DDEnum &enum_type, size_t array_size, size_t alignment, const std::string &constant_value={})
 Adds one element to the struct using the convenience class DDEnum. More...
 
DDElementRef createElement (const std::string &element_name, const DDEnum &enum_type, size_t array_size, size_t alignment, const std::string &constant_value={})
 Creates one element to the struct using the convenience class DDEnum. More...
 
DDStructureaddElement (const std::string &element_name, const DDEnum &enum_type, const std::string &constant_value={})
 Adds one element to the struct using the convenience class DDEnum. More...
 
DDElementRef createElement (const std::string &element_name, const DDEnum &enum_type, const std::string &constant_value={})
 Creates one element to the struct using the convenience class DDEnum. More...
 
DDStructureaddElement (const std::string &element_name, const DDStructure &struct_type, size_t array_size=1)
 Adds one element to the struct using the convenience class DDStructure. More...
 
DDElementRef createElement (const std::string &element_name, const DDStructure &struct_type, size_t array_size=1)
 Creates one element to the struct using the convenience class DDStructure. More...
 
DDStructureaddElement (const std::string &element_name, const DDStructure &struct_type, size_t array_size, size_t alignment)
 Adds one element to the struct using the convenience class DDStructure. More...
 
DDElementRef createElement (const std::string &element_name, const DDStructure &struct_type, size_t array_size, size_t alignment)
 Creates one element to the struct using the convenience class DDStructure. More...
 
DDStructureaddElement (const DDElement &element)
 Adds one element to the struct using the convenience class DDElement. More...
 
DDElementRef createElement (const DDElement &element)
 Creates one element to the struct using the convenience class DDElement. More...
 
DDStructureaddElements (const std::vector< DDElement > &elements)
 Adds a list of element to the struct using the convenience class DDElement. More...
 
const_iterator cbegin () const
 returns the first elements iterator. More...
 
const_iterator cend () const
 returns the end elements iterator. More...
 
const_iterator begin () const
 returns the first elenents iterator for range based iterations. More...
 
const_iterator end () const
 returns the end elements iterator. More...
 
const dd::DataDefinitiongetDD () const
 returns a valid DDL. More...
 
const dd::StructTypegetStructType () const
 Get the Struct Type object. More...
 
std::string getStructDescription () const
 Gets the Struct Data Description as XML String. More...
 
std::string getStructName () const
 Gets the Struct Name. More...
 
bool isCompatible (const DDStructure &other) const
 binary compares the structs More...
 
bool isEqual (const DDStructure &other) const
 equal in names and descriptions More...
 
size_t getSize () const
 Retrieves the current evaluated deserialized size (in bytes) of the structure. More...
 
size_t getAlignment () const
 Retrieves the current evaluated alignment of the structure. More...
 
void setStructInfo (const std::string &comment)
 Set additional struct information like comment. More...
 
void setElementInfo (const std::string &element_name, const std::string &description={}, const std::string &comment={}, const std::string &value={}, const std::string &minimum_value={}, const std::string &maximum_value={}, const std::string &default_value={}, const std::string &scale={}, const std::string &offset={})
 Set additional element information to the given element_name. More...
 
void setElementUnit (const std::string &element_name, const DDUnit &unit)
 Sets additional element unit information to the given element_name. More...
 
void setElementUnit (const std::string &element_name, const dd::BaseUnit &base_unit)
 Sets additional element base unit information to the given element_name. More...
 
DDElementRef getElement (const std::string &element_name)
 Gets a element reference to the element with name element_name owned by the DDStructure. More...
 

Private Attributes

QJSEngine & m_oEngine
 

Additional Inherited Members

- Public Types inherited from DDStructure
typedef dd::datamodel::StructType::Elements::const_iterator const_iterator
 iterator to iterate the elements of the struct
 

Detailed Description

A wrapper for adtf::mediadescription::structure.

Definition at line 32 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/javascriptfiltersdk/src/types.h.

Member Function Documentation

◆ add()

Q_INVOKABLE QObject* add ( const QString &  strElementName,
const QJSValue &  oElementType,
quint64  nArraySize = 1 
)

Adds an element to the structure definition.

Example Usage

var outputType = types.createDefinition("my_data")
.add("value1", "tUInt32")
.add("value2", "tFloat32")
var output = filter.createOutputPin("output", outputType)
var runner = filter.createRunner("generate_data")
var counter = 0
runner.trigger.connect(function(timestamp)
{
output.write(timestamp, {value1: counter, value2: counter})
++counter
})
Parameters
[in]strElementNameThe name of the element.
[in]oElementTypeEither the Type name (i.e. "tUInt32") or a cScriptStructure sub-structure definition.
[in]nArraySizeThe array size.
Returns
itself.