/** * MainHandler for OCSituationClient * $Id$ * $HeadURL$ * $Author$ * Created by Philipp Dassow, NLST, 14-02-2018 */ #pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dds_handler.h" #include #include "osc_db.h" #include "logger.h" namespace NGLDB { template class DbServiceHandler; } namespace OcSituationClient { using DbHandler = NGLDB::DbServiceHandler; class HandlerOcData; class MainHandler : public QObject { 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 aesDtc() const { return m_aesDtc; } std::shared_ptr aesFtc() const { return m_aesFtc; } std::shared_ptr evlFtc() const { return m_evlFtc; } std::shared_ptr gimDtc() const { return m_gimDtc; } std::shared_ptr msgDtc() const { return m_msgDtc; } std::shared_ptr msgFtc() const { return m_msgFtc; } std::shared_ptr ossDts() const { return m_ossDts; } std::shared_ptr ossFts() const { return m_ossFts; } std::shared_ptr opmDtc() const { return m_opmDtc; } std::shared_ptr ppmDtc() const { return m_ppmDtc; } std::shared_ptr ppmFtc() const { return m_ppmFtc; } std::shared_ptr tabDtc() const { return m_tabDtc; } std::shared_ptr tabDts() const { return m_tabDts; } std::shared_ptr tabFtc() const { return m_tabFtc; } std::shared_ptr tabocDtc() const { return m_tabocDtc; } std::shared_ptr tabocDts() const { return m_tabocDts; } static inline QByteArray tryUncompress(const QByteArray &data, bool bWithCompression) { if (!bWithCompression) return data; try { // may throw ... :/ return qUncompress(data); } catch (...) {} return {}; } private: std::shared_ptr m_ddsHandler; std::shared_ptr m_handlerOcData; std::shared_ptr m_dbHandler; std::shared_ptr m_aesDtc; std::shared_ptr m_aesFtc; std::shared_ptr m_evlFtc; std::shared_ptr m_gimDtc; std::shared_ptr m_msgDtc; std::shared_ptr m_msgFtc; std::shared_ptr m_opmDtc; std::shared_ptr m_ossDts; std::shared_ptr m_ossFts; std::shared_ptr m_ppmDtc; std::shared_ptr m_ppmFtc; std::shared_ptr m_tabDtc; std::shared_ptr m_tabDts; std::shared_ptr m_tabFtc; std::shared_ptr m_tabocDtc; std::shared_ptr m_tabocDts; NGL::INGLLogger &m_logger; }; } // namespace OcSituationClient