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...
 
void AttachToJunction (common::Passkey< Junction >, const api::Junction *junction)
 
void SetLaneIndexingCallback (common::Passkey< Junction >, const std::function< void(const api::Lane *)> &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...
 

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

◆ 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  )

◆ 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: