Roboid Control for Python
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Participant Class Reference

Detailed Description

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.

Inheritance diagram for Participant:
LocalParticipant SiteServer

Public Member Functions

 __init__ (self, ip_address, port)
 Create a new participant with the given communcation info.
 
 Add (self, thing, check_id=True)
 Add a new thing for this participant.
 
 Get (self, network_id, thing_id)
 Find a thing managed by this participant.
 
 Remove (self, thing)
 Remove a thig for this participant.
 
 Update (self, currentTimeMs)
 Update all things.
 

Public Attributes

 ip_address
 The Ip Address of a participant.
 
 port
 The port number for UDP communication with the participant.
 
 networkId
 The network Id to identify the participant.
 
 things
 The things managed by this participant.
 

Constructor & Destructor Documentation

◆ __init__()

__init__ (   self,
  ip_address,
  port 
)

Create a new participant with the given communcation info.

Reimplemented in LocalParticipant, and SiteServer.

Member Function Documentation

◆ Add()

Add (   self,
  thing,
  check_id = True 
)

Add a new thing for this participant.

Parameters
thingThe thing to add
check_idWhen true, the thing ID of the thing is checked. If it is 0, a new thing Id will be assigned.

◆ Get()

Get (   self,
  network_id,
  thing_id 
)

Find a thing managed by this participant.

Parameters
network_idThe network ID for the thing
thing_idThe ID of the thing
Returns
The thing if found or nullptr when no thing has been found
Note
The use of the network ID is likely to disappear in future versions.

◆ Remove()

Remove (   self,
  thing 
)

Remove a thig for this participant.

Parameters
thingThe thing to remove

◆ Update()

Update (   self,
  currentTimeMs 
)

Update all things.

Reimplemented in LocalParticipant.

Member Data Documentation

◆ ip_address

ip_address

The Ip Address of a participant.

When the participant is local, this contains 0.0.0.0

◆ port

port

The port number for UDP communication with the participant.

This is 0 for isolated participants.

◆ networkId

networkId

The network Id to identify the participant.

Note
This field is likely to disappear in future versions

The documentation for this class was generated from the following file: