Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Attributes

StateManager Class Reference

Creates concrete state and returns State supertype. More...

#include <stateManager.h>

Collaboration diagram for StateManager:

List of all members.

Public Member Functions

 ~StateManager ()
StatecreateState (const QString &typeName, Editor *editor, const QPoint &pos, const QString &label, const QString &name, bool dimmed)
 overloaded function for parser needs
StatecreateState (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 StateManagergetInstance ()
 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

StatecreateStateNormal (Editor *editor, const QPoint &pos, const QString &label, const QString &name, bool dimmed)
 createConcreteState methods
StatecreateStateNormalFinal (Editor *editor, const QPoint &pos, const QString &label, const QString &name, bool dimmed)
StatecreateStateVar (Editor *editor, const QPoint &pos, const QString &label, const QString &name, bool dimmed)
StatecreateStateVarFinal (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 StateManagermanager = NULL

Detailed Description

Creates concrete state and returns State supertype.

Implemented as singelton.

Definition at line 16 of file stateManager.h.


Member Typedef Documentation

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.


Constructor & Destructor Documentation

StateManager::StateManager (  )  [private]

Definition at line 16 of file stateManager.cpp.

References stateTypeList, and typeNameToInstanceMap.

Referenced by getInstance().

Here is the caller graph for this function:

StateManager::~StateManager (  )  [inline]

Definition at line 24 of file stateManager.h.

References instantiated.


Member Function Documentation

State * StateManager::createState ( Editor editor,
const QPoint &  pos,
const StateDialog sd 
)
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:


Member Data Documentation

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().


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