Drake
trivial_right_of_way_state_provider.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <unordered_map>
4 
7 
8 namespace drake {
9 namespace automotive {
10 
11 /// A trivial implementation of an api::rules::RightOfWayStateProvider.
14  public:
16 
17  /// Default constructor.
19 
20  ~TrivialRightOfWayStateProvider() final = default;
21 
22  /// Adds a dynamic state to this provider.
23  ///
24  /// Throws std::logic_error if a RightOfWayRule with an ID of @p id
25  /// already exists in this provider.
26  ///
27  /// Throws std::runtime_error if the dynamic state failed to be added.
28  void AddState(
31 
32  /// Sets the dynamic state of a RightOfWayRule within this provider.
33  ///
34  /// Throws std::out_of_range if no dynamic state with @p id exists in this
35  /// provider.
38 
39  private:
41  DoGetState(
42  const maliput::api::rules::RightOfWayRule::Id& id) const final;
43 
44  std::unordered_map<
47 };
48 
49 } // namespace automotive
50 } // namespace drake
Definition: automotive_demo.cc:90
void AddState(const maliput::api::rules::RightOfWayRule::Id &id, const maliput::api::rules::RightOfWayRule::State::Id &initial_state)
Adds a dynamic state to this provider.
Definition: trivial_right_of_way_state_provider.cc:13
A trivial implementation of an api::rules::RightOfWayStateProvider.
Definition: trivial_right_of_way_state_provider.h:12
stx::optional< T > optional
Definition: drake_optional.h:22
void SetState(const maliput::api::rules::RightOfWayRule::Id &id, const maliput::api::rules::RightOfWayRule::State::Id &state)
Sets the dynamic state of a RightOfWayRule within this provider.
Definition: trivial_right_of_way_state_provider.cc:23
Abstract interface for the provider of the state of a dynamic (multiple state) RightOfWayRule.
Definition: right_of_way_rule.h:174
#define DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(Classname)
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN deletes the special member functions for copy-construction, copy-assignment, move-construction, and move-assignment.
Definition: drake_copyable.h:33
Provides careful macros to selectively enable or disable the special member functions for copy-constr...
TypeSpecificIdentifier< class RightOfWayRule > Id
Unique identifier for a RightOfWayRule.
Definition: right_of_way_rule.h:45