NDEVR
API Documentation

A definition of how to describe a particular set of data to a custom category of unit. More...

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

Public Member Functions

 UnitOption (const StringView &id, const TranslatedString &name)
 Constructs a UnitOption with the given identifier and display name.
virtual ~UnitOption ()
 Virtual destructor.
virtual bool hasMemberUnit (const ConstPointer< Unit > &unit) const =0
 Checks whether the given unit is a member of this option.
virtual Buffer< ConstPointer< UnitOption > > subOptions () const
 Returns the sub-options contained within this unit option.
virtual TranslatedString title () const
 Returns the translated display title for this unit option.
virtual ConstPointer< Unitunit () const =0
 Returns the unit associated with this option.
virtual ConstPointer< Unitunit (const ConstPointer< Unit > &) const
 Returns a unit resolved relative to the given unit context.

Public Attributes

String id
 The unique string identifier of this unit option.
TranslatedString name
 The translated display name of this unit option.

Detailed Description

A definition of how to describe a particular set of data to a custom category of unit.


Definition at line 17 of file UnitManager.h.

Constructor & Destructor Documentation

◆ UnitOption()

UnitOption::UnitOption ( const StringView & id,
const TranslatedString & name )
inline

Constructs a UnitOption with the given identifier and display name.

Parameters
[in]idThe unique string identifier for this unit option.
[in]nameThe translated display name for this unit option.

Definition at line 25 of file UnitManager.h.

References id, and name.

Referenced by BasicUnitOption::BasicUnitOption(), and CoordinateUnitOption::CoordinateUnitOption().

Member Function Documentation

◆ hasMemberUnit()

virtual bool UnitOption::hasMemberUnit ( const ConstPointer< Unit > & unit) const
pure virtual

Checks whether the given unit is a member of this option.

Parameters
[in]unitThe unit to check membership for.
Returns
True if the unit is a member of this option, false otherwise.

Implemented in BasicUnitOption, and CoordinateUnitOption.

References unit().

◆ subOptions()

virtual Buffer< ConstPointer< UnitOption > > UnitOption::subOptions ( ) const
inlinevirtual

Returns the sub-options contained within this unit option.

Returns
A buffer of const pointers to child UnitOption objects.

Reimplemented in BasicUnitOption.

Definition at line 59 of file UnitManager.h.

◆ title()

virtual TranslatedString UnitOption::title ( ) const
inlinevirtual

Returns the translated display title for this unit option.

Returns
The translated title string.

Reimplemented in BasicUnitOption.

Definition at line 37 of file UnitManager.h.

References name.

◆ unit() [1/2]

virtual ConstPointer< Unit > UnitOption::unit ( ) const
pure virtual

Returns the unit associated with this option.

Returns
A const pointer to the unit.

Implemented in BasicUnitOption, and CoordinateUnitOption.

Referenced by hasMemberUnit().

◆ unit() [2/2]

virtual ConstPointer< Unit > UnitOption::unit ( const ConstPointer< Unit > & ) const
inlinevirtual

Returns a unit resolved relative to the given unit context.

Parameters
[in]unitThe unit to use as context for resolution.
Returns
A const pointer to the resolved unit.

Reimplemented in CoordinateUnitOption.

Definition at line 54 of file UnitManager.h.

References unit().

Referenced by unit().


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