Class ParticipantRegistry

Class Documentation

class ParticipantRegistry

Adds a persistance layer to the participant ids. This allows the scheduler to restart without the need to restart fleet adapters. Internally, this class implements a an append only journal. This makes it independent of any id generation inside the database, as long as the said database id generation algorithm is deterministic.

Public Types

using Registration = rmf_traffic::schedule::Writer::Registration

Public Functions

ParticipantRegistry(std::unique_ptr<AbstractParticipantLogger> logger, std::shared_ptr<Database> database)

Constructor

Parameters:
  • logger[in] The logging implementation to use for recording registration.

  • database[in] The database that will register the participants.

Registration add_or_retrieve_participant(ParticipantDescription description)

Adds a participant or retrieves its ID if it was already added in the past

Parameters:

description[in] The description of the participant that one wishes to register.

Returns:

ParticipantId of the participant