/** * The BiteHandler class manages everything todo with bite requests. * $Id$ * $HeadURL$ * $Author$ * Created by Hannes Baeuerle, SLSE, 2016-06-06 */ #pragma once #include #include #include "dds_handler.h" #include "logger.h" #include #include #include #include class QTimer; namespace ParticipantManagement { class MainHandler; namespace BiteHandling { class BiteReplier; class BiteHandler final : public QObject , protected Interface::Fts::CallBiteRequestHandler , protected TrainingAreaBase::Interface::Ftc::DemandBiteReplyHandler { Q_OBJECT public: explicit BiteHandler(MainHandler *mainHandler); bool init(); void onDemandBiteReply(const Core::FunctionReplyObject &replyObject) override; void onCallBiteRequest(const rti::core::SampleIdentity &cookie, const CallBiteRequest &request) override; private: Core::FunctionReplyObject callBiteRequest(const rti::core::SampleIdentity &cookie, const CallBiteRequest &request); void onBiteRequestTimeout(int requestId); private: MainHandler *m_mainHandler; struct DemandedParticipants { QSet demandedBiteParticipants; rti::core::SampleIdentity cookie; QPointer timer; }; QMap m_demandedBiteParticipantRequests; QSet m_demandedBiteParticipants; // participant IDs LOGGER_T m_logger; }; // class BiteHandler } // namespace BiteHandling } // namespace ParticipantManagement