![]() |
Roboid Control for C++
|
A participant is a device which manages things. It can communicate with other participant to synchronise the state of things. This class is used to register the things the participant is managing. It also maintains the communcation information to contact the participant. It is used as a basis for the local participant, but also as a reference to remote participants.
#include <Participant.h>
Public Member Functions | |
Participant (const char *ipAddress, int port) | |
Create a new participant with the given communcation info. | |
~Participant () | |
Destructor for the participant. | |
Thing * | Get (unsigned char thingId) |
Find a thing managed by this participant. | |
void | Add (Thing *thing, bool checkId=true) |
Add a new thing for this participant. | |
void | Remove (Thing *thing) |
Remove a thing for this participant. | |
virtual void | Update (unsigned long currentTimeMs=0) |
Update all things for this participant. | |
Public Attributes | |
const char * | ipAddress = "0.0.0.0" |
The Ip Address of a participant. | |
unsigned int | port = 0 |
The port number for UDP communication with the participant. | |
unsigned char | networkId = 0 |
The network Id to identify the participant. | |
unsigned char | thingCount = 0 |
Thing * | things [MAX_THING_COUNT] |
std::list< Thing * > | things |
The things managed by this participant. | |
Static Public Attributes | |
static ParticipantRegistry | registry |
RoboidControl::Participant::Participant | ( | const char * | ipAddress, |
int | port | ||
) |
Create a new participant with the given communcation info.
ipAddress | The IP address of the participant |
port | The UDP port of the participant |
Thing * RoboidControl::Participant::Get | ( | unsigned char | thingId | ) |
Find a thing managed by this participant.
thingId | The ID of the thing |
void RoboidControl::Participant::Add | ( | Thing * | thing, |
bool | checkId = true |
||
) |
Add a new thing for this participant.
thing | The thing to add |
checkId | If true, the thing.id is regenerated if it is zero |
void RoboidControl::Participant::Remove | ( | Thing * | thing | ) |
Remove a thing for this participant.
thing | The thing to remove |
|
virtual |
Update all things for this participant.
currentTimeMs | The current time in milliseconds (optional) |
Reimplemented in RoboidControl::ParticipantUDP.