/** * Handler for player data * $Id$ * $HeadURL$ * $Author$ * Created by gr, SLSE, 2017-02-20 */ #pragma once #include "simulation_movement.h" #include #include #include #include #include #include #include #include // Simulated movement for participants namespace CentralEffectSimulationBasic { class HandlerSimulatedMovement final : public QObject , protected CentralEffectSimulation::Interface::Fts::SimulatedMovementModifyRequestHandler , protected CentralEffectSimulation::Interface::Fts::SimulatedMovementRemoveRequestHandler , protected CentralEffectSimulation::Interface::Fts::SimulatedMovementRemoveByParticipantIdRequestHandler , protected ParticipantManagement::Interface::Ftc::ModifyParticipantDataReplyHandler , protected ParticipantManagement::Interface::Ftc::SetAsSimulatedReplyHandler { Q_OBJECT public: explicit HandlerSimulatedMovement(const std::shared_ptr &ddsHandler, const std::shared_ptr &participantHandler, const std::shared_ptr &db, QObject *parent = nullptr); ~HandlerSimulatedMovement(); /** * Initialize the handler to manage information from player management */ bool init(); void onModifyParticipantDataReply(const Core::FunctionReplyObject &replyObject) override final; void onSetAsSimulatedReply(const Core::FunctionReplyObject &replyObject) override final; private: // methoden bool loadSimulatedMovementFromDb(); void onSimulatedMovementModifyRequest(const rti::core::SampleIdentity &cookie, const CentralEffectSimulation::SimulatedMovement &request) override; void onSimulatedMovementRemoveRequest(const rti::core::SampleIdentity &cookie, const Core::RemoveElementRequest &request) override; void onSimulatedMovementRemoveByParticipantIdRequest(const rti::core::SampleIdentity &cookie, const CentralEffectSimulation::SimulatedMovementRemoveByParticipantId &request) override; Core::FunctionReplyObject insertInDb(const CentralEffectSimulation::SimulatedMovement &request); Core::FunctionReplyObject updateDb(const CentralEffectSimulation::SimulatedMovement &request); Core::FunctionReplyObject removeFromDb(const int32_t id); void publishSimulatedMovement(const CentralEffectSimulation::SimulatedMovement &request); void setParticipantAsSimulated(const int &participantId, const bool isSimulated); Core::FunctionReplyObject removeSimulatedMovement(int32_t ddsId); SimulationMovement *findSimulationMovement(int id, int participantId); private: // attributes std::shared_ptr m_ddsHandler; ///< Pointer to VOM DDS handler std::shared_ptr m_handlerParticipant; std::shared_ptr m_db; // Input-values for simulation QHash m_simulationMovements; // Key = SimulationMovement.id int m_jumpToStart; CentralEffectSimulation::LOGGER_T &m_logger; ///< Interface to the Logging-Facility }; } // namespace CentralEffectSimulationBasic