svcore
1.9
|
#include <UnitDatabase.h>
Signals | |
void | unitDatabaseChanged () |
Public Member Functions | |
QStringList | getKnownUnits () const |
void | registerUnit (QString unit) |
int | getUnitId (QString unit, bool registerNew=true) |
Return the reference id for a given unit name. More... | |
QString | getUnitById (int id) |
Static Public Member Functions | |
static UnitDatabase * | getInstance () |
Protected Types | |
typedef std::map< QString, int > | UnitMap |
Protected Member Functions | |
UnitDatabase () | |
Protected Attributes | |
UnitMap | m_units |
int | m_nextId |
Static Protected Attributes | |
static UnitDatabase | m_instance |
Detailed Description
Definition at line 29 of file UnitDatabase.h.
Member Typedef Documentation
|
protected |
Definition at line 54 of file UnitDatabase.h.
Constructor & Destructor Documentation
|
protected |
Definition at line 27 of file UnitDatabase.cpp.
Member Function Documentation
|
static |
Definition at line 22 of file UnitDatabase.cpp.
References m_instance.
Referenced by PropertyContainer::convertPropertyStrings(), RegionModel::setScaleUnits(), BoxModel::setScaleUnits(), SparseTimeValueModel::setScaleUnits(), and NoteModel::setScaleUnits().
QStringList UnitDatabase::getKnownUnits | ( | ) | const |
Definition at line 33 of file UnitDatabase.cpp.
References m_units.
void UnitDatabase::registerUnit | ( | QString | unit | ) |
Definition at line 43 of file UnitDatabase.cpp.
References m_nextId, m_units, and unitDatabaseChanged().
Referenced by getUnitId(), RegionModel::setScaleUnits(), BoxModel::setScaleUnits(), SparseTimeValueModel::setScaleUnits(), and NoteModel::setScaleUnits().
int UnitDatabase::getUnitId | ( | QString | unit, |
bool | registerNew = true |
||
) |
Return the reference id for a given unit name.
If registerNew is true and the unit is not known, register it and return its new id. If register is false and the unit is not known, return -1.
Definition at line 52 of file UnitDatabase.cpp.
References m_units, and registerUnit().
Referenced by PropertyContainer::convertPropertyStrings().
QString UnitDatabase::getUnitById | ( | int | id | ) |
Definition at line 62 of file UnitDatabase.cpp.
References m_units.
|
signal |
Referenced by registerUnit().
Member Data Documentation
|
protected |
Definition at line 55 of file UnitDatabase.h.
Referenced by getKnownUnits(), getUnitById(), getUnitId(), and registerUnit().
|
protected |
Definition at line 56 of file UnitDatabase.h.
Referenced by registerUnit().
|
staticprotected |
Definition at line 58 of file UnitDatabase.h.
Referenced by getInstance().
The documentation for this class was generated from the following files:
Generated by 1.8.11