Creates concrete state and returns State supertype. More...
#include <stateManager.h>
Public Member Functions | |
~StateManager () | |
State * | createState (const QString &typeName, Editor *editor, const QPoint &pos, const QString &label, const QString &name, bool dimmed) |
overloaded function for parser needs | |
State * | createState (Editor *editor, const QPoint &pos, const StateDialog &sd) |
int | getTypeNameId (const QString &typeName) const |
returns typeID by given typeName - important to hold elements's types consistent | |
const QList< QString > & | getTypeNameList () const |
returns states type list, used for dialog (filling comboBox) | |
Static Public Member Functions | |
static StateManager * | getInstance () |
returns instance of StateManager | |
Protected Types | |
typedef State *(StateManager::* | StateConstructor )(Editor *editor, const QPoint &pos, const QString &, const QString &, bool) |
pointer to StateManager::createConcreteState | |
typedef QMap< QString, StateConstructor > | TypeNameToInstanceMap |
Protected Member Functions | |
State * | createStateNormal (Editor *editor, const QPoint &pos, const QString &label, const QString &name, bool dimmed) |
createConcreteState methods | |
State * | createStateNormalFinal (Editor *editor, const QPoint &pos, const QString &label, const QString &name, bool dimmed) |
State * | createStateVar (Editor *editor, const QPoint &pos, const QString &label, const QString &name, bool dimmed) |
State * | createStateVarFinal (Editor *editor, const QPoint &pos, const QString &label, const QString &name, bool dimmed) |
Protected Attributes | |
QList< QString > | stateTypeList |
TypeNameToInstanceMap | typeNameToInstanceMap |
maps type name to State createConcreteState function | |
Private Member Functions | |
StateManager () | |
Static Private Attributes | |
static bool | instantiated = false |
static StateManager * | manager = NULL |
Creates concrete state and returns State supertype.
Implemented as singelton.
Definition at line 16 of file stateManager.h.
typedef State*(StateManager::* StateManager::StateConstructor)(Editor *editor, const QPoint &pos, const QString &, const QString &, bool) [protected] |
pointer to StateManager::createConcreteState
Definition at line 56 of file stateManager.h.
typedef QMap<QString, StateConstructor> StateManager::TypeNameToInstanceMap [protected] |
Definition at line 57 of file stateManager.h.
StateManager::StateManager | ( | ) | [private] |
Definition at line 16 of file stateManager.cpp.
References stateTypeList, and typeNameToInstanceMap.
Referenced by getInstance().
StateManager::~StateManager | ( | ) | [inline] |
Definition at line 24 of file stateManager.h.
References instantiated.
State * StateManager::createState | ( | Editor * | editor, | |
const QPoint & | pos, | |||
const StateDialog & | sd | |||
) |
returns State type
Definition at line 51 of file stateManager.cpp.
References StateDialog::getLabel(), StateDialog::getName(), StateDialog::getType(), StateDialog::isDimmed(), stateTypeList, and typeNameToInstanceMap.
Referenced by StateSerializer::createState(), createState(), NaiveDrawAlgorithm::drawAutomaton(), Editor::editState(), Editor::generateExactMatching(), Editor::insertState(), and Parser::StateDeclaration().
State * StateManager::createState | ( | const QString & | typeName, | |
Editor * | editor, | |||
const QPoint & | pos, | |||
const QString & | label, | |||
const QString & | name, | |||
bool | dimmed | |||
) |
overloaded function for parser needs
Definition at line 58 of file stateManager.cpp.
References typeNameToInstanceMap.
State * StateManager::createStateNormal | ( | Editor * | editor, | |
const QPoint & | pos, | |||
const QString & | label, | |||
const QString & | name, | |||
bool | dimmed | |||
) | [protected] |
createConcreteState methods
Definition at line 70 of file stateManager.cpp.
State * StateManager::createStateNormalFinal | ( | Editor * | editor, | |
const QPoint & | pos, | |||
const QString & | label, | |||
const QString & | name, | |||
bool | dimmed | |||
) | [protected] |
Definition at line 76 of file stateManager.cpp.
State * StateManager::createStateVar | ( | Editor * | editor, | |
const QPoint & | pos, | |||
const QString & | label, | |||
const QString & | name, | |||
bool | dimmed | |||
) | [protected] |
Definition at line 82 of file stateManager.cpp.
State * StateManager::createStateVarFinal | ( | Editor * | editor, | |
const QPoint & | pos, | |||
const QString & | label, | |||
const QString & | name, | |||
bool | dimmed | |||
) | [protected] |
Definition at line 88 of file stateManager.cpp.
StateManager * StateManager::getInstance | ( | ) | [static] |
returns instance of StateManager
Definition at line 26 of file stateManager.cpp.
References instantiated, manager, and StateManager().
Referenced by StateSerializer::createState(), createState(), NaiveDrawAlgorithm::drawAutomaton(), Editor::editState(), Editor::generateDistance(), Editor::generateExactMatching(), Editor::insertState(), Parser::StateDeclaration(), and Editor::~Editor().
int StateManager::getTypeNameId | ( | const QString & | typeName | ) | const |
returns typeID by given typeName - important to hold elements's types consistent
Definition at line 45 of file stateManager.cpp.
References stateTypeList.
Referenced by Editor::editState().
const QList< QString > & StateManager::getTypeNameList | ( | ) | const |
returns states type list, used for dialog (filling comboBox)
Definition at line 40 of file stateManager.cpp.
References stateTypeList.
Referenced by Editor::editState(), and Editor::insertState().
bool StateManager::instantiated = false [static, private] |
Definition at line 19 of file stateManager.h.
Referenced by getInstance(), and ~StateManager().
StateManager * StateManager::manager = NULL [static, private] |
Definition at line 20 of file stateManager.h.
Referenced by getInstance().
QList<QString> StateManager::stateTypeList [protected] |
Definition at line 53 of file stateManager.h.
Referenced by createState(), getTypeNameId(), getTypeNameList(), and StateManager().
maps type name to State createConcreteState function
Definition at line 58 of file stateManager.h.
Referenced by createState(), and StateManager().