ADTF  3.18.2
cDDLRefUnit

Decorator class for IDDLUnit objects to be used inside other cDDLUnit objects. More...

Inheritance diagram for cDDLRefUnit:
[legend]

Public Member Functions

 cDDLRefUnit ()
 Default CTOR.
 
 cDDLRefUnit (IDDLUnit *poUnit, int const nPower, cDDLPrefix *poPrefix)
 CTOR with unit object. More...
 
 cDDLRefUnit (cDDLRefUnit &oRefUnit)
 CTOR with unit object. More...
 
virtual ~cDDLRefUnit ()
 DTOR.
 
tResult Accept (IDDLVisitor *poVisitor)
 Acceptance method for Visitor design-pattern. More...
 
bool IsInitialized () const
 Getter for the initialization flag. More...
 
tResult Create (IDDLUnit *poUnit, int const nPower, cDDLPrefix *poPrefix)
 Creation method to fill the object with data. More...
 
const A_UTILS_NS::cStringGetName () const
 Getter for the name. More...
 
IDDLUnitGetUnitObject () const
 Getter for the unit object. More...
 
void SetUnitObject (IDDLUnit *const pUnit)
 Setter for the unit object. More...
 
int GetPower () const
 Getter for the power. More...
 
void SetPower (int const nPower)
 Setter for the power. More...
 
A_UTILS_NS::cString GetPrefix () const
 Getter for the prefix name. More...
 
cDDLPrefixGetPrefixObject () const
 Getter for the prefix object. More...
 
void SetPrefixObject (cDDLPrefix *const pPrefix)
 Setter for the prefix object. More...
 
- Public Member Functions inherited from cDDL
virtual ~cDDL ()
 DTOR.
 
virtual bool IsPredefined () const
 Getter for the predefinition flag. More...
 
virtual bool IsOverwriteable () const
 Getter for the predefinition flag. More...
 
virtual int GetCreationLevel () const
 Getter for the creation level. More...
 
- Public Member Functions inherited from IDDL
virtual ~IDDL ()
 Virtual DTOR.
 

Private Attributes

IDDLUnitm_poUnit
 
int m_nPower
 
cDDLPrefixm_poPrefix
 
bool m_bInitFlag
 

Additional Inherited Members

- Public Types inherited from IDDL
enum  tag_MergeFlags { DDLMERGE_ForceOverwrite = 0x01 }
 Flags for Merging.
 
- Static Public Member Functions inherited from cDDL
template<typename T >
static T * DeleteChild (T *pvObj)
 Functor for use with std::transform() to delete all objects where the elements of a vector point at. More...
 
template<typename T >
static tResult MoveChild (T *pvObj, const int nFrom, const int nTo)
 Method moves element within the list. More...
 
template<typename T >
static T * Clone (T *pvObj)
 Functor for use with std::transform() to clone the objects where the elements of a vector point at. More...
 
template<typename T >
static T * Ref (T *pvObj)
 Functor for use with std::transform() to ref the objects where the elements of a vector point at, this is for the Always_there. More...
 
static bool IsEqual (IDDL *poLHS, IDDL *poRHS)
 Predicate to compare 2 DDL representation objects (for use with std::unique()). More...
 
static bool IsSorted (IDDL *poLHS, IDDL *poRHS)
 Sort predicate to compare to 2 DDL representation objects (for use with std::sort()). More...
 

Detailed Description

Decorator class for IDDLUnit objects to be used inside other cDDLUnit objects.

Definition at line 17 of file ddlrefunit.h.

Constructor & Destructor Documentation

◆ cDDLRefUnit() [1/2]

cDDLRefUnit ( IDDLUnit poUnit,
int const  nPower,
cDDLPrefix poPrefix 
)

CTOR with unit object.

Parameters
[in]poUnit- Pointer to the unit object
[in]nPower- Power of the new unit related to the base units
[in]poPrefix- Pointer to the prefix object

◆ cDDLRefUnit() [2/2]

cDDLRefUnit ( cDDLRefUnit oRefUnit)

CTOR with unit object.

Parameters
[in]oRefUnit- Pointer to the unit object

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.

◆ Create()

tResult Create ( IDDLUnit poUnit,
int const  nPower,
cDDLPrefix poPrefix 
)

Creation method to fill the object with data.

Parameters
[in]poUnit- Pointer to the unit object
[in]nPower- Power of the new unit related to the base units
[in]poPrefix- Pointer to the prefix object
Return values
ERR_POINTERNull-pointer committed

◆ GetName()

const A_UTILS_NS::cString& GetName ( ) const
virtual

Getter for the name.

Returns
the name

Implements IDDL.

◆ GetPower()

int GetPower ( ) const

Getter for the power.

Returns
the power

◆ GetPrefix()

A_UTILS_NS::cString GetPrefix ( ) const

Getter for the prefix name.

Returns
the prefix name

◆ GetPrefixObject()

cDDLPrefix* GetPrefixObject ( ) const

Getter for the prefix object.

Returns
pointer to the prefix object

◆ GetUnitObject()

IDDLUnit* GetUnitObject ( ) const

Getter for the unit object.

Returns
pointer to the unit object

◆ 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

Reimplemented from cDDL.

◆ SetPower()

void SetPower ( int const  nPower)

Setter for the power.

Parameters
nPowerthe power
Returns
void

◆ SetPrefixObject()

void SetPrefixObject ( cDDLPrefix *const  pPrefix)

Setter for the prefix object.

Parameters
pPrefixpointer to the prefix object
Returns
void

◆ SetUnitObject()

void SetUnitObject ( IDDLUnit *const  pUnit)

Setter for the unit object.

Parameters
pUnitthe unit object to set
Returns
void