Class Query
Defined in File Query.hpp
Nested Relationships
Nested Types
Class Documentation
-
class Query
A class to define a query into a schedule database.
Public Types
-
template<typename E, typename I, typename F>
using base_iterator = rmf_traffic::detail::bidirectional_iterator<E, I, F>
Public Functions
-
const Spacetime &spacetime() const
const-qualified spacetime()
-
Participants &participants()
Get the Participants component of this Query.
-
const Participants &participants() const
const-qualified participants()
-
class Participants
A class to describe a filter on which schedule participants to pay attention to.
Public Types
Public Functions
-
Mode get_mode() const
Get the mode for this Participants filter.
-
All *all()
Get the All interface if this Participants filter is in All mode, otherwise get a nullptr.
-
Include *include()
Get the Include interface if this Participants filter is in Include mode, otherwise get a nullptr.
-
Participants &include(std::vector<ParticipantId> ids)
Change this filter to Include mode, and include the specified participant IDs.
-
Exclude *exclude()
Get the Exclude interface if this Participants filter is in Exclude mode, otherwise get a nullptr.
-
Participants &exclude(std::vector<ParticipantId> ids)
Change this filter to Exclude mode, and exclude the specified participant IDs.
Public Static Functions
-
static const Participants &make_all()
Constructor to use All mode.
-
static Participants make_only(std::vector<ParticipantId> ids)
Constructor to use Include mode.
- Parameters:
ids – [in] The IDs of the participants that should be included in the query.
-
static Participants make_all_except(std::vector<ParticipantId> ids)
Constructor to use Exclude mode.
- Parameters:
ids – [in] The IDs of the participants that should be excluded from the query.
-
class Exclude
The interface for the Participants::Exclude mode.
Public Functions
-
Exclude(std::vector<ParticipantId> ids)
Constructor.
-
const std::vector<ParticipantId> &get_ids() const
Get the IDs of the participants that should be excluded.
-
Exclude &set_ids(std::vector<ParticipantId> ids)
Set the IDs of the participants that should be excluded.
-
Exclude(std::vector<ParticipantId> ids)
-
class Include
The interface for the Participants::Include mode.
Public Functions
-
Include(std::vector<ParticipantId> ids)
Constructor.
-
const std::vector<ParticipantId> &get_ids() const
Get the IDs of the participants that should be included.
-
Include &set_ids(std::vector<ParticipantId> ids)
Set the IDs of the participants that should be included.
-
Include(std::vector<ParticipantId> ids)
-
Mode get_mode() const
-
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.
-
enumerator Invalid
Public Functions
-
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
-
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.
-
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 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
-
const_iterator begin() const
const-qualified begin()
-
const_iterator cbegin() const
Explicitly const-qualified alternative to begin()
-
const_iterator end() const
const-qualified end()
-
const_iterator cend() const
Explicitly const-qualified alternative to end()
-
using iterator = base_iterator<Region, IterImpl, Regions>
-
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.
-
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.
-
const std::unordered_set<std::string> &maps() const
-
enum class Mode : uint16_t
-
template<typename E, typename I, typename F>