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