/** * MainHandler for Messaging * $Id$ * $HeadURL$ * $Author$ * Created by hjl, SLSE, 2016-09-21 */ #pragma once #include "ces_plugin_interface.h" #include "handler_participant.h" #include "handler_building_data.h" #include "proxy_building.h" #include "dds_handler.h" #include #include namespace NGLDB { template class DbServiceHandler; } namespace LtsPluginManager { struct PluginInstance; } namespace LtsPluginManager { struct PluginInstance; } namespace CentralEffectSimulation { class SVCCESDDSCOMMON_EXPORT MainHandler : public QObject, public Plugin::DataProvider { Q_OBJECT public: explicit MainHandler(QObject *parent = nullptr); ~MainHandler(); bool init(int domainId, int exerciseId); std::shared_ptr dds() const { return m_ddsHandler; } std::shared_ptr db() const { return m_dbHandler->db(); } std::shared_ptr handlerBuildingData() const { return m_handlerBuildingData; } std::shared_ptr handlerParticipant() const { return m_handlerParticipant; } std::shared_ptr proxyBuilding() const { return m_proxyBuilding; } const std::vector> &getPluginList() const { return m_interfaces; } private: bool loadPlugin(const LtsPluginManager::PluginInstance &pi); private: // attributes std::shared_ptr m_ddsHandler; std::shared_ptr m_dbHandler; std::shared_ptr m_db; std::shared_ptr m_handlerBuildingData; std::shared_ptr m_handlerParticipant; std::vector> m_interfaces; std::shared_ptr m_proxyBuilding; int m_domainId = 0; int m_exerciseId = 0; CentralEffectSimulation::LOGGER_T &m_logger; ///< Interface to the Logging-Facility }; } // namespace CentralEffectSimulation