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

#include <Perimeter.hh>

Public Member Functions

 PerimeterHeader ()
 Default constructor. More...
 
 ~PerimeterHeader ()=default
 Destructor. More...
 
bool AddExit (const Exit &_newExit)
 Add a new exit. 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 exits. More...
 
bool Load (std::ifstream &_rndfFile, const int _zoneId, const int _perimeterId, int &_lineNumber)
 Parsing. More...
 
unsigned int NumExits () const
 Exits. More...
 
bool RemoveExit (const Exit &_exit)
 Remove an existing exit. More...
 

Constructor & Destructor Documentation

ignition::rndf::PerimeterHeader::PerimeterHeader ( )

Default constructor.

ignition::rndf::PerimeterHeader::~PerimeterHeader ( )
default

Destructor.

Member Function Documentation

bool ignition::rndf::PerimeterHeader::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).
std::vector<Exit>& ignition::rndf::PerimeterHeader::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::PerimeterHeader::Exits ( ) const

Get the vector of exits.

Returns
The vector of exits.
bool ignition::rndf::PerimeterHeader::Load ( std::ifstream &  _rndfFile,
const int  _zoneId,
const int  _perimeterId,
int &  _lineNumber 
)

Parsing.

Load a perimeter 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]_zoneIdThe zone Id in which the spot is located.
[in]_perimeterIdThe perimeter Id.
[in,out]_lineNumberLine number pointed by the stream position indicator.
Returns
True if a perimeter header block was found and parsed or false otherwise (e.g.: EoF or incorrect format found).
unsigned int ignition::rndf::PerimeterHeader::NumExits ( ) const

Exits.

Get the number of exits stored.

Returns
The number of exits in the current lane.
bool ignition::rndf::PerimeterHeader::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).

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