maliput_malidrive
Junction Struct Reference

Detailed Description

Holds a junction description of a XODR road.

For example:

<OpenDRIVE>
...
<junction id="406" name="junction406">
<connection id="0" incomingRoad="166" connectingRoad="409" contactPoint="start">
<laneLink from="-2" to="-2"/>
<laneLink from="-3" to="-3"/>
<laneLink from="-4" to="-4"/>
</connection>
</junction>
...
</OpenDRIVE>

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

Public Types

enum  Type { kDefault = 0, kVirtual }
 Enum junction types. More...
 
using Id = maliput::api::TypeSpecificIdentifier< struct Junction >
 

Public Member Functions

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

Static Public Member Functions

static Type str_to_type (const std::string &type)
 Matches Type with a string. More...
 
static std::string type_to_str (Type type)
 Matches string with a Type. More...
 

Public Attributes

Id id {"None"}
 Junction's id. More...
 
std::optional< std::string > name {std::nullopt}
 Junction's name. More...
 
std::optional< Typetype {Type::kDefault}
 Type of the junction, required for "virtual" junctions only. More...
 
std::unordered_map< Connection::Id, Connectionconnections {}
 Connections within the junction. More...
 

Static Public Attributes

static constexpr const char * kJunctionTag = "junction"
 Convenient constants that hold the tag names in the XODR junction description. More...
 
static constexpr const char * kId = "id"
 
static constexpr const char * kName = "name"
 
static constexpr const char * kType = "type"
 

Member Typedef Documentation

◆ Id

Member Enumeration Documentation

◆ Type

enum Type

Enum junction types.

Enumerator
kDefault 
kVirtual 

Member Function Documentation

◆ operator!=()

bool operator!= ( const Junction other) const

Inequality operator.

◆ operator==()

bool operator== ( const Junction other) const

Equality operator.

◆ str_to_type()

Junction::Type str_to_type ( const std::string &  type)
static

Matches Type with a string.

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

◆ type_to_str()

std::string type_to_str ( Type  type)
static

Matches string with a Type.

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

Member Data Documentation

◆ connections

std::unordered_map<Connection::Id, Connection> connections {}

Connections within the junction.

◆ id

Id id {"None"}

Junction's id.

◆ kId

constexpr const char* kId = "id"
staticconstexpr

◆ kJunctionTag

constexpr const char* kJunctionTag = "junction"
staticconstexpr

Convenient constants that hold the tag names in the XODR junction description.

◆ kName

constexpr const char* kName = "name"
staticconstexpr

◆ kType

constexpr const char* kType = "type"
staticconstexpr

◆ name

std::optional<std::string> name {std::nullopt}

Junction's name.

◆ type

std::optional<Type> type {Type::kDefault}

Type of the junction, required for "virtual" junctions only.


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