ADTF  3.18.2
cDDLUnit

Representation object of a unit. More...

Inheritance diagram for cDDLUnit:
[legend]

Public Member Functions

 cDDLUnit ()
 Default CTOR.
 
 cDDLUnit (const A_UTILS_NS::cString &strName, const A_UTILS_NS::cString &strNumerator, const A_UTILS_NS::cString &strDenominator, double const fOffset, tDDLRefUnitVec vecDDLRefUnits=tDDLRefUnitVec(), int const nCreationLevel=1)
 CTOR. More...
 
 cDDLUnit (cDDLUnit &oUnit)
 Copy CTOR. More...
 
virtual ~cDDLUnit ()
 DTOR.
 
tResult Accept (IDDLVisitor *poVisitor)
 Acceptance method for Visitor design-pattern. More...
 
bool IsInitialized () const
 Getter for the initialization flag. More...
 
bool IsPredefined () const
 Getter for the predefinition flag. More...
 
bool IsOverwriteable () const
 Getter for the predefinition flag. More...
 
int GetCreationLevel () const
 Getter for the creation level. More...
 
tResult Create (const A_UTILS_NS::cString &strName, const A_UTILS_NS::cString &strNumerator, const A_UTILS_NS::cString &strDenominator, double const fOffset, tDDLRefUnitVec vecDDLRefUnits=tDDLRefUnitVec(), int const nCreationLevel=4)
 Creation method to fill the object with data. More...
 
const A_UTILS_NS::cStringGetName () const
 Getter for the name. More...
 
void SetName (const A_UTILS_NS::cString &strName)
 Setter for the Name.
 
A_UTILS_NS::cString GetNumerator () const
 Getter for the numerator. More...
 
void SetNumerator (const A_UTILS_NS::cString &strNumerator)
 Setter for the Denominator.
 
A_UTILS_NS::cString GetDenominator () const
 Getter for the denominator. More...
 
void SetDenominator (const A_UTILS_NS::cString &strDenominator)
 Setter for the Denominator.
 
double GetOffset () const
 Getter for the offset. More...
 
void SetOffset (double const fOffset)
 Setter for the offset.
 
tDDLRefUnitVecGetRefUnits ()
 Getter for the reference unit. More...
 
const tDDLRefUnitVecGetRefUnits () const
 Getter for the reference unit. More...
 
void AddRefUnit (cDDLRefUnit *poRefUnit, int nPos=-1)
 Adder for a reference unit. More...
 
tResult RemoveRefUnit (const A_UTILS_NS::cString &strRefUnit)
 Remover for a reference unit. More...
 
void CloneRefUnits (tDDLRefUnitVec vecDDLRefUnits)
 Setter for the reference units. More...
 
void RefRefUnits (tDDLRefUnitVec vecDDLRefUnits)
 Setter for the reference units. More...
 
- Public Member Functions inherited from IDDLUnit
virtual ~IDDLUnit ()
 Virtual DTOR.
 
- Public Member Functions inherited from IDDL
virtual ~IDDL ()
 Virtual DTOR.
 

Private Attributes

A_UTILS_NS::cString m_strName
 
A_UTILS_NS::cString m_strNumerator
 
A_UTILS_NS::cString m_strDenominator
 
double m_fOffset
 
tDDLRefUnitVec m_vecDDLRefUnits
 
bool m_bInitFlag
 
int m_nLevel
 

Additional Inherited Members

- Public Types inherited from IDDL
enum  tag_MergeFlags { DDLMERGE_ForceOverwrite = 0x01 }
 Flags for Merging.
 

Detailed Description

Representation object of a unit.

Definition at line 27 of file ddlunit.h.

Constructor & Destructor Documentation

◆ cDDLUnit() [1/2]

cDDLUnit ( const A_UTILS_NS::cString strName,
const A_UTILS_NS::cString strNumerator,
const A_UTILS_NS::cString strDenominator,
double const  fOffset,
tDDLRefUnitVec  vecDDLRefUnits = tDDLRefUnitVec(),
int const  nCreationLevel = 1 
)

CTOR.

Parameters
[in]strName- Name of the new unit
[in]strNumerator- Numerator of the new unit
[in]strDenominator- Denominator of the new unit
[in]fOffset- Offset to the base units
[in]vecDDLRefUnits- Vector of reference units (optional)
[in]nCreationLevel- Level at creation time (optional)

◆ cDDLUnit() [2/2]

cDDLUnit ( cDDLUnit oUnit)

Copy CTOR.

Parameters
[in]oUnit- Reference to unit object to copy

Member Function Documentation

◆ Accept()

tResult Accept ( IDDLVisitor poVisitor)
virtual

Acceptance method for Visitor design-pattern.

Parameters
[in]poVisitor- Pointer to Visitor instance
Return values
ERR_POINTERNull-pointer committed
ERR_NOT_FOUNDRequired node not found.
ERR_NOT_INITIALIZEDThe object was not or not correctly initialized

Implements IDDL.

◆ AddRefUnit()

void AddRefUnit ( cDDLRefUnit poRefUnit,
int  nPos = -1 
)

Adder for a reference unit.

Parameters
[in]poRefUnit- Pointer to the reference unit to add
[in]nPos- Position to add the reference unit
Returns
void

◆ CloneRefUnits()

void CloneRefUnits ( tDDLRefUnitVec  vecDDLRefUnits)

Setter for the reference units.

Parameters
[in]vecDDLRefUnits- Vector of reference units
Returns
void

◆ Create()

tResult Create ( const A_UTILS_NS::cString strName,
const A_UTILS_NS::cString strNumerator,
const A_UTILS_NS::cString strDenominator,
double const  fOffset,
tDDLRefUnitVec  vecDDLRefUnits = tDDLRefUnitVec(),
int const  nCreationLevel = 4 
)

Creation method to fill the object with data.

Parameters
[in]strName- Name of the new unit
[in]strNumerator- Numerator of the new unit
[in]strDenominator- Denominator of the new unit
[in]fOffset- Offset to the base units
[in]vecDDLRefUnits- Vector of reference units (optional)
[in]nCreationLevel- Level at creation time (optional)
Return values
ERR_INVALID_ARGEmpty name committed

◆ GetCreationLevel()

int GetCreationLevel ( ) const
virtual

Getter for the creation level.

Returns
the level at creation time of this representation object

Implements IDDL.

◆ GetDenominator()

A_UTILS_NS::cString GetDenominator ( ) const

Getter for the denominator.

Returns
the denominator

◆ GetName()

const A_UTILS_NS::cString& GetName ( ) const
virtual

Getter for the name.

Returns
the name

Implements IDDL.

◆ GetNumerator()

A_UTILS_NS::cString GetNumerator ( ) const

Getter for the numerator.

Returns
the numerator

◆ GetOffset()

double GetOffset ( ) const

Getter for the offset.

Returns
the offset

◆ GetRefUnits() [1/2]

tDDLRefUnitVec& GetRefUnits ( )

Getter for the reference unit.

Returns
the reference unit

◆ GetRefUnits() [2/2]

const tDDLRefUnitVec& GetRefUnits ( ) const

Getter for the reference unit.

Returns
the reference unit

◆ IsInitialized()

bool IsInitialized ( ) const
virtual

Getter for the initialization flag.

Return values
trueThe object was initialized correctly
falseThe object was not or not correctly initialized

Implements IDDL.

◆ IsOverwriteable()

bool IsOverwriteable ( ) const
virtual

Getter for the predefinition flag.

Return values
trueThe object was predefined
falseThe object was defined later

Implements IDDL.

◆ IsPredefined()

bool IsPredefined ( ) const
virtual

Getter for the predefinition flag.

Return values
trueThe object was predefined
falseThe object was defined later

Implements IDDL.

◆ RefRefUnits()

void RefRefUnits ( tDDLRefUnitVec  vecDDLRefUnits)

Setter for the reference units.

Parameters
[in]vecDDLRefUnits- Vector of reference units
Returns
void

◆ RemoveRefUnit()

tResult RemoveRefUnit ( const A_UTILS_NS::cString strRefUnit)

Remover for a reference unit.

Parameters
[in]strRefUnit- name of the reference unit to remove
Return values
ERR_NOT_FOUNDSpecified reference unit not found.