ADTF
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cDDLUnit

Representation object of a unit. More...

#include <ddlunit.h>

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.
 
 cDDLUnit (cDDLUnit &oUnit)
 Copy CTOR.
 
virtual ~cDDLUnit ()
 DTOR.
 
tResult Accept (IDDLVisitor *poVisitor)
 Acceptance method for Visitor design-pattern.
 
bool IsInitialized () const
 Getter for the initialization flag.
 
bool IsPredefined () const
 Getter for the predefinition flag.
 
bool IsOverwriteable () const
 Getter for the predefinition flag.
 
int GetCreationLevel () const
 Getter for the creation level.
 
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.
 
const A_UTILS_NS::cStringGetName () const
 Getter for the name.
 
void SetName (const A_UTILS_NS::cString &strName)
 Setter for the Name.
 
A_UTILS_NS::cString GetNumerator () const
 Getter for the numerator.
 
void SetNumerator (const A_UTILS_NS::cString &strNumerator)
 Setter for the Denominator.
 
A_UTILS_NS::cString GetDenominator () const
 Getter for the denominator.
 
void SetDenominator (const A_UTILS_NS::cString &strDenominator)
 Setter for the Denominator.
 
double GetOffset () const
 Getter for the offset.
 
void SetOffset (double const fOffset)
 Setter for the offset.
 
tDDLRefUnitVecGetRefUnits ()
 Getter for the reference unit.
 
const tDDLRefUnitVecGetRefUnits () const
 Getter for the reference unit.
 
void AddRefUnit (cDDLRefUnit *poRefUnit, int nPos=-1)
 Adder for a reference unit.
 
tResult RemoveRefUnit (const A_UTILS_NS::cString &strRefUnit)
 Remover for a reference unit.
 
void CloneRefUnits (tDDLRefUnitVec vecDDLRefUnits)
 Setter for the reference units.
 
void RefRefUnits (tDDLRefUnitVec vecDDLRefUnits)
 Setter for the reference units.
 
- 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. More...
 

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

References cDDLUnit().

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.

Member Data Documentation

◆ m_bInitFlag

bool m_bInitFlag
private

Definition at line 184 of file ddlunit.h.

◆ m_fOffset

double m_fOffset
private

Definition at line 181 of file ddlunit.h.

◆ m_nLevel

int m_nLevel
private

Definition at line 185 of file ddlunit.h.

◆ m_strDenominator

A_UTILS_NS::cString m_strDenominator
private

Definition at line 180 of file ddlunit.h.

◆ m_strName

A_UTILS_NS::cString m_strName
private

Definition at line 178 of file ddlunit.h.

◆ m_strNumerator

A_UTILS_NS::cString m_strNumerator
private

Definition at line 179 of file ddlunit.h.

◆ m_vecDDLRefUnits

tDDLRefUnitVec m_vecDDLRefUnits
private

Definition at line 182 of file ddlunit.h.