Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
lanelet::RightOfWay Class Reference

Defines right of way restrictions. More...

#include <BasicRegulatoryElements.h>

Inheritance diagram for lanelet::RightOfWay:
Inheritance graph
[legend]

Public Types

using Ptr = std::shared_ptr< RightOfWay >
 
- Public Types inherited from lanelet::RegulatoryElement
using Category = traits::RegulatoryElementTag
 
using const_iterator = RuleParameterMap::const_iterator
 
using ConstType = RegulatoryElement
 
using iterator = RuleParameterMap::iterator
 
using MutableType = GenericRegulatoryElement
 
using ThreeDType = RegulatoryElement
 
using TwoDType = RegulatoryElement
 
- Public Types inherited from lanelet::ConstPrimitive< RegulatoryElementData >
using DataType = RegulatoryElementData
 

Public Member Functions

void addRightOfWayLanelet (const Lanelet &lanelet)
 Adds a lanelet for RightOfWay. More...
 
void addYieldLanelet (const Lanelet &lanelet)
 Add yielding lanelet. More...
 
ManeuverType getManeuver (const ConstLanelet &lanelet) const
 returns whether a lanelet has to yield or has right of way More...
 
bool removeRightOfWayLanelet (const Lanelet &lanelet)
 Removes a right of way lanelet and returns true on success. More...
 
void removeStopLine ()
 Removes the stop line. More...
 
bool removeYieldLanelet (const Lanelet &lanelet)
 Removes a yielding lanelet and returns true no success. More...
 
Lanelets rightOfWayLanelets ()
 
ConstLanelets rightOfWayLanelets () const
 get the lanelets have right of way More...
 
void setStopLine (const LineString3d &stopLine)
 Overwrites the stop line. More...
 
Optional< LineString3dstopLine ()
 
Optional< ConstLineString3dstopLine () const
 get the stop line for the yield lanelets, if present More...
 
Lanelets yieldLanelets ()
 
ConstLanelets yieldLanelets () const
 get the lanelets that have to yield More...
 
- Public Member Functions inherited from lanelet::RegulatoryElement
void applyVisitor (RuleParameterVisitor &visitor) const
 applies a visitor to every parameter in the regulatory element More...
 
bool empty () const
 returns true if this object contains no parameters More...
 
template<typename T >
Optional< T > find (Id id) const
 Finds a parameter by its id, independent of the role. More...
 
template<>
Optional< ConstRuleParameterfind (Id id) const
 
template<>
boost::optional< ConstLaneletfind (Id id) const
 
template<>
boost::optional< ConstAreafind (Id id) const
 
ConstRuleParameterMap getParameters () const
 Returns all parameters as const object (coversion overhead for const) More...
 
template<typename T >
std::vector< T > getParameters (const std::string &role) const
 Returns a vector of all RuleParameters that could be converted to T. More...
 
template<>
std::vector< ConstLaneletgetParameters (const std::string &role) const
 
template<typename T >
std::vector< T > getParameters (RoleName role) const
 
template<>
std::vector< ConstLaneletgetParameters (RoleName role) const
 
std::vector< std::string > roles () const
 returns all the roles this regulatory element has More...
 
void setId (Id id) noexcept
 
size_t size () const
 get the number of roles in this regulatoryElement More...
 
virtual ~RegulatoryElement ()
 
- Public Member Functions inherited from lanelet::ConstPrimitive< RegulatoryElementData >
const Attributeattribute (AttributeName name) const
 retrieve an attribute (enum version) More...
 
const Attributeattribute (const std::string &name) const
 retrieve an attribute More...
 
attributeOr (AttributeName name, T defaultVal) const
 retrieve an attribute (enum version) More...
 
attributeOr (const std::string &name, T defaultVal) const noexcept
 retrieve an attribute (string version) More...
 
const AttributeMapattributes () const
 get the attributes of this primitive More...
 
const std::shared_ptr< const RegulatoryElementData > & constData () const
 get the internal data of this primitive More...
 
 ConstPrimitive (const std::shared_ptr< const RegulatoryElementData > &data)
 Construct from a pointer to the data. More...
 
bool hasAttribute (AttributeName name) const noexcept
 check for an attribute (enum version) More...
 
bool hasAttribute (const std::string &name) const noexcept
 check whether this primitive has a specific attribute More...
 
Id id () const noexcept
 get the unique id of this primitive More...
 
bool operator!= (const ConstPrimitive &rhs) const
 
bool operator== (const ConstPrimitive &rhs) const
 

Static Public Member Functions

static Ptr make (Id id, const AttributeMap &attributes, const Lanelets &rightOfWay, const Lanelets &yield, const Optional< LineString3d > &stopLine={})
 Create a valid Right of Way object. More...
 

Static Public Attributes

static constexpr char RuleName [] = "right_of_way"
 
- Static Public Attributes inherited from lanelet::RegulatoryElement
static constexpr char RuleName [] = "basic_regulatory_element"
 
- Static Public Attributes inherited from lanelet::ConstPrimitive< RegulatoryElementData >
static constexpr bool IsConst
 

Protected Member Functions

 RightOfWay (const RegulatoryElementDataPtr &data)
 
 RightOfWay (Id id, const AttributeMap &attributes, const Lanelets &rightOfWay, const Lanelets &yield, const Optional< LineString3d > &stopLine={})
 
- Protected Member Functions inherited from lanelet::RegulatoryElement
void applyVisitor (internal::MutableParameterVisitor &visitor) const
 
const_iterator begin () const
 
RegulatoryElementDataPtr data ()
 
const_iterator end () const
 
template<typename T >
std::vector< T > getParameters (RoleName role)
 
RuleParameterMapparameters ()
 
const RuleParameterMapparameters () const
 
 RegulatoryElement (const RegulatoryElementDataPtr &data)
 
 RegulatoryElement (Id id=InvalId, const RuleParameterMap &members=RuleParameterMap(), const AttributeMap &attributes=AttributeMap())
 
- Protected Member Functions inherited from lanelet::ConstPrimitive< RegulatoryElementData >
 ConstPrimitive (const ConstPrimitive &rhs)=default
 
 ConstPrimitive (ConstPrimitive &&rhs) noexcept=default
 
ConstPrimitiveoperator= (const ConstPrimitive &rhs)=default
 
ConstPrimitiveoperator= (ConstPrimitive &&rhs) noexcept=default
 
 ~ConstPrimitive () noexcept=default
 

Friends

class RegisterRegulatoryElement< RightOfWay >
 

Detailed Description

Defines right of way restrictions.

Definition at line 87 of file BasicRegulatoryElements.h.

Member Typedef Documentation

◆ Ptr

using lanelet::RightOfWay::Ptr = std::shared_ptr<RightOfWay>

Definition at line 89 of file BasicRegulatoryElements.h.

Constructor & Destructor Documentation

◆ RightOfWay() [1/2]

lanelet::RightOfWay::RightOfWay ( Id  id,
const AttributeMap attributes,
const Lanelets rightOfWay,
const Lanelets yield,
const Optional< LineString3d > &  stopLine = {} 
)
protected

Definition at line 214 of file BasicRegulatoryElements.cpp.

◆ RightOfWay() [2/2]

lanelet::RightOfWay::RightOfWay ( const RegulatoryElementDataPtr data)
explicitprotected

Definition at line 205 of file BasicRegulatoryElements.cpp.

Member Function Documentation

◆ addRightOfWayLanelet()

void lanelet::RightOfWay::addRightOfWayLanelet ( const Lanelet lanelet)

Adds a lanelet for RightOfWay.

Definition at line 254 of file BasicRegulatoryElements.cpp.

◆ addYieldLanelet()

void lanelet::RightOfWay::addYieldLanelet ( const Lanelet lanelet)

Add yielding lanelet.

Definition at line 258 of file BasicRegulatoryElements.cpp.

◆ getManeuver()

ManeuverType lanelet::RightOfWay::getManeuver ( const ConstLanelet lanelet) const

returns whether a lanelet has to yield or has right of way

Definition at line 218 of file BasicRegulatoryElements.cpp.

◆ make()

static Ptr lanelet::RightOfWay::make ( Id  id,
const AttributeMap attributes,
const Lanelets rightOfWay,
const Lanelets yield,
const Optional< LineString3d > &  stopLine = {} 
)
inlinestatic

Create a valid Right of Way object.

Parameters
idid for this rule
attributesfor this rule. Might be extended if necessary
rightOfWaythe lanelets that have right of way
yieldthe lanelets that have to yield
stopLineline where to stop. If there is none, stop at the end of the lanelet.

Definition at line 101 of file BasicRegulatoryElements.h.

◆ removeRightOfWayLanelet()

bool lanelet::RightOfWay::removeRightOfWayLanelet ( const Lanelet lanelet)

Removes a right of way lanelet and returns true on success.

Definition at line 260 of file BasicRegulatoryElements.cpp.

◆ removeStopLine()

void lanelet::RightOfWay::removeStopLine ( )

Removes the stop line.

Definition at line 268 of file BasicRegulatoryElements.cpp.

◆ removeYieldLanelet()

bool lanelet::RightOfWay::removeYieldLanelet ( const Lanelet lanelet)

Removes a yielding lanelet and returns true no success.

Definition at line 264 of file BasicRegulatoryElements.cpp.

◆ rightOfWayLanelets() [1/2]

Lanelets lanelet::RightOfWay::rightOfWayLanelets ( )

◆ rightOfWayLanelets() [2/2]

Lanelets lanelet::RightOfWay::rightOfWayLanelets ( ) const

get the lanelets have right of way

Definition at line 228 of file BasicRegulatoryElements.cpp.

◆ setStopLine()

void lanelet::RightOfWay::setStopLine ( const LineString3d stopLine)

Overwrites the stop line.

Definition at line 252 of file BasicRegulatoryElements.cpp.

◆ stopLine() [1/2]

Optional<LineString3d> lanelet::RightOfWay::stopLine ( )

◆ stopLine() [2/2]

Optional< LineString3d > lanelet::RightOfWay::stopLine ( ) const

get the stop line for the yield lanelets, if present

Definition at line 236 of file BasicRegulatoryElements.cpp.

◆ yieldLanelets() [1/2]

Lanelets lanelet::RightOfWay::yieldLanelets ( )

◆ yieldLanelets() [2/2]

Lanelets lanelet::RightOfWay::yieldLanelets ( ) const

get the lanelets that have to yield

Definition at line 232 of file BasicRegulatoryElements.cpp.

Friends And Related Function Documentation

◆ RegisterRegulatoryElement< RightOfWay >

friend class RegisterRegulatoryElement< RightOfWay >
friend

Definition at line 140 of file BasicRegulatoryElements.h.

Member Data Documentation

◆ RuleName

constexpr char lanelet::RightOfWay::RuleName = "right_of_way"
staticconstexpr

Definition at line 90 of file BasicRegulatoryElements.h.


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


lanelet2_core
Author(s): Fabian Poggenhans
autogenerated on Thu Mar 6 2025 03:25:53