ADTF
DDElementRef

Utility class for a complete valid data definition of one StructType::Element and its dependencies. More...

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

Private Member Functions

 DDElementRef (dd::DataDefinition &dd_ref, std::shared_ptr< dd::StructType::Element > element)
 

Private Attributes

dd::DataDefinition_dd_ref
 
std::shared_ptr< dd::StructType::Element_element
 

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.

Definition at line 35 of file ddelement_ref.h.

Member Function Documentation

◆ getDD()

const dd::DataDefinition& getDD ( ) const

retrieves a valid DataDefinition for the elements datatypes and units.

Returns
const dd::DataDefinition&

◆ getElement()

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

Get the Element object.

Returns
const dd::StructType::Element&

◆ operator=() [1/2]

DDElementRef& operator= ( const DDElementRef )
delete

assignment copy operator

Returns
DDElement& reference

◆ operator=() [2/2]

DDElementRef& operator= ( DDElementRef &&  )

assignment move operator

Returns
DDElement& reference

◆ setComment()

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

Set additional element information to the given element_name.

Parameters
commentThe comment
Returns
*this

◆ setDefaultValue()

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

Set the default value information to the element.

Parameters
default_valueThe default value
Returns
*this

◆ setDescription()

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

Set the description to the element.

Parameters
descriptionThe description
Returns
*this

◆ setMinMax()

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& 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& 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& 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& 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& 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)