maliput_sparse
SegmentBuilder Class Referencefinal

Detailed Description

Builder class for maliput::api::Segments.

#include <include/maliput_sparse/builder/builder.h>

Inheritance diagram for SegmentBuilder:
[legend]

Public Member Functions

 SegmentBuilder (JunctionBuilder *parent)
 Construct a new Segment Builder object. More...
 
SegmentBuilderId (const maliput::api::SegmentId &segment_id)
 Sets the maliput::api::SegmentId of the maliput::api::Segment. More...
 
LaneBuilder StartLane ()
 Starts the Lane builder for this Segment. More...
 
JunctionBuilderEndSegment ()
 Finalizes the construction process of this Segment by inserting the Segment into the parent JunctionBuilder. More...
 
void SetLane (maliput::common::Passkey< LaneBuilder >, std::unique_ptr< maliput::geometry_base::Lane > lane)
 Sets a maliput::geometry_base::Lane into this builder to fill in the Segment. More...
 
- Public Member Functions inherited from NestedBuilder< JunctionBuilder >
virtual ~NestedBuilder ()=default
 
 NestedBuilder (JunctionBuilder *parent)
 Construct a new nested builder object. More...
 
JunctionBuilderEnd ()
 
JunctionBuilderParent ()
 

Constructor & Destructor Documentation

◆ SegmentBuilder()

SegmentBuilder ( JunctionBuilder parent)
explicit

Construct a new Segment Builder object.

Parameters
parentThe parent JunctionBuilder. It must not be nullptr.

Member Function Documentation

◆ EndSegment()

JunctionBuilder & EndSegment ( )

Finalizes the construction process of this Segment by inserting the Segment into the parent JunctionBuilder.

Exceptions
maliput::common::assertion_errorWhen there is no lane to be set into the Segment.
Returns
A reference to the JunctionBuilder.

◆ Id()

SegmentBuilder & Id ( const maliput::api::SegmentId &  segment_id)

Sets the maliput::api::SegmentId of the maliput::api::Segment.

Parameters
segment_idThe maliput::api::SegmentId.
Returns
A reference to this SegmentBuilder.

◆ SetLane()

void SetLane ( maliput::common::Passkey< LaneBuilder ,
std::unique_ptr< maliput::geometry_base::Lane >  lane 
)

Sets a maliput::geometry_base::Lane into this builder to fill in the Segment.

This method is only intended to be called by LaneBuilder instances. Call this method in order to determine a specific rigth to left ordering for this Segment.

See also
maliput::common::Passkey class description for further details.
Parameters
laneA lane to be stored into the Segment. It must not be nullptr.
Exceptions
maliput::common::assertion_errorWhen lane is nullptr.

◆ StartLane()

LaneBuilder StartLane ( )

Starts the Lane builder for this Segment.

Lanes should be added from right to left as the order they are set will determine the index they will receive in consecutive natural numbers (0 to +inf). That order must follow the indexing order required by the maliput::api::Segment::index() contract. This builder makes no assertion of that.

Returns
A LaneBuilder.

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