Dev Essential
Loading...
Searching...
No Matches
ddl::dd::datamodel::Unit Class Reference

BaseUnit. More...

#include <datamodel_units.h>

Inherits ddl::dd::datamodel::UnitBase, ddl::dd::utility::ModelSubjectUtility< TYPE, ModelEventCode >, ddl::dd::utility::ModelSubjectUtility< T, TypeAccessMapEventCode >, and ddl::dd::datamodel::InfoMap.

Classes

class  RefUnit
 datamodel for the refUnit More...
 

Public Types

using RefUnits = std::vector<RefUnit>
 definiton of the container for the RefUnits
 
- Public Types inherited from ddl::dd::utility::ModelSubjectUtility< TYPE, ModelEventCode >
typedef ModelEventCode event_code_type
 local definition of the event code type
 
typedef TYPE subject_type
 local definition of the subject type
 
typedef ModelObserverUtility< TYPE, ModelEventCode > observer_type
 local definition of the observer type to notify
 
typedef ModelEventCode event_code_type
 local definition of the event code type
 
typedef TYPE subject_type
 local definition of the subject type
 
typedef ModelObserverUtility< TYPE, ModelEventCode > observer_type
 local definition of the observer type to notify
 
typedef ModelEventCode event_code_type
 local definition of the event code type
 
typedef TYPE subject_type
 local definition of the subject type
 
typedef ModelObserverUtility< TYPE, ModelEventCode > observer_type
 local definition of the observer type to notify
 
typedef ModelEventCode event_code_type
 local definition of the event code type
 
typedef TYPE subject_type
 local definition of the subject type
 
typedef ModelObserverUtility< TYPE, ModelEventCode > observer_type
 local definition of the observer type to notify
 
- Public Types inherited from ddl::dd::utility::ModelSubjectUtility< T, TypeAccessMapEventCode >
typedef TypeAccessMapEventCode event_code_type
 local definition of the event code type
 
typedef T subject_type
 local definition of the subject type
 
typedef ModelObserverUtility< T, TypeAccessMapEventCodeobserver_type
 local definition of the observer type to notify
 
typedef TypeAccessMapEventCode event_code_type
 local definition of the event code type
 
typedef T subject_type
 local definition of the subject type
 
typedef ModelObserverUtility< T, TypeAccessMapEventCodeobserver_type
 local definition of the observer type to notify
 
typedef TypeAccessMapEventCode event_code_type
 local definition of the event code type
 
typedef T subject_type
 local definition of the subject type
 
typedef ModelObserverUtility< T, TypeAccessMapEventCodeobserver_type
 local definition of the observer type to notify
 
typedef TypeAccessMapEventCode event_code_type
 local definition of the event code type
 
typedef T subject_type
 local definition of the subject type
 
typedef ModelObserverUtility< T, TypeAccessMapEventCodeobserver_type
 local definition of the observer type to notify
 

Public Member Functions

 Unit ()
 CTOR.
 
 Unit (const Unit &)=default
 copy CTOR
 
Unitoperator= (const Unit &)=default
 copy assignment operator
 
 Unit (Unit &&)=default
 move CTOR
 
Unitoperator= (Unit &&)=default
 move assignment operator
 
virtual ~Unit ()=default
 DTOR.
 
 Unit (std::string name, std::string numerator, std::string denominator, std::string offset, const std::vector< RefUnit > &ref_units={})
 CTOR.
 
bool operator== (const Unit &other) const
 equality operator.
 
bool operator!= (const Unit &other) const
 non equality operator.
 
TypeOfUnit getTypeOfUnit () const override
 Get the Type Of Unit.
 
void setName (const std::string &name) override
 Set the Name.
 
const std::string & getNumerator () const
 Get the Numerator.
 
void setNumerator (const std::string &numerator)
 Set the Numerator object.
 
const std::string & getDenominator () const
 Get the Denominator.
 
void setDenominator (const std::string &denominator)
 Set the Denominator.
 
const std::string & getOffset () const
 Get the Offset.
 
void setOffset (const std::string &offset)
 Set the Offset.
 
const RefUnitsgetRefUnits () const
 return the refUnits container
 
void addRefUnit (const RefUnit &ref_unit)
 adding a refunit
 
void removeRefUnit (const RefUnit &ref_unit)
 remove the refunit
 
- Public Member Functions inherited from ddl::dd::datamodel::UnitBase
 UnitBase ()=default
 default CTOR
 
 UnitBase (const UnitBase &)=default
 copy CTOR
 
 UnitBase (UnitBase &&)=default
 move CTOR
 
UnitBaseoperator= (const UnitBase &)=default
 copy assignment operator
 
UnitBaseoperator= (UnitBase &&)=default
 move assignment operator
 
 UnitBase (std::string name)
 CTOR.
 
virtual ~UnitBase ()=default
 DTOR.
 
const std::string & getName () const
 Get the Name.
 
- Public Member Functions inherited from ddl::dd::utility::ModelSubjectUtility< TYPE, ModelEventCode >
 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!
 
virtual ~ModelSubjectUtility ()=default
 DTOR.
 
void attachObserver (observer_type *observer)
 adda a observer to notify.
 
void detachObserver (observer_type *observer)
 remove a observer if in list.
 
 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!
 
virtual ~ModelSubjectUtility ()=default
 DTOR.
 
void attachObserver (observer_type *observer)
 adda a observer to notify.
 
void detachObserver (observer_type *observer)
 remove a observer if in list.
 
 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!
 
virtual ~ModelSubjectUtility ()=default
 DTOR.
 
void attachObserver (observer_type *observer)
 adda a observer to notify.
 
void detachObserver (observer_type *observer)
 remove a observer if in list.
 
 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!
 
virtual ~ModelSubjectUtility ()=default
 DTOR.
 
void attachObserver (observer_type *observer)
 adda a observer to notify.
 
void detachObserver (observer_type *observer)
 remove a observer if in list.
 
- Public Member Functions inherited from ddl::dd::utility::ModelSubjectUtility< T, TypeAccessMapEventCode >
 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!
 
virtual ~ModelSubjectUtility ()=default
 DTOR.
 
void attachObserver (observer_type *observer)
 adda a observer to notify.
 
void detachObserver (observer_type *observer)
 remove a observer if in list.
 
 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!
 
virtual ~ModelSubjectUtility ()=default
 DTOR.
 
void attachObserver (observer_type *observer)
 adda a observer to notify.
 
void detachObserver (observer_type *observer)
 remove a observer if in list.
 
 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!
 
virtual ~ModelSubjectUtility ()=default
 DTOR.
 
void attachObserver (observer_type *observer)
 adda a observer to notify.
 
void detachObserver (observer_type *observer)
 remove a observer if in list.
 
 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!
 
virtual ~ModelSubjectUtility ()=default
 DTOR.
 
void attachObserver (observer_type *observer)
 adda a observer to notify.
 
void detachObserver (observer_type *observer)
 remove a observer if in list.
 
- Public Member Functions inherited from ddl::dd::datamodel::InfoMap
 InfoMap ()=default
 CTOR.
 
 InfoMap (const InfoMap &)
 copy CTOR
 
 InfoMap (InfoMap &&)
 move CTOR
 
InfoMapoperator= (const InfoMap &)
 copy assignment operator
 
InfoMapoperator= (InfoMap &&)
 move assignment operator
 
template<typename INFO_T>
const INFO_T * getInfo () const
 Get the Info Pointer.
 
template<typename INFO_T>
INFO_T * getInfo ()
 Get the Info Pointer.
 
template<typename INFO_T>
void setInfo (const std::shared_ptr< INFO_T > &info)
 Set the Info object as shared pointer.
 

Additional Inherited Members

- Protected Member Functions inherited from ddl::dd::utility::ModelSubjectUtility< TYPE, ModelEventCode >
void notifyChanged (event_code_type event_code, subject_type &changed_subject, const std::string &additional_info)
 helper utility function to notify the current observers
 
void notifyChanged (event_code_type event_code, subject_type &changed_subject, const std::string &additional_info)
 helper utility function to notify the current observers
 
void notifyChanged (event_code_type event_code, subject_type &changed_subject, const std::string &additional_info)
 helper utility function to notify the current observers
 
void notifyChanged (event_code_type event_code, subject_type &changed_subject, const std::string &additional_info)
 helper utility function to notify the current observers
 
- Protected Member Functions inherited from ddl::dd::utility::ModelSubjectUtility< T, TypeAccessMapEventCode >
void notifyChanged (event_code_type event_code, subject_type &changed_subject, const std::string &additional_info)
 helper utility function to notify the current observers
 
void notifyChanged (event_code_type event_code, subject_type &changed_subject, const std::string &additional_info)
 helper utility function to notify the current observers
 
void notifyChanged (event_code_type event_code, subject_type &changed_subject, const std::string &additional_info)
 helper utility function to notify the current observers
 
void notifyChanged (event_code_type event_code, subject_type &changed_subject, const std::string &additional_info)
 helper utility function to notify the current observers
 
- Protected Attributes inherited from ddl::dd::datamodel::UnitBase
std::string _name
 the name
 

Detailed Description

Constructor & Destructor Documentation

◆ Unit()

ddl::dd::datamodel::Unit::Unit ( std::string name,
std::string numerator,
std::string denominator,
std::string offset,
const std::vector< RefUnit > & 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 ddl::dd::datamodel::Unit::addRefUnit ( const RefUnit & 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

◆ getDenominator()

const std::string & ddl::dd::datamodel::Unit::getDenominator ( ) const

Get the Denominator.

Returns
const std::string&

◆ getNumerator()

const std::string & ddl::dd::datamodel::Unit::getNumerator ( ) const

Get the Numerator.

Returns
const std::string&

◆ getOffset()

const std::string & ddl::dd::datamodel::Unit::getOffset ( ) const

Get the Offset.

Returns
const std::string&

◆ getRefUnits()

const RefUnits & ddl::dd::datamodel::Unit::getRefUnits ( ) const

return the refUnits container

Returns
const RefUnits&

◆ getTypeOfUnit()

TypeOfUnit ddl::dd::datamodel::Unit::getTypeOfUnit ( ) const
overridevirtual

Get the Type Of Unit.

Returns
TypeOfUnit

Implements ddl::dd::datamodel::UnitBase.

◆ operator!=()

bool ddl::dd::datamodel::Unit::operator!= ( const Unit & other) const

non equality operator.

Parameters
otherthe other unit to compare this unit to.
Returns
false the unit are equal (and all its refunits)
true the unit are not equal.

◆ operator=() [1/2]

Unit & ddl::dd::datamodel::Unit::operator= ( const Unit & )
default

copy assignment operator

Returns
Unit&

◆ operator=() [2/2]

Unit & ddl::dd::datamodel::Unit::operator= ( Unit && )
default

move assignment operator

Returns
Unit&

◆ operator==()

bool ddl::dd::datamodel::Unit::operator== ( const Unit & other) const

equality operator.

Parameters
otherthe other unit to compare this unit to.
Returns
true the unit are equal (and all its refunits)
false the unit are not equal.

◆ removeRefUnit()

void ddl::dd::datamodel::Unit::removeRefUnit ( const RefUnit & ref_unit)

remove the refunit

Parameters
ref_unitthe refunit to remove

◆ setDenominator()

void ddl::dd::datamodel::Unit::setDenominator ( const std::string & denominator)

Set the Denominator.

Parameters
denominatorthe denominator to set
Remarks
This will notify the change.

◆ setName()

void ddl::dd::datamodel::Unit::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 is part of it will throw.

Reimplemented from ddl::dd::datamodel::UnitBase.

◆ setNumerator()

void ddl::dd::datamodel::Unit::setNumerator ( const std::string & numerator)

Set the Numerator object.

Parameters
numeratorthe numerator to set
Remarks
This will notify the change.

◆ setOffset()

void ddl::dd::datamodel::Unit::setOffset ( const std::string & offset)

Set the Offset.

Parameters
offsetthe offset to set
Remarks
This will notify the change.

The documentation for this class was generated from the following file: