Class Query::Spacetime

Nested Relationships

This class is a nested type of Class Query.

Nested Types

Class Documentation

class Spacetime

A class to describe spacetime filters for a schedule Query.

Public Types

enum class Mode : uint16_t

This enumerator determines what Spacetime mode the query will be in.

Values:

enumerator Invalid

Invalid mode, behavior is undefined.

enumerator All

Request trajectories throughout all of space and time. This will still be constrained by the version field.

enumerator Regions

Request trajectories in specific regions spacetime regions.

enumerator Timespan

Request trajectories that are active in a specified timespan.

using Space = geometry::Space

Public Functions

Spacetime()

Default constructor, uses All mode.

Spacetime(std::vector<Region> regions)

Regions mode constructor.

Parameters:

regions[in] The regions to use

Spacetime(std::vector<std::string> maps)

Timespan mode constructor.

This will query all trajectories across all time for the specified maps.

Parameters:

maps[in] The maps to query from

Spacetime(std::vector<std::string> maps, Time lower_bound)

Timespan mode constructor.

This will query all trajectories that have at least one waypoint active after the lower bound on the specified maps.

Parameters:
  • maps[in] The maps to query from

  • lower_bound[in] The lower bound on time

Spacetime(std::vector<std::string> maps, Time lower_bound, Time upper_bound)

Timespan mode constructor.

This will query all trajectories that have at least one waypoint active after the lower bound and before the upper bound on the specified maps.

Parameters:
  • maps[in] The maps to query from

  • lower_bound[in] The lower bound on time

  • upper_bound[in] The upper bound on time

Mode get_mode() const

Get the current Spacetime Mode of this query.

All &query_all()

Set the mode of this Spacetime to query for All Trajectories throughout Spacetime.

Regions &query_regions(std::vector<Region> regions = {})

Set the mode of this Spacetime to query for specific Regions.

Parameters:

regions[in] Specify the regions of Spacetime to use.

Regions *regions()

Get the Regions of Spacetime to use for this Query. If this Spacetime is not in Regions mode, then this will return a nullptr.

const Regions *regions() const

const-qualified regions()

Timespan &query_timespan(std::vector<std::string> maps, Time lower_bound, Time upper_bound)

Query a timespan between two bounds for a set of maps.

Timespan &query_timespan(std::vector<std::string> maps, Time lower_bound)

Query from a lower bound in time for a set of maps.

Timespan &query_timespan(std::vector<std::string> maps)

Query for all trajectories on a set of maps.

Timespan &query_timespan(bool query_all_maps = true)

Switch to timespan mode, and specify whether or not to use all maps.

Timespan *timespan()

Get the Timespan of Spacetime to use for this Query. If this Spacetime is not in Timespan mode, then this will return a nullptr.

const Timespan *timespan() const

const-qualified timespan()

class All

This is a placeholder class in case we ever want to extend the features of the All mode.

class Regions

A container class for rmf_traffic::Region instances. Using Regions mode will query for Trajectories that intersect the specified regions.

Public Types

using iterator = base_iterator<Region, IterImpl, Regions>
using const_iterator = base_iterator<const Region, IterImpl, Regions>

Public Functions

void push_back(Region region)

Add a Region to this container.

void pop_back()

Remove the last Region that was added to this container.

iterator erase(iterator it)

Erase a Region based on its iterator.

iterator erase(iterator first, iterator last)

Erase a range of Regions based on their iterators.

iterator begin()

Get the beginning iterator of this container.

const_iterator begin() const

const-qualified begin()

const_iterator cbegin() const

Explicitly const-qualified alternative to begin()

iterator end()

Get the one-past-the-end iterator of this container.

const_iterator end() const

const-qualified end()

const_iterator cend() const

Explicitly const-qualified alternative to end()

std::size_t size() const

Get the number of Spacetime Region elements in this container.

class Timespan

A class for specifying a timespan.

Public Functions

const std::unordered_set<std::string> &maps() const

Get the maps that will be queried.

Timespan &add_map(std::string map_name)

Add a map to the query.

Timespan &remove_map(const std::string &map_name)

Remove a map from the query.

Timespan &clear_maps()

Remove all maps from the query.

bool all_maps() const

Returns true if all maps should be queried. If true, the set of maps mentioned above will be ignored.

Timespan &all_maps(bool query_all_maps)

Set whether all maps should be queried. When true, the set of maps above will be ignored. When false, only the maps in the set above will be included in the query.

const Time *get_lower_time_bound() const

Get the lower bound for the time range.

If there is no lower bound for the time range, then this returns a nullptr.

Timespan &set_lower_time_bound(Time time)

Set the lower bound fore the time range.

Timespan &remove_lower_time_bound()

Remove the lower bound for the time range.

const Time *get_upper_time_bound() const

Get the upper bound for the time range.

If there is no upper bound for the time range, then this returns a nullptr.

Timespan &set_upper_time_bound(Time time)

Set the upper bound for the time range.

Timespan &remove_upper_time_bound()

Remove the upper bound for the time range.