55 lines
1.8 KiB
C++
Executable File
55 lines
1.8 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Handler for all exercise phase objects
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* created by Philipp Dassow, SLEA, 2017-04-06
|
|
*/
|
|
#pragma once
|
|
|
|
#include <QMap>
|
|
|
|
#include "logger.h"
|
|
#include "exm_fts.h"
|
|
|
|
namespace ExerciseManagement
|
|
{
|
|
|
|
class DdsHandler;
|
|
class DatabaseInterface;
|
|
class MainHandler;
|
|
class ObjectExercisePhase;
|
|
class HandlerExercisePhase final
|
|
: protected Interface::Fts::ExercisePhaseCreateRequestHandler
|
|
, protected Interface::Fts::ExercisePhaseModifyRequestHandler
|
|
, protected Interface::Fts::ExercisePhaseRemoveRequestHandler
|
|
{
|
|
public:
|
|
HandlerExercisePhase(MainHandler *mainHandler,
|
|
const std::shared_ptr<DdsHandler> &ddsHandler,
|
|
const std::shared_ptr<DatabaseInterface> &db);
|
|
~HandlerExercisePhase();
|
|
|
|
bool init();
|
|
Core::FunctionReplyObject exercisePhaseCreateRequest(const ExercisePhaseCreateRequest &request);
|
|
Core::FunctionReplyObject removeAllPhasesByExerciseId(qint64 exerciseId);
|
|
|
|
private:
|
|
void onExercisePhaseCreateRequest(const rti::core::SampleIdentity &cookie,
|
|
const ExercisePhaseCreateRequest &request) override final;
|
|
void onExercisePhaseModifyRequest(const rti::core::SampleIdentity &cookie,
|
|
const ExercisePhaseModifyRequest &request) override final;
|
|
void onExercisePhaseRemoveRequest(const rti::core::SampleIdentity &cookie,
|
|
const Core::RemoveElementRequest &request) override final;
|
|
|
|
private:
|
|
QMap<int, ObjectExercisePhase *> m_exercisePhaseObjMap;
|
|
MainHandler *m_mainHandler;
|
|
std::shared_ptr<DdsHandler> m_ddsHandler;
|
|
std::shared_ptr<DatabaseInterface> m_db;
|
|
NGL::INGLLogger &m_logger;
|
|
};
|
|
|
|
} // namespace ExerciseManagement
|