maliput
Segment Class Reference

Detailed Description

geometry_base's implementation of api::Segment.

#include <include/maliput/geometry_base/segment.h>

Inheritance diagram for Segment:
[legend]

Public Member Functions

 MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN (Segment)
 
 Segment (const api::SegmentId &id)
 Constructs a new Segment. More...
 
template<class T >
T * AddLane (std::unique_ptr< T > lane)
 Adds lane to this Segment. More...
 
template<class T >
T * AddBoundary (std::unique_ptr< T > boundary)
 Adds boundary to this Segment. More...
 
void AttachToJunction (common::Passkey< Junction >, const api::Junction *junction)
 
void SetLaneIndexingCallback (common::Passkey< Junction >, const std::function< void(const api::Lane *)> &callback)
 
void SetLaneBoundaryIndexingCallback (common::Passkey< Junction >, const std::function< void(const api::LaneBoundary *)> &callback)
 
 ~Segment () override=default
 
- Public Member Functions inherited from Segment
SegmentId id () const
 Returns the persistent identifier. More...
 
const Junctionjunction () const
 Returns the Junction to which this Segment belongs. More...
 
int num_lanes () const
 Returns the number of Lanes contained in this Segment. More...
 
const Lanelane (int index) const
 Returns the Lane indexed by index. More...
 
int num_boundaries () const
 Returns the number of LaneBoundaries contained in this Segment. More...
 
const LaneBoundaryboundary (int index) const
 Returns the LaneBoundary indexed by index. More...
 
std::optional< bool > is_intersection () const
 Returns whether this segment is an intersection. More...
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ Segment()

Segment ( const api::SegmentId id)
explicit

Constructs a new Segment.

Parameters
idSegment's ID.

The Segment is not fully initialized until it is added to a Junction.

◆ ~Segment()

~Segment ( )
overridevirtualdefault

Reimplemented from Segment.

Member Function Documentation

◆ AddBoundary()

T* AddBoundary ( std::unique_ptr< T >  boundary)

Adds boundary to this Segment.

This Segment will take ownership of boundary and will be assigned as its parent. The index of boundary will also be assigned, in order of addition. (The first LaneBoundary added to this Segment, by the first call to AddBoundary(), will be assigned index 0.)

Note that the maliput API requires that lanes are indexed in a Segment in right-to-left order, thus AddBoundary() should be called on boundaries in right-to-left order.

Returns
boundary's raw pointer.
Template Parameters
Tmust be derived from geometry_base::LaneBoundary.
Exceptions
std::exceptionif boundary is empty.

◆ AddLane()

T* AddLane ( std::unique_ptr< T >  lane)

Adds lane to this Segment.

This Segment will take ownership of lane and will be assigned as its parent. The index of lane will also be assigned, in order of addition. (The first Lane added to this Segment, by the first call to AddLane(), will be assigned index 0.)

Note that the maliput API requires that lanes are indexed in a Segment in right-to-left order, thus AddLane() should be called on lanes in right-to-left order.

Returns
lane's raw pointer.
Template Parameters
Tmust be derived from geometry_base::Lane.
Exceptions
std::exceptionif lane is empty.

◆ AttachToJunction()

void AttachToJunction ( common::Passkey< Junction ,
const api::Junction junction 
)

◆ MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN()

MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN ( Segment  )

◆ SetLaneBoundaryIndexingCallback()

void SetLaneBoundaryIndexingCallback ( common::Passkey< Junction ,
const std::function< void(const api::LaneBoundary *)> &  callback 
)

◆ SetLaneIndexingCallback()

void SetLaneIndexingCallback ( common::Passkey< Junction ,
const std::function< void(const api::Lane *)> &  callback 
)

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