Roboid Control for C#
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Passer.RoboidControl.Participant Class Reference

Detailed Description

A participant is used for communcation between things.

Inheritance diagram for Passer.RoboidControl.Participant:
Passer.RoboidControl.RemoteParticipant Passer.RoboidControl.SiteServer

Public Member Functions

 Participant ()
 Create a porticiapnt.
 
 Participant (int port)
 Create a participant with the give UDP port.
 
 Participant (string ipAddress="0.0.0.0", int port=7681)
 Create a new participant for a site at the given address and port.
 
 Participant (UdpClient udpClient, int port)
 Create a participant using the given udp client.
 
RemoteParticipant GetParticipant (string ipAddress, int port)
 
RemoteParticipant AddParticipant (string ipAddress, int port)
 
delegate Thing ThingConstructor (byte networkId, byte thingId)
 
void Register (byte thingType, ThingConstructor constr)
 
void Register< ThingClass > (Thing.Type thingType)
 
void Register< ThingClass > (byte thingType)
 
virtual void Update (ulong currentTimeMS=0)
 
virtual void Publish ()
 
void SendThingInfo (RemoteParticipant remoteParticipant, Thing thing)
 
bool Send (IMessage msg)
 
bool Send (RemoteParticipant remoteParticipant, IMessage msg)
 
void PublishThingInfo (Thing thing)
 
bool Publish (IMessage msg)
 
bool SendBuffer (int bufferSize)
 
bool PublishBuffer (int bufferSize)
 
void ReceiveData (byte[] data, RemoteParticipant remoteParticipant)
 
Thing Get (byte networkId, byte thingId)
 Get a thing with the given ids.
 
void Add (Thing thing, bool invokeEvent=true)
 Add a new thing for this participant.
 

Public Attributes

byte[] buffer = new byte[1024]
 
ulong publishInterval = 3000
 
string name = "Participant"
 
IPEndPoint endPoint = null
 
UdpClient udpClient = null
 
string broadcastIpAddress = "255.255.255.255"
 
readonly ConcurrentQueue< IMessagemessageQueue = new ConcurrentQueue<IMessage>()
 
List< RemoteParticipantsenders = new List<RemoteParticipant>()
 
string ipAddress = "0.0.0.0"
 The internet address of the participant.
 
int port = 0
 The UDP port on which the participant can be reached.
 
byte networkId
 The network ID of the participant.
 

Protected Member Functions

void ReceiveUDP (IAsyncResult result)
 
virtual void Process (RemoteParticipant sender, ParticipantMsg msg)
 
virtual void Process (RemoteParticipant sender, NetworkIdMsg msg)
 
virtual void Process (InvestigateMsg msg)
 
virtual void Process (RemoteParticipant sender, ThingMsg msg)
 
virtual void Process (RemoteParticipant sender, NameMsg msg)
 
virtual void Process (RemoteParticipant sender, ModelUrlMsg msg)
 
virtual void Process (PoseMsg msg)
 
virtual void Process (RemoteParticipant sender, BinaryMsg msg)
 
virtual void Process (TextMsg temsgxt)
 
virtual void Process (DestroyMsg msg)
 

Protected Attributes

readonly Dictionary< byte, Func< byte, byte, Thing > > thingMsgProcessors = new Dictionary<byte, Func<byte, byte, Thing>>()
 
ulong nextPublishMe = 0
 
readonly List< Thingthings = new List<Thing>()
 The things reported by this participant.
 

Constructor & Destructor Documentation

◆ Participant() [1/3]

Passer.RoboidControl.Participant.Participant ( int  port)

Create a participant with the give UDP port.

Parameters
portThe port number on which to communicate

◆ Participant() [2/3]

Passer.RoboidControl.Participant.Participant ( string  ipAddress = "0.0.0.0",
int  port = 7681 
)

Create a new participant for a site at the given address and port.

Parameters
ipAddressThe ip address of the site server
portThe port number of the site server

◆ Participant() [3/3]

Passer.RoboidControl.Participant.Participant ( UdpClient  udpClient,
int  port 
)

Create a participant using the given udp client.

Parameters
udpClientUDP client to use for communication
portThe port number on which to communicate

Member Function Documentation

◆ Register< ThingClass >() [1/2]

void Passer.RoboidControl.Participant.Register< ThingClass > ( Thing::Type  thingType)
Type Constraints
ThingClass :Thing 

◆ Register< ThingClass >() [2/2]

void Passer.RoboidControl.Participant.Register< ThingClass > ( byte  thingType)
Type Constraints
ThingClass :Thing 

◆ Get()

Thing Passer.RoboidControl.RemoteParticipant.Get ( byte  networkId,
byte  thingId 
)
inherited

Get a thing with the given ids.

Parameters
networkIdThe networkId of the thing
thingIdThe ID of the thing
Returns
The thing when it is found, null in other cases.

◆ Add()

void Passer.RoboidControl.RemoteParticipant.Add ( Thing  thing,
bool  invokeEvent = true 
)
inherited

Add a new thing for this participant.

Parameters
thingThe thing to add
invokeEventInvoke an notification event when the thing has been added