Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* ExerciseStateManager / Manages the state of an exercise
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <functional>
|
||||
#include <QMap>
|
||||
|
||||
#include <ExerciseManagement/exm_enums.hpp>
|
||||
|
||||
namespace NGL
|
||||
{
|
||||
class INGLLogger;
|
||||
}
|
||||
|
||||
namespace ExerciseManagement
|
||||
{
|
||||
class ObjectExercise;
|
||||
class ExerciseStateManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ExerciseStateManager(ObjectExercise* objExe, QObject *parent = nullptr);
|
||||
|
||||
bool triggerSwitchState(ExerciseManagement::ExerciseState state);
|
||||
|
||||
bool isValid(ExerciseManagement::ExerciseState state) const;
|
||||
void setCurrent(ExerciseManagement::ExerciseState state);
|
||||
void setInitial(ExerciseManagement::ExerciseState state);
|
||||
|
||||
static QString toString(ExerciseManagement::ExerciseState state);
|
||||
Q_SIGNALS:
|
||||
void stateUnknown();
|
||||
void stateCreated();
|
||||
void stateStarted();
|
||||
void statePaused();
|
||||
void stateStopped();
|
||||
void stateTerminated();
|
||||
void stateFalse();
|
||||
|
||||
private:
|
||||
void setStateInternal(ExerciseManagement::ExerciseState state);
|
||||
int exerciseId() const;
|
||||
|
||||
QMap<ExerciseManagement::ExerciseState, std::function<void()> > m_stateSignals;
|
||||
|
||||
ExerciseManagement::ExerciseState m_exerciseState;
|
||||
ObjectExercise *m_exercise;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
} // namespace ExerciseManagement
|
||||
Reference in new issue
Block a user