ADTF  3.18.2
BaseUnit

BaseUnit. More...

Inheritance diagram for BaseUnit:
[legend]

Public Member Functions

 BaseUnit ()
 CTOR.
 
 BaseUnit (const BaseUnit &)=default
 copy CTOR
 
 BaseUnit (BaseUnit &&)=default
 move CTOR
 
BaseUnitoperator= (const BaseUnit &)=default
 copy assignment operator More...
 
BaseUnitoperator= (BaseUnit &&)=default
 move assignment operator More...
 
 BaseUnit (const std::string &name, const std::string &symbol, const std::string &description={})
 CTOR. More...
 
virtual ~BaseUnit ()=default
 DTOR.
 
TypeOfUnit getTypeOfUnit () const override
 Get the Type Of Unit. More...
 
void setName (const std::string &name) override
 Set the Name. More...
 
const std::string & getSymbol () const
 Get the Symbol. More...
 
void setSymbol (const std::string &symbol)
 Set the Symbol. More...
 
const std::string & getDescription () const
 Get the Description. More...
 
void setDescription (const std::string &description)
 Set the Description. More...
 
bool operator== (const BaseUnit &other) const
 equality operator. More...
 
bool operator!= (const BaseUnit &other) const
 non equality operator. More...
 
- Public Member Functions inherited from UnitBase
 UnitBase ()=default
 default CTOR
 
 UnitBase (const UnitBase &)=default
 copy CTOR
 
 UnitBase (UnitBase &&)=default
 move CTOR
 
UnitBaseoperator= (const UnitBase &)=default
 copy assignment operator More...
 
UnitBaseoperator= (UnitBase &&)=default
 move assignment operator More...
 
 UnitBase (const std::string &name)
 CTOR. More...
 
virtual ~UnitBase ()=default
 DTOR.
 
const std::string & getName () const
 Get the Name. More...
 
- Public Member Functions inherited from ModelSubjectUtility< MODEL_SUBJECT_T, EVENT_CODE_T >
 ModelSubjectUtility ()=default
 CTOR.
 
 ModelSubjectUtility (const ModelSubjectUtility &)
 copy CTOR which removes the observers in case of!
 
ModelSubjectUtilityoperator= (const ModelSubjectUtility &)
 copy assignment operator which removes the observers in case of! More...
 
virtual ~ModelSubjectUtility ()=default
 DTOR.
 
void attachObserver (observer_type *observer)
 adda a observer to notify. More...
 
void detachObserver (observer_type *observer)
 remove a observer if in list. More...
 
- Public Member Functions inherited from InfoMap
 InfoMap ()=default
 CTOR.
 
 InfoMap (const InfoMap &)
 copy CTOR More...
 
 InfoMap (InfoMap &&)
 move CTOR More...
 
InfoMapoperator= (const InfoMap &)
 copy assignment operator More...
 
InfoMapoperator= (InfoMap &&)
 move assignment operator More...
 
template<typename INFO_T >
const INFO_T * getInfo () const
 Get the Info Pointer. More...
 
template<typename INFO_T >
INFO_T * getInfo ()
 Get the Info Pointer. More...
 
template<typename INFO_T >
void setInfo (const std::shared_ptr< INFO_T > &info)
 Set the Info object as shared pointer. More...
 

Private Member Functions

void notify (const std::string &additional_info)
 

Private Attributes

std::string _symbol = {}
 
std::string _description = {}
 

Additional Inherited Members

- Public Types inherited from ModelSubjectUtility< MODEL_SUBJECT_T, EVENT_CODE_T >
typedef EVENT_CODE_T event_code_type
 local definition of the event code type
 
typedef MODEL_SUBJECT_T subject_type
 local definition of the subject type
 
typedef ModelObserverUtility< MODEL_SUBJECT_T, EVENT_CODE_T > observer_type
 local definition of the observer type to notify
 
- Protected Member Functions inherited from ModelSubjectUtility< MODEL_SUBJECT_T, EVENT_CODE_T >
void notifyChanged (event_code_type event_code, subject_type &changed_subject, const std::string &additional_info)
 helper utility function to notify the current observers More...
 
- Protected Attributes inherited from UnitBase
std::string _name
 the name
 

Detailed Description

BaseUnit.

Definition at line 105 of file datamodel_units.h.

Constructor & Destructor Documentation

◆ BaseUnit()

BaseUnit ( const std::string &  name,
const std::string &  symbol,
const std::string &  description = {} 
)

CTOR.

Parameters
namename of the base unit
symbolsymbol of the baseunit
descriptiondescription of the baseunit

Member Function Documentation

◆ getDescription()

const std::string& getDescription ( ) const

Get the Description.

Returns
const std::string&

◆ getSymbol()

const std::string& getSymbol ( ) const

Get the Symbol.

Returns
const std::string&

◆ getTypeOfUnit()

TypeOfUnit getTypeOfUnit ( ) const
overridevirtual

Get the Type Of Unit.

Returns
TypeOfUnit

Implements UnitBase.

◆ operator!=()

bool operator!= ( const BaseUnit other) const

non equality operator.

Parameters
otherthe other baseunit to compare this baseunit to.
Returns
false the baseunit are equal.
true the baseunit are not equal.

◆ operator=() [1/2]

BaseUnit& operator= ( BaseUnit &&  )
default

move assignment operator

Returns
BaseUnit&

◆ operator=() [2/2]

BaseUnit& operator= ( const BaseUnit )
default

copy assignment operator

Returns
BaseUnit&

◆ operator==()

bool operator== ( const BaseUnit other) const

equality operator.

Parameters
otherthe other baseunit to compare this baseunit to.
Returns
true the baseunit are equal.
false the baseunit are not equal.

◆ setDescription()

void setDescription ( const std::string &  description)

Set the Description.

Parameters
descriptionthe description to set
Remarks
This will notify the change.

◆ setName()

void setName ( const std::string &  name)
overridevirtual

Set the Name.

Parameters
namethe name to set
Remarks
This will notify the change.
Exceptions
dd::ErrorIf the name already exists in the container this unit prefix is part of it will throw.

Reimplemented from UnitBase.

◆ setSymbol()

void setSymbol ( const std::string &  symbol)

Set the Symbol.

Parameters
symbolthe symbol to set
Remarks
This will notify the change.