Class DatabaseRectificationRequesterFactory

Inheritance Relationships

Base Type

Class Documentation

class DatabaseRectificationRequesterFactory : public rmf_traffic::schedule::RectificationRequesterFactory

This class provides a simple implementation of a RectificationRequesterFactory that just hooks directly into a Database instance and issues rectification requests when told to based on the current inconsistencies in the Database.

Public Functions

DatabaseRectificationRequesterFactory(std::shared_ptr<Database> database)

This accepts a const-reference to a Database instance. Note that this class will store a reference to this Database, so its lifecycle is implicitly dependent on the Database’s lifecycle.

virtual std::unique_ptr<RectificationRequester> make(Rectifier rectifier, ParticipantId participant_id) final

Create a RectificationRequester to be held by a Participant

Parameters:
  • rectifier[in] This rectifier can be used by the RectificationRequester to ask the participant to retransmit some of its changes.

  • participant_id[in] The ID of the participant that will hold onto this RectificationRequester. This is the same participant that the rectifier will request retransmissions to.

void rectify()

Call this function to instruct all the RectificationRequestors produced by this factory to perform their rectifications.

void change_database(std::shared_ptr<Database> new_database)

Change the database that will be getting rectified. This can be used to switch to rectifying a new database fork.