openDAQ
Open data acquisition platform
UnitBuilderPtr Class Reference

Builder component of Unit objects. Contains setter methods to configure the Unit parameters, and a build method that builds the Unit object. More...

Inherits ObjectPtr< IUnitBuilder >.

Detailed Description

Builder component of Unit objects. Contains setter methods to configure the Unit parameters, and a build method that builds the Unit object.

Public Member Functions

daq::UnitPtr build () const
 Builds and returns a Unit object using the currently set values of the Builder. More...
 
UnitBuilderPtr setId (daq::Int id) const
 Sets the unit ID as defined in Codes for Units of Measurement used in International Trade. More...
 
daq::Int getId () const
 Gets the unit ID as defined in Codes for Units of Measurement used in International Trade. More...
 
UnitBuilderPtr setSymbol (const daq::StringPtr &symbol) const
 Sets the symbol of the unit, i.e. "m/s". More...
 
daq::StringPtr getSymbol () const
 Gets the symbol of the unit, i.e. "m/s". More...
 
UnitBuilderPtr setName (const daq::StringPtr &name) const
 Sets the full name of the unit, i.e. "meters per second". More...
 
daq::StringPtr getName () const
 Gets the full name of the unit, i.e. "meters per second". More...
 
UnitBuilderPtr setQuantity (const daq::StringPtr &quantity) const
 Sets the quantity represented by the unit, i.e. "Velocity". More...
 
daq::StringPtr getQuantity () const
 Gets the quantity represented by the unit, i.e. "Velocity". More...
 

Member Function Documentation

◆ build()

daq::UnitPtr build ( ) const
inline

Builds and returns a Unit object using the currently set values of the Builder.

Returns
The built Unit.

◆ getId()

daq::Int getId ( ) const
inline

Gets the unit ID as defined in Codes for Units of Measurement used in International Trade.

Returns
The unit ID.

Returns -1 if the unit id is not available.

◆ getName()

daq::StringPtr getName ( ) const
inline

Gets the full name of the unit, i.e. "meters per second".

Returns
The unit's full name.

nullptr if not set.

◆ getQuantity()

daq::StringPtr getQuantity ( ) const
inline

Gets the quantity represented by the unit, i.e. "Velocity".

Returns
The unit's quantity.

nullptr if not set.

◆ getSymbol()

daq::StringPtr getSymbol ( ) const
inline

Gets the symbol of the unit, i.e. "m/s".

Returns
The unit's symbol.

◆ setId()

UnitBuilderPtr setId ( daq::Int  id) const
inline

Sets the unit ID as defined in Codes for Units of Measurement used in International Trade.

Parameters
idThe unit ID.

The ID should be -1 if the unit is not available.

◆ setName()

UnitBuilderPtr setName ( const daq::StringPtr &  name) const
inline

Sets the full name of the unit, i.e. "meters per second".

Parameters
nameThe unit's full name.

◆ setQuantity()

UnitBuilderPtr setQuantity ( const daq::StringPtr &  quantity) const
inline

Sets the quantity represented by the unit, i.e. "Velocity".

Parameters
quantityThe unit's quantity.

◆ setSymbol()

UnitBuilderPtr setSymbol ( const daq::StringPtr &  symbol) const
inline

Sets the symbol of the unit, i.e. "m/s".

Parameters
symbolThe unit's symbol.