ADTF  3.18.2
DDUnit

The unit class holding a reference to its complete DD (references to baseunits and prefixes) More...

Public Member Functions

 DDUnit ()=delete
 no default CTOR
 
 DDUnit (const DDUnit &)
 copy CTOR
 
 DDUnit (DDUnit &&)
 move CTOR
 
DDUnitoperator= (const DDUnit &)
 copy assignment operator More...
 
DDUnitoperator= (DDUnit &&)
 move assignment operator More...
 
 DDUnit (const std::string &name, const std::string &numerator, const std::string &denominator, const std::string &offset, const std::vector< DDRefUnit > &ref_units={})
 CTOR. More...
 
void addRefUnit (const DDRefUnit &ref_unit)
 adding a refunit More...
 
const dd::UnitgetUnit () const
 Get the Unit object. More...
 
const dd::DataDefinitiongetDD () const
 Get the data definiton. More...
 

Private Attributes

std::shared_ptr< dd::Unit_unit
 
dd::DataDefinition _dd
 

Detailed Description

The unit class holding a reference to its complete DD (references to baseunits and prefixes)

Definition at line 92 of file ddunit.h.

Constructor & Destructor Documentation

◆ DDUnit()

DDUnit ( const std::string &  name,
const std::string &  numerator,
const std::string &  denominator,
const std::string &  offset,
const std::vector< DDRefUnit > &  ref_units = {} 
)

CTOR.

Parameters
namethe name of the unit
numeratorthe numerator for the unit
denominatorthe denominator for the unit
offsetthe offset for the unit
ref_unitsvector of refunits
Exceptions
dd::Errorthis will throw if this list contains a base_unit/prefix pair twice

Member Function Documentation

◆ addRefUnit()

void addRefUnit ( const DDRefUnit ref_unit)

adding a refunit

Parameters
ref_unitthe refunit to add
Exceptions
dd::Errorthis will throw if this refUnits already contains a base_unit/prefix pair

◆ getDD()

const dd::DataDefinition& getDD ( ) const

Get the data definiton.

Returns
const dd::DataDefinition&

◆ getUnit()

const dd::Unit& getUnit ( ) const

Get the Unit object.

Returns
const dd::Unit&

◆ operator=() [1/2]

DDUnit& operator= ( const DDUnit )

copy assignment operator

Returns
DDUnit&

◆ operator=() [2/2]

DDUnit& operator= ( DDUnit &&  )

move assignment operator

Returns
DDUnit&