![]() |
Roboid Control for Python
|
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.
Public Member Functions | |
None | __init__ (self, str ip_address, int port) |
Create a new participant with the given communcation info. | |
Optional[Thing] | Get (self, int thing_id) |
Get the thing with the given properties. | |
Add (self, Thing thing, bool check_id=True) | |
Add a new thing for this participant. | |
None | Remove (self, Thing thing) |
Remove a thing for this participant. | |
None | Update (self, int currentTimeMs=0) |
Update all things for this participant. | |
'Participant' | AddParticipant (Union[str, 'Participant'] arg1, Optional[int] port=None) |
Add a participant. | |
Static Public Member Functions | |
Optional[ 'Participant'] | GetParticipant (Union[str, int] arg1, Optional[int] port=None) |
Retrieve a participant. | |
Public Attributes | |
things | |
Static Public Attributes | |
set | participants = set() |
None __init__ | ( | self, | |
str | ip_address, | ||
int | port | ||
) |
Create a new participant with the given communcation info.
ip_address | The IP address of the participant |
port | The UDP port of the participant |
Reimplemented in ParticipantUDP.
Optional[Thing] Get | ( | self, | |
int | thing_id | ||
) |
Get the thing with the given properties.
thing_id | The ID of the thing |
Add | ( | self, | |
Thing | thing, | ||
bool | check_id = True |
||
) |
Add a new thing for this participant.
thing | The thing to add |
check_id | If true, the thing.id is regenerated if it is zero |
None Remove | ( | self, | |
Thing | thing | ||
) |
Remove a thing for this participant.
thing | The thing to remove |
None Update | ( | self, | |
int | currentTimeMs = 0 |
||
) |
Update all things for this participant.
The | current time in milliseconds (optional) |
Reimplemented in ParticipantUDP.
|
static |
Retrieve a participant.
arg1 | Either:
|
port | The port number of the participant |
'Participant' AddParticipant | ( | Union[str, 'Participant'] | arg1, |
Optional[int] | port = None |
||
) |
Add a participant.
arg1 | Either:
|
port | The port number of the participant |