45 lines
918 B
C++
45 lines
918 B
C++
#pragma once
|
|
|
|
#include "ParticipantUDP.h"
|
|
|
|
#if !defined(NO_STD)
|
|
#include <functional>
|
|
#include <memory>
|
|
#include <unordered_map>
|
|
#endif
|
|
|
|
namespace RoboidControl {
|
|
|
|
/// @brief A participant is device which can communicate with other participants
|
|
class SiteServer : public ParticipantUDP {
|
|
|
|
#pragma region Init
|
|
|
|
public:
|
|
/// @brief Create a new site server
|
|
/// @param port The port of which to receive the messages
|
|
SiteServer(int port = 7681);
|
|
|
|
#pragma endregion Init
|
|
|
|
#pragma region Update
|
|
|
|
virtual void UpdateMyThings() override;
|
|
|
|
#pragma endregion Update
|
|
|
|
#pragma region Receive
|
|
|
|
protected:
|
|
unsigned long nextPublishMe = 0;
|
|
|
|
virtual void Process(Participant* sender, ParticipantMsg* msg) override;
|
|
virtual void Process(Participant* sender, NetworkIdMsg* msg) override;
|
|
virtual void Process(Participant* sender, ThingMsg* msg) override;
|
|
|
|
#pragma endregion Receive
|
|
|
|
};
|
|
|
|
} // namespace RoboidControl
|