API Documentation
Loading...
Searching...
No Matches
UnitManager Class Reference

Handles a grouping of units that can describe any number of data categories. More...

#include <UnitManager.h>

Inheritance diagram for UnitManager:
[legend]
Collaboration diagram for UnitManager:
[legend]

Public Member Functions

void addFormatOption (UnitCategory unit_type, const ConstPointer< UnitOption > &format_option)
 
void addSpecialUnit (const DynamicPointer< CustomUnit > &custom_unit)
 
const Buffer< ConstPointer< UnitOption > > & angleUnitOptions () const
 
const Buffer< ConstPointer< UnitOption > > & areaUnitOptions () const
 
bool canBeImperial (const ConstPointer< Unit > &unit) const
 
bool canBeMetric (const ConstPointer< Unit > &unit) const
 
void clearUnitOptions (UnitCategory type)
 
const Buffer< ConstPointer< UnitOption > > & coordinateSpaceFormatOptions () const
 
ConstPointer< UnitdetermineUnit (const Buffer< String > &unit_parts, UnitCategory type) const
 
const Buffer< ConstPointer< UnitOption > > & distanceUnitOptions () const
 
void finishReadingINI (INIFactory &factory) override
 
void getINI (INIFactory &factory) override
 
bool hasSpecialUnit (const String &name) const
 
const Buffer< ConstPointer< UnitOption > > & latLonUnitOptions () const
 
UnitManageroperator= (const UnitManager &manager)
 
ConstPointer< UnitorientationOffsetUnit () const
 
ConstPointer< UnitparseUnit (const String &name, UnitCategory type=UnitCategory::e_undefined_unit) const
 
void prepareForINI (INIFactory &factory) override
 
void removeFormatOption (UnitCategory unit_type, const ConstPointer< UnitOption > &format_option)
 
void setToDefaultImperial (bool preserve_spacial)
 
void setToDefaultMetric (bool preserve_spacial)
 
void setUnit (UnitCategory type, const ConstPointer< Unit > &unit)
 
void setUnitOptions (UnitCategory type, const Buffer< ConstPointer< Unit > > &options)
 
void setUnitOptions (UnitCategory type, const Buffer< ConstPointer< UnitOption > > &options)
 
void setUnitOptionsToDefault (UnitCategory type)
 
void setupDefaultAngleUnitOptions ()
 
void setupDefaultAreaOptions ()
 
void setupDefaultCoordinateSpaceOptions ()
 
void setupDefaultDistanceOptions ()
 
void setupDefaultLatLonOptions ()
 
void setupDefaultVolumeOptions ()
 
void setupDefaultWeightOptions ()
 
ConstPointer< UnitspecialUnit (const String &name)
 
Resource< ConstPointer< Unit > > & specialUnitResource (const String &name)
 
const Buffer< DynamicPointer< CustomUnit > > & specialUnits () const
 
void tieToManager (const UnitManager &manager)
 
ConstPointer< Unitunit (const String &name) const
 
ConstPointer< Unitunit (UnitCategory type) const
 
 UnitManager ()
 
 UnitManager (const UnitManager &manager)
 
Buffer< ConstPointer< UnitOption > > unitOptions (UnitCategory units) const
 
Resource< ConstPointer< Unit > > & unitResource (UnitCategory type)
 
void updateCoordinateBase (const ConstPointer< Unit > &base)
 
const Buffer< ConstPointer< UnitOption > > & volumeUnitOptions () const
 
const Buffer< ConstPointer< UnitOption > > & weightUnitOptions () const
 
 ~UnitManager ()
 
- Public Member Functions inherited from INIInterface
 INIInterface (const File &default_ini)
 
virtual bool readINIOptions ()
 
virtual bool readINIOptions (File &ini_file)
 
virtual bool saveINIOptions (bool multithead=false)
 
virtual bool saveINIOptions (File &ini_file, bool multithead=false)
 
void setDefaultINIFile (const File &file)
 
virtual void writeToLog (const String &title, ProgressInfo *log, uint01 log_level=2U)
 
virtual void writeToLog (ProgressInfo *log, uint01 log_level=2U)
 
virtual ~INIInterface ()
 

Static Public Member Functions

static ConstPointer< UnitOptionActiveOption (const Buffer< ConstPointer< UnitOption > > &options, const ConstPointer< Unit > &unit)
 
static UnitManagerDefaultManager ()
 

Public Attributes

Resource< ConstPointer< Unit > > angle_unit
 
Resource< ConstPointer< Unit > > coordinate_space_unit
 
Resource< ConstPointer< Unit > > distance_unit
 
Resource< ConstPointer< Unit > > lat_lon_unit
 
Resource< ConstPointer< Unit > > orientation_space_unit
 
Resource< ConstPointer< Unit > > surface_area_unit
 
Resource< ConstPointer< Unit > > temperature_unit
 
Resource< ConstPointer< Unit > > volume_unit
 
Resource< ConstPointer< Unit > > weight_unit
 

Static Public Attributes

static Resource< ConstPointer< Unit > > default_orientation_space_unit
 

Protected Attributes

Buffer< ConstPointer< UnitOption > > m_angle_unit_options
 
Buffer< ConstPointer< UnitOption > > m_area_unit_options
 
Buffer< ConstPointer< UnitOption > > m_coordinate_format_options
 
Buffer< ConstPointer< UnitOption > > m_distance_unit_options
 
Buffer< ConstPointer< UnitOption > > m_lat_lon_unit_options
 
Dictionary< String, ConstPointer< UnitOption > > m_registered_units
 
Dictionary< String, DynamicPointer< CustomUnit > > m_special_unit_lookup
 
Buffer< DynamicPointer< CustomUnit > > m_special_units
 
ResourceListenerm_tie_to_listener = nullptr
 
Buffer< ConstPointer< UnitOption > > m_volume_unit_options
 
Buffer< ConstPointer< UnitOption > > m_weight_unit_options
 
- Protected Attributes inherited from INIInterface
File m_default_ini
 

Detailed Description

Handles a grouping of units that can describe any number of data categories.


Constructor & Destructor Documentation

◆ UnitManager() [1/2]

◆ UnitManager() [2/2]

UnitManager ( const UnitManager & manager)

◆ ~UnitManager()

Member Function Documentation

◆ ActiveOption()

static ConstPointer< UnitOption > ActiveOption ( const Buffer< ConstPointer< UnitOption > > & options,
const ConstPointer< Unit > & unit )
staticnodiscard

◆ addFormatOption()

void addFormatOption ( UnitCategory unit_type,
const ConstPointer< UnitOption > & format_option )

◆ addSpecialUnit()

void addSpecialUnit ( const DynamicPointer< CustomUnit > & custom_unit)

◆ angleUnitOptions()

const Buffer< ConstPointer< UnitOption > > & angleUnitOptions ( ) const
inlinenodiscard

◆ areaUnitOptions()

const Buffer< ConstPointer< UnitOption > > & areaUnitOptions ( ) const
inlinenodiscard

◆ canBeImperial()

bool canBeImperial ( const ConstPointer< Unit > & unit) const

◆ canBeMetric()

bool canBeMetric ( const ConstPointer< Unit > & unit) const

◆ clearUnitOptions()

void clearUnitOptions ( UnitCategory type)

◆ coordinateSpaceFormatOptions()

const Buffer< ConstPointer< UnitOption > > & coordinateSpaceFormatOptions ( ) const
inlinenodiscard

◆ DefaultManager()

static UnitManager & DefaultManager ( )
staticnodiscard

◆ determineUnit()

ConstPointer< Unit > determineUnit ( const Buffer< String > & unit_parts,
UnitCategory type ) const
nodiscard

◆ distanceUnitOptions()

const Buffer< ConstPointer< UnitOption > > & distanceUnitOptions ( ) const
inlinenodiscard

◆ finishReadingINI()

void finishReadingINI ( INIFactory & factory)
overridevirtual

Reimplemented from INIInterface.

◆ getINI()

void getINI ( INIFactory & factory)
overridevirtual

Implements INIInterface.

◆ hasSpecialUnit()

bool hasSpecialUnit ( const String & name) const

◆ latLonUnitOptions()

const Buffer< ConstPointer< UnitOption > > & latLonUnitOptions ( ) const
inlinenodiscard

◆ operator=()

UnitManager & operator= ( const UnitManager & manager)

◆ orientationOffsetUnit()

ConstPointer< Unit > orientationOffsetUnit ( ) const
nodiscard

◆ parseUnit()

ConstPointer< Unit > parseUnit ( const String & name,
UnitCategory type = UnitCategory::e_undefined_unit ) const
nodiscard

◆ prepareForINI()

void prepareForINI ( INIFactory & factory)
overridevirtual

Reimplemented from INIInterface.

◆ removeFormatOption()

void removeFormatOption ( UnitCategory unit_type,
const ConstPointer< UnitOption > & format_option )

◆ setToDefaultImperial()

void setToDefaultImperial ( bool preserve_spacial)

◆ setToDefaultMetric()

void setToDefaultMetric ( bool preserve_spacial)

◆ setUnit()

void setUnit ( UnitCategory type,
const ConstPointer< Unit > & unit )

◆ setUnitOptions() [1/2]

void setUnitOptions ( UnitCategory type,
const Buffer< ConstPointer< Unit > > & options )

◆ setUnitOptions() [2/2]

void setUnitOptions ( UnitCategory type,
const Buffer< ConstPointer< UnitOption > > & options )

◆ setUnitOptionsToDefault()

void setUnitOptionsToDefault ( UnitCategory type)

◆ setupDefaultAngleUnitOptions()

void setupDefaultAngleUnitOptions ( )

◆ setupDefaultAreaOptions()

void setupDefaultAreaOptions ( )

◆ setupDefaultCoordinateSpaceOptions()

void setupDefaultCoordinateSpaceOptions ( )

◆ setupDefaultDistanceOptions()

void setupDefaultDistanceOptions ( )

◆ setupDefaultLatLonOptions()

void setupDefaultLatLonOptions ( )

◆ setupDefaultVolumeOptions()

void setupDefaultVolumeOptions ( )

◆ setupDefaultWeightOptions()

void setupDefaultWeightOptions ( )

◆ specialUnit()

ConstPointer< Unit > specialUnit ( const String & name)

◆ specialUnitResource()

Resource< ConstPointer< Unit > > & specialUnitResource ( const String & name)

◆ specialUnits()

const Buffer< DynamicPointer< CustomUnit > > & specialUnits ( ) const
inlinenodiscard

◆ tieToManager()

void tieToManager ( const UnitManager & manager)

◆ unit() [1/2]

ConstPointer< Unit > unit ( const String & name) const
nodiscard

◆ unit() [2/2]

ConstPointer< Unit > unit ( UnitCategory type) const
nodiscard

◆ unitOptions()

Buffer< ConstPointer< UnitOption > > unitOptions ( UnitCategory units) const
nodiscard

◆ unitResource()

Resource< ConstPointer< Unit > > & unitResource ( UnitCategory type)
nodiscard

◆ updateCoordinateBase()

void updateCoordinateBase ( const ConstPointer< Unit > & base)

◆ volumeUnitOptions()

const Buffer< ConstPointer< UnitOption > > & volumeUnitOptions ( ) const
inlinenodiscard

◆ weightUnitOptions()

const Buffer< ConstPointer< UnitOption > > & weightUnitOptions ( ) const
inlinenodiscard

Member Data Documentation

◆ angle_unit

Resource<ConstPointer<Unit> > angle_unit

◆ coordinate_space_unit

Resource<ConstPointer<Unit> > coordinate_space_unit

◆ default_orientation_space_unit

Resource<ConstPointer<Unit> > default_orientation_space_unit
static

◆ distance_unit

Resource<ConstPointer<Unit> > distance_unit

◆ lat_lon_unit

Resource<ConstPointer<Unit> > lat_lon_unit

◆ m_angle_unit_options

Buffer<ConstPointer<UnitOption> > m_angle_unit_options
protected

◆ m_area_unit_options

Buffer<ConstPointer<UnitOption> > m_area_unit_options
protected

◆ m_coordinate_format_options

Buffer<ConstPointer<UnitOption> > m_coordinate_format_options
protected

◆ m_distance_unit_options

Buffer<ConstPointer<UnitOption> > m_distance_unit_options
protected

◆ m_lat_lon_unit_options

Buffer<ConstPointer<UnitOption> > m_lat_lon_unit_options
protected

◆ m_registered_units

Dictionary<String, ConstPointer<UnitOption> > m_registered_units
protected

◆ m_special_unit_lookup

Dictionary<String, DynamicPointer<CustomUnit> > m_special_unit_lookup
protected

◆ m_special_units

Buffer<DynamicPointer<CustomUnit> > m_special_units
protected

◆ m_tie_to_listener

ResourceListener* m_tie_to_listener = nullptr
protected

◆ m_volume_unit_options

Buffer<ConstPointer<UnitOption> > m_volume_unit_options
protected

◆ m_weight_unit_options

Buffer<ConstPointer<UnitOption> > m_weight_unit_options
protected

◆ orientation_space_unit

Resource<ConstPointer<Unit> > orientation_space_unit

◆ surface_area_unit

Resource<ConstPointer<Unit> > surface_area_unit

◆ temperature_unit

Resource<ConstPointer<Unit> > temperature_unit

◆ volume_unit

Resource<ConstPointer<Unit> > volume_unit

◆ weight_unit

Resource<ConstPointer<Unit> > weight_unit

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