maliput
|
geometry_base's implementation of api::Segment.
#include <include/maliput/geometry_base/segment.h>
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 | |
![]() | |
SegmentId | id () const |
Returns the persistent identifier. More... | |
const Junction * | junction () 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 Lane * | lane (int index) const |
Returns the Lane indexed by index . More... | |
Additional Inherited Members | |
![]() | |
Segment ()=default | |
|
explicit |
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.
lane
's raw pointer.T | must be derived from geometry_base::Lane. |
std::exception | if lane is empty. |
void AttachToJunction | ( | common::Passkey< Junction > | , |
const api::Junction * | junction | ||
) |
MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN | ( | Segment | ) |
void SetLaneIndexingCallback | ( | common::Passkey< Junction > | , |
const std::function< void(const api::Lane *)> & | callback | ||
) |