Class Writer¶
Defined in File Writer.hpp
Nested Relationships¶
Nested Types¶
Inheritance Relationships¶
Derived Type¶
public rmf_traffic::schedule::Database
(Class Database)
Class Documentation¶
-
class
rmf_traffic::schedule
::
Writer
¶ A pure abstract interface class that defines an API for writing to the schedule database. This API is implemented by the Database class, but it should also be implemented for any middleware that intends to have a schedule participant write changes to a remote database.
Subclassed by rmf_traffic::schedule::Database
Public Types
-
using
ParticipantId
= rmf_traffic::schedule::ParticipantId¶
-
using
ParticipantDescription
= rmf_traffic::schedule::ParticipantDescription¶
-
using
ItineraryVersion
= rmf_traffic::schedule::ItineraryVersion¶
-
using
ProgressVersion
= rmf_traffic::schedule::ProgressVersion¶
-
using
CheckpointId
= rmf_traffic::CheckpointId¶
-
using
StorageId
= uint64_t¶
Public Functions
-
virtual void
set
(ParticipantId participant, PlanId plan, const Itinerary &itinerary, StorageId storage_base, ItineraryVersion version) = 0¶ Set a brand new itinerary for a participant. This will replace any itinerary that is already in the schedule for the participant.
- Parameters
[in] participant
: The ID of the participant whose itinerary is being updated.[in] plan
: The ID of the plan that this new itinerary belongs to.[in] itinerary
: The new itinerary of the participant.[in] storage_base
: The storage index offset that the database should use for this plan. This should generally be the integer number of total routes that the participant has ever given to the writer prior to setting this new itinerary. This value helps ensure consistent unique IDs for every route, even after a database has failed over or restarted.[in] version
: The version for this itinerary change.
-
virtual void
extend
(ParticipantId participant, const Itinerary &routes, ItineraryVersion version) = 0¶ Add a set of routes to the itinerary of this participant.
- Parameters
[in] participant
: The ID of the participant whose itinerary is being updated.[in] routes
: The set of routes that should be added to the itinerary.[in] version
: The version for this itinerary change
-
virtual void
delay
(ParticipantId participant, Duration delay, ItineraryVersion version) = 0¶ Add a delay to the itinerary from the specified Time.
Nothing about the routes in the itinerary will be changed except that waypoints will shifted through time.
- Parameters
[in] participant
: The ID of the participant whose itinerary is being delayed.[in] delay
: This is the duration of time to delay all qualifying Trajectory Waypoints.[in] version
: The version for this itinerary change
-
virtual void
reached
(ParticipantId participant, PlanId plan, const std::vector<CheckpointId> &reached_checkpoints, ProgressVersion version) = 0¶ Indicate that a participant has reached certain checkpoints.
- Parameters
[in] participant
: The ID of the participant whose progress is being set.[in] plan
: The ID of the plan which progress has been made for.[in] reached_checkpoints
: The set of checkpoints that have been reached. The indices in the vector must correspond to the RouteIds of the plan.[in] version
: The version number for this progress.
-
virtual void
clear
(ParticipantId participant, ItineraryVersion version) = 0¶ Erase an itinerary from this database.
- Parameters
[in] participant
: The ID of the participant whose itinerary is being erased.[in] version
: The version for this itinerary change
-
virtual Registration
register_participant
(ParticipantDescription participant_info) = 0¶ Register a new participant.
- Return
result of registering the new participant.
- Parameters
[in] participant_info
: Information about the new participant.[in] time
: The time at which the registration is being requested.
-
virtual void
unregister_participant
(ParticipantId participant) = 0¶ Unregister an existing participant.
- Return
the new version of the schedule.
- Parameters
[in] participant
: The ID of the participant to unregister.
-
virtual void
update_description
(ParticipantId participant, ParticipantDescription desc) = 0¶ Updates a participants footprint
- Parameters
[in] participant
: The ID of the participant to update[in] desc
: The participant description
-
virtual
~Writer
() = default¶
-
class
Registration
¶ Information resulting from registering a participant.
Public Functions
-
Registration
(ParticipantId id, ItineraryVersion version, PlanId plan_id, StorageId storage_base)¶ Constructor
- Parameters
[in] id
: The ID for the registered participant[in] version
: The last itinerary version for the registered participant[in] plan_id
: The last plan_id for the registered participant[in] storage_base
: The next storage base that the registered participant should use
-
ParticipantId
id
() const¶ The ID of the registered participant.
-
ItineraryVersion
last_itinerary_version
() const¶ The last itinerary version of the registered participant. New Participants will begin by adding up from this version when issuing schedule updates.
This value might vary for systems that enforce participant uniqueness. If this participant was registered in the past and is now being re-registered, then the version number will pick up where it previously left off.
-
-
using