15 #ifndef DD_DATA_MODEL_UNITS_H_INCLUDED
16 #define DD_DATA_MODEL_UNITS_H_INCLUDED
88 virtual void setName(
const std::string& name);
145 const std::string& symbol,
146 const std::string& description = {});
162 void setName(
const std::string& name)
override;
210 void notify(
const std::string& additional_info);
211 std::string _symbol = {};
212 std::string _description = {};
257 UnitPrefix(
const std::string& name,
const std::string& symbol, int32_t power);
325 void notify(
const std::string& additional_info);
326 std::string _name = {};
327 std::string _symbol = {};
413 RefUnit(
const std::string& unit_name, int32_t power,
const std::string& prefix_name);
451 std::string _unit_name = {};
453 std::string _prefix_name = {};
466 const std::string& numerator,
467 const std::string& denominator,
468 const std::string& offset,
469 const std::vector<RefUnit>& ref_units = {});
501 void setName(
const std::string& name)
override;
574 const std::string& additional_info);
577 std::string _numerator = {};
578 std::string _denominator = {};
579 std::string _offset = {};
DataDefinition Utility class for observable items.
DataDefinition Utility class for observable items.
DataDefinition Model-Observer pattern utility.
BaseUnit(const BaseUnit &)=default
copy CTOR
const std::string & getDescription() const
Get the Description.
BaseUnit(const std::string &name, const std::string &symbol, const std::string &description={})
CTOR.
bool operator==(const BaseUnit &other) const
equality operator.
virtual ~BaseUnit()=default
DTOR.
void setDescription(const std::string &description)
Set the Description.
TypeOfUnit getTypeOfUnit() const override
Get the Type Of Unit.
const std::string & getSymbol() const
Get the Symbol.
BaseUnit & operator=(const BaseUnit &)=default
copy assignment operator
bool operator!=(const BaseUnit &other) const
non equality operator.
void setName(const std::string &name) override
Set the Name.
BaseUnit(BaseUnit &&)=default
move CTOR
BaseUnit & operator=(BaseUnit &&)=default
move assignment operator
void setSymbol(const std::string &symbol)
Set the Symbol.
Info Map for the datamodel to hold a set of optional IInfo instances.
datamodel for the refUnit
bool operator!=(const RefUnit &other) const
non equality operator.
RefUnit(const std::string &unit_name, int32_t power, const std::string &prefix_name)
CTOR.
const std::string & getPrefixName() const
Get the Prefix Name.
bool operator==(const RefUnit &other) const
equality operator.
int32_t getPower() const
Get the Power.
RefUnit(RefUnit &&)=default
move CTOR
RefUnit & operator=(RefUnit &&)=default
move assignment operator
const std::string & getUnitName() const
Get the Unit Name.
RefUnit & operator=(const RefUnit &)=default
copy assignment operator
RefUnit(const RefUnit &)=default
copy CTOR
UnitBase is the base class for Unit or BaseUnit.
UnitBase(const std::string &name)
CTOR.
virtual void setName(const std::string &name)
Set the Name.
UnitBase(UnitBase &&)=default
move CTOR
virtual ~UnitBase()=default
DTOR.
UnitBase & operator=(const UnitBase &)=default
copy assignment operator
const std::string & getName() const
Get the Name.
UnitBase & operator=(UnitBase &&)=default
move assignment operator
std::string _name
the name
virtual TypeOfUnit getTypeOfUnit() const =0
Get the Type Of Unit.
UnitBase(const UnitBase &)=default
copy CTOR
UnitBase()=default
default CTOR
const RefUnits & getRefUnits() const
return the refUnits container
void setDenominator(const std::string &denominator)
Set the Denominator.
std::vector< RefUnit > RefUnits
definiton of the container for the RefUnits
TypeOfUnit getTypeOfUnit() const override
Get the Type Of Unit.
void addRefUnit(const RefUnit &ref_unit)
adding a refunit
Unit & operator=(Unit &&)=default
move assignment operator
const std::string & getNumerator() const
Get the Numerator.
void setNumerator(const std::string &numerator)
Set the Numerator object.
bool operator==(const Unit &other) const
equality operator.
bool operator!=(const Unit &other) const
non equality operator.
const std::string & getDenominator() const
Get the Denominator.
void setName(const std::string &name) override
Set the Name.
virtual ~Unit()=default
DTOR.
Unit(Unit &&)=default
move CTOR
Unit(const std::string &name, const std::string &numerator, const std::string &denominator, const std::string &offset, const std::vector< RefUnit > &ref_units={})
CTOR.
const std::string & getOffset() const
Get the Offset.
Unit & operator=(const Unit &)=default
copy assignment operator
void setOffset(const std::string &offset)
Set the Offset.
void removeRefUnit(const RefUnit &ref_unit)
remove the refunit
Unit(const Unit &)=default
copy CTOR
Unit Prefix - datamodel pefixes.
bool operator!=(const UnitPrefix &other) const
non equality operator.
UnitPrefix(UnitPrefix &&)=default
move CTOR
bool operator==(const UnitPrefix &other) const
equality operator.
const std::string & getSymbol() const
Get the Symbol.
virtual ~UnitPrefix()=default
DTOR.
UnitPrefix(const std::string &name, const std::string &symbol, int32_t power)
CTOR.
void setPower(int32_t power)
Set the Power.
const std::string & getName() const
Get the Name.
int32_t getPower() const
Get the Power.
void setName(const std::string &name)
Set the Name.
UnitPrefix & operator=(const UnitPrefix &)=default
copy assignment operator
UnitPrefix(const UnitPrefix &)=default
copy CTOR
UnitPrefix & operator=(UnitPrefix &&)=default
move assignment operator
void setSymbol(const std::string &symbol)
Set the Symbol.
Model Subject utility to define a Model Subject that notifies one or more observers.
OO DataDefinition Redesign - Data model Observer - Subject pattern.
OO DataDefinition Common Design.
OO DataDefinition Redesign - Data model info extension.
ModelEventCode
Model event code for the data model observer.
TypeAccessMapEventCode
Internal event code to inform the parent DD Object about the change of an item within the list.
TypeOfUnit
Classification of unit.
definition of the ddl namespace