Class Viewer

Nested Relationships

Nested Types

Inheritance Relationships

Derived Types

Class Documentation

class Viewer

A pure abstract interface class that allows users to query for itineraries that are in a schedule.

This class cannot be instantiated directly. To get a Viewer, you must instantiate an rmf_traffic::schedule::Database or an rmf_traffic::schedule::Mirror object.

Subclassed by rmf_traffic::schedule::ItineraryViewer, rmf_traffic::schedule::Snapshot

Public Functions

virtual View query(const Query &parameters) const = 0

Query this Viewer to get a View of the Trajectories inside of it that match the Query parameters.

virtual View query(const Query::Spacetime &spacetime, const Query::Participants &participants) const = 0

Alternative signature for query()

virtual const std::unordered_set<ParticipantId> &participant_ids() const = 0

Get the set of active participant IDs.

virtual std::shared_ptr<const ParticipantDescription> get_participant(ParticipantId participant_id) const = 0

Get the information of the specified participant if it is available. If a participant with the specified ID is not registered with the schedule, then this will return a nullptr.

virtual ~Viewer() = default

Get the latest version number of this Database.

class View

A read-only view of some Trajectories in a Database or Mirror.

It is undefined behavior to modify a Database or patch a Mirror while reading Trajectories from this view. The user of this class is responsible for managing access to reads vs access to writes.

Public Types

template<typename E, typename I, typename F>
using base_iterator = rmf_traffic::detail::bidirectional_iterator<E, I, F>
using const_iterator = base_iterator<const Element, IterImpl, View>
using iterator = const_iterator

Public Functions

const_iterator begin() const

Returns an iterator to the first element of the View.

const_iterator end() const

Returns an iterator to the element following the last element of the View.

std::size_t size() const

Returns the number of elements in this View.

struct Element

Public Members

const ParticipantId participant
const PlanId plan_id
const RouteId route_id
const std::shared_ptr<const Route> route
const ParticipantDescription &description