Drake
SimpleRulebook Class Reference

SimpleRulebook is a simple concrete implementation of the api::rules::RoadRulebook abstract interface. More...

#include <drake/automotive/maliput/simplerulebook/simple_rulebook.h>

Public Member Functions

 SimpleRulebook ()
 Constructs an empty SimpleRulebook (i.e., containing no rules). More...
 
 ~SimpleRulebook () override
 
void RemoveAll ()
 Removes all rules. More...
 
void AddRule (const api::rules::RightOfWayRule &rule)
 Adds a new RightOfWayRule. More...
 
void RemoveRule (const api::rules::RightOfWayRule::Id &id)
 Removes the RightOfWayRule labelled by id. More...
 
void AddRule (const api::rules::SpeedLimitRule &rule)
 Adds a new SpeedLimitRule. More...
 
void RemoveRule (const api::rules::SpeedLimitRule::Id &id)
 Removes the SpeedLimitRule labelled by id. More...
 
template<class T >
void AddAnyRule (const T &rule, IdIndex< T > *map)
 
template<class T >
GetAnyRule (const typename T::Id &id, const IdIndex< T > &map) const
 
template<class T >
void RemoveAnyRule (const typename T::Id &id, IdIndex< T > *map)
 
Does not allow copy, move, or assignment
 SimpleRulebook (const SimpleRulebook &)=delete
 
SimpleRulebookoperator= (const SimpleRulebook &)=delete
 
 SimpleRulebook (SimpleRulebook &&)=delete
 
SimpleRulebookoperator= (SimpleRulebook &&)=delete
 
- Public Member Functions inherited from RoadRulebook
virtual ~RoadRulebook ()=default
 
QueryResults FindRules (const std::vector< LaneSRange > &ranges, double tolerance) const
 Returns a QueryResults structure which contains any rules which are applicable to the provided ranges. More...
 
RightOfWayRule GetRule (const RightOfWayRule::Id &id) const
 Returns the RightOfWayRule with the specified id. More...
 
SpeedLimitRule GetRule (const SpeedLimitRule::Id &id) const
 Returns the SpeedLimitRule with the specified id. More...
 
 RoadRulebook (const RoadRulebook &)=delete
 
RoadRulebookoperator= (const RoadRulebook &)=delete
 
 RoadRulebook (RoadRulebook &&)=delete
 
RoadRulebookoperator= (RoadRulebook &&)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from RoadRulebook
 RoadRulebook ()=default
 

Detailed Description

SimpleRulebook is a simple concrete implementation of the api::rules::RoadRulebook abstract interface.

Constructor & Destructor Documentation

◆ SimpleRulebook() [1/3]

SimpleRulebook ( const SimpleRulebook )
delete

◆ SimpleRulebook() [2/3]

SimpleRulebook ( SimpleRulebook &&  )
delete

◆ SimpleRulebook() [3/3]

Constructs an empty SimpleRulebook (i.e., containing no rules).

◆ ~SimpleRulebook()

~SimpleRulebook ( )
overridedefault

Member Function Documentation

◆ AddAnyRule()

void AddAnyRule ( const T &  rule,
IdIndex< T > *  map 
)

◆ AddRule() [1/2]

void AddRule ( const api::rules::RightOfWayRule rule)

Adds a new RightOfWayRule.

Exceptions
std::runtime_errorif a rule with the same ID already exists in the SimpleRulebook.

◆ AddRule() [2/2]

void AddRule ( const api::rules::SpeedLimitRule rule)

Adds a new SpeedLimitRule.

Exceptions
std::runtime_errorif a rule with the same ID already exists in the SimpleRulebook.

◆ GetAnyRule()

T GetAnyRule ( const typename T::Id &  id,
const IdIndex< T > &  map 
) const

◆ operator=() [1/2]

SimpleRulebook& operator= ( SimpleRulebook &&  )
delete

◆ operator=() [2/2]

SimpleRulebook& operator= ( const SimpleRulebook )
delete

◆ RemoveAll()

void RemoveAll ( )

Removes all rules.

◆ RemoveAnyRule()

void RemoveAnyRule ( const typename T::Id &  id,
IdIndex< T > *  map 
)

◆ RemoveRule() [1/2]

void RemoveRule ( const api::rules::RightOfWayRule::Id id)

Removes the RightOfWayRule labelled by id.

Exceptions
std::runtime_errorif no such rule exists.

◆ RemoveRule() [2/2]

void RemoveRule ( const api::rules::SpeedLimitRule::Id id)

Removes the SpeedLimitRule labelled by id.

Exceptions
std::runtime_errorif no such rule exists.

The documentation for this class was generated from the following files: