Class Rectifier

Nested Relationships

Nested Types

Class Documentation

class Rectifier

The Rectifier class provides an interface for telling a Participant to rectify an inconsistency in the information received by a database. This rectification protocol is important when the schedule is being managed over an unreliable network.

The Rectifier class can be used by a RectifierRequester to ask a participant to retransmit a range of its past itinerary changes.

Only the Participant class is able to create a Rectifier instance. Users of rmf_traffic cannot instantiate a Rectifier.

Public Functions

void retransmit(const std::vector<Range> &ranges, ItineraryVersion last_known_itinerary, ProgressVersion last_known_progress)

Ask the participant to retransmit the specified range of its itinerary changes.

Parameters:
  • ranges[in] The ranges of missing Itinerary IDs

  • last_known_itinerary[in] The last ItineraryVersion known upstream.

  • last_known_progress[in] The last ProgressVersion known upstream.

void correct_id(ParticipantId new_id)

Correct the ID of the participant.

std::optional<ItineraryVersion> current_version() const

Get the current ItineraryVersion of the Participant.

std::optional<ParticipantId> get_id() const

Get the ID of the Participant.

std::optional<ParticipantDescription> get_description() const

Get the description of the Participant.

struct Range

A range of itinerary change IDs that is currently missing from a database. All IDs from lower to upper are missing, including lower and upper themselves.

It is undefined behavior if the value given to upper is less than the value given to upper.

Public Members

ItineraryVersion lower

The ID of the first itinerary change in this range that is missing.

ItineraryVersion upper

The ID of the last itinerary change in this range that is missing.