3#include "Messages/IMessage.h"
6namespace RoboidControl {
8constexpr int MAX_THING_COUNT = 256;
48 const std::list<Participant*>&
GetAll()
const;
52 std::list<Participant*> participants;
85#pragma region Properties
89 const char*
name =
"Participant";
108 unsigned char thingCount = 0;
109 Thing* things[MAX_THING_COUNT];
121 void Add(
Thing* thing,
bool checkId =
true);
126#pragma endregion Properties
134#pragma endregion Update
143#pragma endregion Send
145#pragma region Participant Registry
150#pragma endregion Participant Registry
Root structure for all communcation messages.
Definition IMessage.h:6
A participant is a device which manages things. It can communicate with other participant to synchron...
Definition Participant.h:62
void Add(Thing *thing, bool checkId=true)
Add a new thing for this participant.
Definition Participant.cpp:98
Thing * root
The root thing for this participant.
Definition Participant.h:104
Thing * Get(unsigned char thingId)
Find a thing managed by this participant.
Definition Participant.cpp:87
const char * name
The name of the participant.
Definition Participant.h:89
Participant()
Create a generic participant.
Definition Participant.cpp:22
static void ReplaceLocalParticipant(Participant &newParticipant)
Replace the local participant.
Definition Participant.cpp:17
unsigned char networkId
The network Id to identify the participant.
Definition Participant.h:101
unsigned int port
The port number for UDP communication with the participant.
Definition Participant.h:98
virtual void Update()
Update all things for this participant.
Definition Participant.cpp:52
const char * ipAddress
The Ip Address of a participant.
Definition Participant.h:94
void Remove(Thing *thing)
Remove a thing for this participant.
Definition Participant.cpp:136
~Participant()
Destructor for the participant.
Definition Participant.cpp:47
std::list< Thing * > things
The things managed by this participant.
Definition Participant.h:112
static Participant * LocalParticipant
The local participant for this application.
Definition Participant.h:78
class which manages all known participants
Definition Participant.h:11
const std::list< Participant * > & GetAll() const
Get all participants.
Participant * Add(const char *ipAddress, unsigned int port)
Add a participant with the given details.
Definition Participant.cpp:193
Participant * Get(const char *ipAddress, unsigned int port)
Retrieve a participant by its address.
Definition Participant.cpp:161
void Remove(Participant *participant)
Remove a participant.
Definition Participant.cpp:225
A thing is the primitive building block.
Definition Thing.h:20