maliput_malidrive
RoadLink Struct Reference

Detailed Description

Holds the road link description of a XODR road.

For example:

<OpenDRIVE>
...
<link>
<predecessor elementType="road" elementId="80" contactPoint="end"/>
<successor elementType="road" elementId="10" contactPoint="start"/>
</link>
...
</OpenDRIVE>

#include <src/maliput_malidrive/xodr/road_link.h>

Classes

struct  LinkAttributes
 Contains the information about the predecessor/successor road. More...
 

Public Types

enum  ContactPoint { kStart = 0, kEnd }
 Enum the contact points. More...
 
enum  ElementType { kRoad = 0, kJunction }
 Enum the types of the link's element. More...
 

Public Member Functions

bool operator== (const RoadLink &other) const
 Equality operator. More...
 
bool operator!= (const RoadLink &other) const
 Inequality operator. More...
 

Static Public Member Functions

static ElementType str_to_element_type (const std::string &type)
 Matches ElementType with a string. More...
 
static std::string element_type_to_str (ElementType type)
 Matches string with a ElementType. More...
 
static ContactPoint str_to_contact_point (const std::string &contact_point)
 Matches ContactPoint with a string. More...
 
static std::string contact_point_to_str (ContactPoint contact_point)
 Matches string with a ContactPoint. More...
 

Public Attributes

std::optional< LinkAttributespredecessor {std::nullopt}
 Road's predecessor. More...
 
std::optional< LinkAttributessuccessor {std::nullopt}
 Road's successor. More...
 

Static Public Attributes

static constexpr const char * kRoadLinkTag = "link"
 Convenient constants that hold the tag names in the XODR road header description. More...
 
static constexpr const char * kPredecessorTag = "predecessor"
 
static constexpr const char * kSuccessorTag = "successor"
 

Member Enumeration Documentation

◆ ContactPoint

Enum the contact points.

Enumerator
kStart 
kEnd 

◆ ElementType

Enum the types of the link's element.

Enumerator
kRoad 
kJunction 

Member Function Documentation

◆ contact_point_to_str()

std::string contact_point_to_str ( ContactPoint  contact_point)
static

Matches string with a ContactPoint.

Parameters
contact_pointIs a ContactPoint.
Returns
A string that matches with contact_point.

◆ element_type_to_str()

std::string element_type_to_str ( ElementType  type)
static

Matches string with a ElementType.

Parameters
typeIs a ElementType.
Returns
A string that matches with type.

◆ operator!=()

bool operator!= ( const RoadLink other) const

Inequality operator.

◆ operator==()

bool operator== ( const RoadLink other) const

Equality operator.

◆ str_to_contact_point()

RoadLink::ContactPoint str_to_contact_point ( const std::string &  contact_point)
static

Matches ContactPoint with a string.

Parameters
contact_pointIs a string.
Returns
A ContactPoint that matches with contact_point.
Exceptions
maliput::common::assertion_errorWhen contact_point doesn't match with a ContactPoint.

◆ str_to_element_type()

RoadLink::ElementType str_to_element_type ( const std::string &  type)
static

Matches ElementType with a string.

Parameters
typeIs a string.
Returns
A ElementType that matches with type.
Exceptions
maliput::common::assertion_errorWhen type doesn't match with a ElementType.

Member Data Documentation

◆ kPredecessorTag

constexpr const char* kPredecessorTag = "predecessor"
staticconstexpr

◆ kRoadLinkTag

constexpr const char* kRoadLinkTag = "link"
staticconstexpr

Convenient constants that hold the tag names in the XODR road header description.

◆ kSuccessorTag

constexpr const char* kSuccessorTag = "successor"
staticconstexpr

◆ predecessor

std::optional<LinkAttributes> predecessor {std::nullopt}

Road's predecessor.

◆ successor

std::optional<LinkAttributes> successor {std::nullopt}

Road's successor.


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