bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
distributed_robot_navigation::Transport Class Referenceabstract

How the participants of a distributed simulation reach each other: everything one publishes, every other receives. More...

#include <transport.h>

Inheritance diagram for distributed_robot_navigation::Transport:
Collaboration diagram for distributed_robot_navigation::Transport:

Public Member Functions

virtual ~Transport ()=default
virtual void publish (const std::string &bytes)=0
 Send bytes to every other participant.
virtual std::optional< std::string > receive (std::chrono::milliseconds timeout)=0
 The next message from another participant, waiting at most timeout.

Detailed Description

How the participants of a distributed simulation reach each other: everything one publishes, every other receives.

The messages are bytes; the synchroniser sends StateMessage::encode(). A transport may lose messages, MQTT does when nobody listens yet, and it may give a participant its own messages back, MQTT does that too; Synchroniser copes with both. Implementations: InProcessBus, for participants that are threads of one process, MQTT_Transport, for processes on one or several machines, and LossyTransport, which adds delay and losses to another transport for testing.

Constructor & Destructor Documentation

◆ ~Transport()

virtual bitsim::distributed::Transport::~Transport ( )
virtualdefault

Member Function Documentation

◆ publish()

virtual void bitsim::distributed::Transport::publish ( const std::string & bytes)
pure virtual

Send bytes to every other participant.

◆ receive()

virtual std::optional< std::string > bitsim::distributed::Transport::receive ( std::chrono::milliseconds timeout)
pure virtual

The next message from another participant, waiting at most timeout.


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