ADTF
Loading...
Searching...
No Matches
ddl::DDElementRef Class Reference

Utility class for a complete valid data definition of one StructType::Element and its dependencies. This class is for convenience to use it together with ddl::DDStructure . More...

#include <ddelement_ref.h>

Public Member Functions

 DDElementRef ()
 Construct a new DDElement object.
 
 DDElementRef (DDElementRef &&)
 Construct a new DDElement object.
 
 DDElementRef (const DDElementRef &)=delete
 Construct a new DDElement object.
 
DDElementRefoperator= (DDElementRef &&)
 assignment move operator
 
DDElementRefoperator= (const DDElementRef &)=delete
 assignment copy operator
 
 ~DDElementRef ()
 Destroy the DDElement object.
 
DDElementRefsetDescription (const std::string &description)
 Set the description to the element.
 
DDElementRefsetComment (const std::string &comment)
 Set additional element information to the given element_name.
 
DDElementRefsetMinMax (const std::string &minimum_value, const std::string &maximum_value)
 Set additional element information to the given element_name.
 
DDElementRefsetValue (const std::string &value)
 Set the constant value information to the element.
 
DDElementRefsetDefaultValue (const std::string &default_value)
 Set the default value information to the element.
 
DDElementRefsetScaleOffset (const std::string &scale, const std::string &offset)
 Set scale and offset information to the element.
 
DDElementRefsetValidElementCount (const std::string &valid_element_count)
 Sets the 'valid_element_count' attribute to the element.
 
DDElementRefsetUnit (const DDUnit &unit)
 Sets additional unit information to the element. Any other unit information will be overwritten.
 
DDElementRefsetUnit (const dd::BaseUnit &base_unit)
 Sets additional unit information to the element. Any other unit information will be overwritten.
 
const dd::StructType::ElementgetElement () const
 Get the Element object.
 
const dd::DataDefinitiongetDD () const
 retrieves a valid DataDefinition for the elements datatypes and units.
 

Friends

class DDStructure
 

Detailed Description

Utility class for a complete valid data definition of one StructType::Element and its dependencies. This class is for convenience to use it together with ddl::DDStructure .

See also
ddl::DDStructure.

Member Function Documentation

◆ getDD()

const dd::DataDefinition & ddl::DDElementRef::getDD ( ) const

retrieves a valid DataDefinition for the elements datatypes and units.

Returns
const dd::DataDefinition&

◆ getElement()

const dd::StructType::Element & ddl::DDElementRef::getElement ( ) const

Get the Element object.

Returns
const dd::StructType::Element&

◆ operator=() [1/2]

DDElementRef & ddl::DDElementRef::operator= ( const DDElementRef & )
delete

assignment copy operator

Returns
DDElement& reference

◆ operator=() [2/2]

DDElementRef & ddl::DDElementRef::operator= ( DDElementRef && )

assignment move operator

Returns
DDElement& reference

◆ setComment()

DDElementRef & ddl::DDElementRef::setComment ( const std::string & comment)

Set additional element information to the given element_name.

Parameters
commentThe comment
Returns
*this

◆ setDefaultValue()

DDElementRef & ddl::DDElementRef::setDefaultValue ( const std::string & default_value)

Set the default value information to the element.

Parameters
default_valueThe default value
Returns
*this

◆ setDescription()

DDElementRef & ddl::DDElementRef::setDescription ( const std::string & description)

Set the description to the element.

Parameters
descriptionThe description
Returns
*this

◆ setMinMax()

DDElementRef & ddl::DDElementRef::setMinMax ( const std::string & minimum_value,
const std::string & maximum_value )

Set additional element information to the given element_name.

Parameters
minimum_valueThe minimum value
maximum_valueThe maximum value
Returns
*this

◆ setScaleOffset()

DDElementRef & ddl::DDElementRef::setScaleOffset ( const std::string & scale,
const std::string & offset )

Set scale and offset information to the element.

Parameters
scaleThe scale
offsetThe offset
Returns
*this

◆ setUnit() [1/2]

DDElementRef & ddl::DDElementRef::setUnit ( const dd::BaseUnit & base_unit)

Sets additional unit information to the element. Any other unit information will be overwritten.

Parameters
base_unitThe unit to set
Returns
*this

◆ setUnit() [2/2]

DDElementRef & ddl::DDElementRef::setUnit ( const DDUnit & unit)

Sets additional unit information to the element. Any other unit information will be overwritten.

Parameters
unitThe unit to set
Returns
*this

◆ setValidElementCount()

DDElementRef & ddl::DDElementRef::setValidElementCount ( const std::string & valid_element_count)

Sets the 'valid_element_count' attribute to the element.

Parameters
valid_element_countThe valid_element_count name.
Remarks
The name within valid_element_count must be a sibling element within the same structure. You may use the 'valid_element_count' to mark a subset of the array as valid and the other part as invalid. Use this for a virtual dynamic array and take advantage of the performance of the static array support with dynamic content.
Returns
*this
Exceptions
dd::Errorif element invalidates (i.e. valid_element_count is not a valid sibling element name)

◆ setValue()

DDElementRef & ddl::DDElementRef::setValue ( const std::string & value)

Set the constant value information to the element.

Parameters
valueThe value
Returns
*this
Exceptions
dd::Errorif element invalidates (i.e. the constant value is not part of the type)

The documentation for this class was generated from the following file: