Public Member Functions | List of all members
ignition::rndf::LaneHeader Class Reference

#include <Lane.hh>

Public Member Functions

 LaneHeader ()
 Default constructor. More...
 
 ~LaneHeader ()=default
 Destructor. More...
 
bool AddCheckpoint (const rndf::Checkpoint &_newCheckpoint)
 Add a new checkpoint. More...
 
bool AddExit (const Exit &_newExit)
 Add a new exit. More...
 
bool AddStop (const int _waypointId)
 Add a new stop. More...
 
bool Checkpoint (const int _cpId, rndf::Checkpoint &_cp) const
 Get the details of one of the checkpoints with Id _cpId. More...
 
std::vector< rndf::Checkpoint > & Checkpoints ()
 Get a mutable reference to the vector of checkpoints;. More...
 
const std::vector< rndf::Checkpoint > & Checkpoints () const
 Get the vector of checkpoints;. More...
 
std::vector< Exit > & Exits ()
 Get a mutable reference to the vector of exits. More...
 
const std::vector< Exit > & Exits () const
 Get the vector of stops. More...
 
Marking LeftBoundary () const
 Boundaries. More...
 
bool Load (std::ifstream &_rndfFile, const int _segmentId, const int _laneId, int &_lineNumber)
 Parsing. More...
 
unsigned int NumCheckpoints () const
 Checkpoints. More...
 
unsigned int NumExits () const
 Exits. More...
 
unsigned int NumStops () const
 Stops. More...
 
bool RemoveCheckpoint (const int _cpId)
 Remove an existing checkpoint. More...
 
bool RemoveExit (const Exit &_exit)
 Remove an existing exit. More...
 
bool RemoveStop (const int _waypointId)
 Remove an existing stop. More...
 
Marking RightBoundary () const
 Get the right boundary type. More...
 
void SetLeftBoundary (const Marking &_boundary)
 Set the new left boundary type. More...
 
void SetRightBoundary (const Marking &_boundary)
 Set the new right boundary type. More...
 
bool SetWidth (const double _newWidth)
 Set the lane width. More...
 
std::vector< int > & Stops ()
 Get a mutable reference to the vector of stops. More...
 
const std::vector< int > & Stops () const
 Get the vector of stops. More...
 
bool UpdateCheckpoint (const rndf::Checkpoint &_cp)
 Update an existing checkpoint. More...
 
double Width () const
 Width. More...
 

Constructor & Destructor Documentation

ignition::rndf::LaneHeader::LaneHeader ( )

Default constructor.

ignition::rndf::LaneHeader::~LaneHeader ( )
default

Destructor.

Member Function Documentation

bool ignition::rndf::LaneHeader::AddCheckpoint ( const rndf::Checkpoint _newCheckpoint)

Add a new checkpoint.

Parameters
[in]_newCheckpointA new checkpoint to be added.
Returns
True when the checkpoint was successfully added to the list or false otherwise (e.g. if the Id of the checkpoint was already existing or invalid).
bool ignition::rndf::LaneHeader::AddExit ( const Exit _newExit)

Add a new exit.

Parameters
[in]_newExitThe exit to add.
Returns
True when the exit was successfully added or false otherwise (e.g. if the exit was already existing or invalid).
bool ignition::rndf::LaneHeader::AddStop ( const int  _waypointId)

Add a new stop.

Parameters
[in]_waypointIdThe Id of a new waypoint considered a stop.
Returns
True when the stop was successfully added to the list or false otherwise (e.g. if the Id of the waypoint was already existing or invalid).
bool ignition::rndf::LaneHeader::Checkpoint ( const int  _cpId,
rndf::Checkpoint _cp 
) const

Get the details of one of the checkpoints with Id _cpId.

Parameters
[in]_cpIdThe checkpoint Id.
[out]_cpThe checkpoint requested.
Returns
True if the checkpoint was found or false otherwise.
std::vector<rndf::Checkpoint>& ignition::rndf::LaneHeader::Checkpoints ( )

Get a mutable reference to the vector of checkpoints;.

Returns
A mutable reference to the vector of checkpoints.
const std::vector<rndf::Checkpoint>& ignition::rndf::LaneHeader::Checkpoints ( ) const

Get the vector of checkpoints;.

Returns
The vector of checkpoints.
std::vector<Exit>& ignition::rndf::LaneHeader::Exits ( )

Get a mutable reference to the vector of exits.

Returns
A mutable reference to the vector of exits.
const std::vector<Exit>& ignition::rndf::LaneHeader::Exits ( ) const

Get the vector of stops.

Returns
The vector of stops.
Marking ignition::rndf::LaneHeader::LeftBoundary ( ) const

Boundaries.

Get the left boundary type.

Returns
The left boundary type.
bool ignition::rndf::LaneHeader::Load ( std::ifstream &  _rndfFile,
const int  _segmentId,
const int  _laneId,
int &  _lineNumber 
)

Parsing.

Load a lane header from an input stream coming from a text file. The expected format is the one specified on the RNDF spec.

Parameters
[in,out]_rndfFileInput file stream.
[in]_segmentIdThe expected zone Id.
[in]_laneIdThe expected lane Id.
[in,out]_lineNumberLine number pointed by the stream position indicator.
Returns
True if a lane header block was found and parsed or false otherwise (e.g.: EoF or incorrect format found).
unsigned int ignition::rndf::LaneHeader::NumCheckpoints ( ) const

Checkpoints.

Get the number of checkpoints stored.

Returns
The number of checkpoints in the current lane.
unsigned int ignition::rndf::LaneHeader::NumExits ( ) const

Exits.

Get the number of exits stored.

Returns
The number of exits in the current lane.
unsigned int ignition::rndf::LaneHeader::NumStops ( ) const

Stops.

Get the number of stops stored.

Returns
The number of stops in the current lane.
bool ignition::rndf::LaneHeader::RemoveCheckpoint ( const int  _cpId)

Remove an existing checkpoint.

Parameters
[in]_cpIdThe checkpoint Id to be removed.
Returns
True when the checkpoint was successfully deleted or false otherwise (e.g. if the Id of the checkpoint was not found or invalid).
bool ignition::rndf::LaneHeader::RemoveExit ( const Exit _exit)

Remove an existing exit.

Parameters
[in]_exitThe exit to be removed.
Returns
True when the exit was successfully deleted or false otherwise (e.g. if the exit was not found or invalid).
bool ignition::rndf::LaneHeader::RemoveStop ( const int  _waypointId)

Remove an existing stop.

Parameters
[in]_waypointIdThe waypoint Id (of a stop sign) to be removed.
Returns
True when the waypoint was successfully deleted or false otherwise (e.g. if the Id of the waypoint was not found or invalid).
Marking ignition::rndf::LaneHeader::RightBoundary ( ) const

Get the right boundary type.

Returns
The right boundary type.
void ignition::rndf::LaneHeader::SetLeftBoundary ( const Marking _boundary)

Set the new left boundary type.

Parameters
[in]_boundaryThe new left boundary type.
void ignition::rndf::LaneHeader::SetRightBoundary ( const Marking _boundary)

Set the new right boundary type.

Parameters
[in]_boundaryThe new right boundary type.
bool ignition::rndf::LaneHeader::SetWidth ( const double  _newWidth)

Set the lane width.

Parameters
[in]_newWidthThe new width in meters.
std::vector<int>& ignition::rndf::LaneHeader::Stops ( )

Get a mutable reference to the vector of stops.

The elements are waypoint Ids.

Returns
A mutable reference to the vector of stops.
const std::vector<int>& ignition::rndf::LaneHeader::Stops ( ) const

Get the vector of stops.

The elements are waypoint Ids.

Returns
The vector of stops.
bool ignition::rndf::LaneHeader::UpdateCheckpoint ( const rndf::Checkpoint _cp)

Update an existing checkpoint.

Parameters
[in]_cpThe updated checkpoint.
Returns
True if the checkpoint was found and updated or false otherwise.
double ignition::rndf::LaneHeader::Width ( ) const

Width.

Get the lane width in meters.

Returns
Return the lane width in meters.

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