#pragma once #include "ParticipantUDP.h" #if !defined(NO_STD) #include #include #include #endif namespace RoboidControl { /// @brief A participant is device which can communicate with other participants class SiteServer : public ParticipantUDP { public: SiteServer(int port = 7681); // virtual void Update(unsigned long currentTimeMs = 0) override; // #if !defined(NO_STD) // template // void Register(unsigned char thingType) { // thingMsgProcessors[thingType] = [](Participant* participant, // unsigned char networkId, // unsigned char thingId) { // return new ThingClass(participant, networkId, thingId); // }; // }; // #endif protected: unsigned long nextPublishMe = 0; virtual void Process(Participant* sender, ParticipantMsg* msg) override; virtual void Process(Participant* sender, SiteMsg* msg) override; virtual void Process(Participant* sender, ThingMsg* msg) override; // #if !defined(NO_STD) // using ThingConstructor = std::function; // std::unordered_map thingMsgProcessors; // #endif }; } // namespace RoboidControl