All Classes Namespaces Files Functions Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
manifold::rndf::RNDF Class Reference

An abstraction to represent a Route Network Definition File (RNDF). More...

#include <RNDF.hh>

Public Member Functions

 RNDF ()
 Constructor. More...
 
 RNDF (const std::string &_filepath)
 Constructor. More...
 
virtual ~RNDF ()
 Destructor. More...
 
bool AddSegment (const rndf::Segment &_newSegment)
 Add a new segment. More...
 
bool AddZone (const rndf::Zone &_newZone)
 Add a new zone. More...
 
std::string Date () const
 Date. More...
 
bool Load (const std::string &_filePath)
 Parsing. More...
 
std::string Name () const
 Name. More...
 
unsigned int NumSegments () const
 Segments. More...
 
unsigned int NumZones () const
 Zones. More...
 
bool RemoveSegment (const int _segmentId)
 Remove an existing segment. More...
 
bool RemoveZone (const int _zoneId)
 Remove an existing zone. More...
 
bool Segment (const int _segmentId, rndf::Segment &_segment) const
 Get the details of one of the segments with Id _segmentId. More...
 
std::vector< rndf::Segment > & Segments ()
 Get a mutable reference to the vector of segments. More...
 
const std::vector
< rndf::Segment > & 
Segments () const
 Get the vector of segments. More...
 
void SetDate (const std::string &_newDate) const
 Set the creation date. More...
 
void SetName (const std::string &_name)
 Set the segment name. More...
 
void SetVersion (const std::string &_version) const
 Set the format version. More...
 
bool UpdateSegment (const rndf::Segment &_segment)
 Update an existing segment. More...
 
bool UpdateZone (const rndf::Zone &_zone)
 Update an existing zone. More...
 
bool Valid () const
 Validation. More...
 
std::string Version () const
 Version. More...
 
bool Zone (const int _zoneId, rndf::Zone &_zone) const
 Get the details of one of the zones with Id _zoneId. More...
 
std::vector< rndf::Zone > & Zones ()
 Get a mutable reference to the vector of zones. More...
 
const std::vector< rndf::Zone > & Zones () const
 Get the vector of zones. More...
 

Detailed Description

An abstraction to represent a Route Network Definition File (RNDF).

Please, refer to the specification for more details. http://www.grandchallenge.org/grandchallenge/docs/RNDF_MDF_Formats_031407.pdf

Constructor & Destructor Documentation

manifold::rndf::RNDF::RNDF ( )

Constructor.

manifold::rndf::RNDF::RNDF ( const std::string &  _filepath)
explicit

Constructor.

Parameters
[in]_filepathPath to an existing RNDF file.
virtual manifold::rndf::RNDF::~RNDF ( )
virtual

Destructor.

Member Function Documentation

bool manifold::rndf::RNDF::AddSegment ( const rndf::Segment _newSegment)

Add a new segment.

Parameters
[in]_newSegmentA new segment to be added.
Returns
True when the segment was successfully added to the list or false otherwise (e.g. if the Id of the segment was already existing or invalid).
bool manifold::rndf::RNDF::AddZone ( const rndf::Zone _newZone)

Add a new zone.

Parameters
[in]_newZoneA new zone to be added.
Returns
True when the zone was successfully added to the list or false otherwise (e.g. if the Id of the zone was already existing or invalid).
std::string manifold::rndf::RNDF::Date ( ) const

Date.

Get the creation date.

Returns
The creation date.
bool manifold::rndf::RNDF::Load ( const std::string &  _filePath)

Parsing.

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

Parameters
[in,out]_filePathPath to RNDF file.
Returns
True if the entire RNDF was correctly parsed or false otherwise (e.g.: EoF or incorrect format found).
std::string manifold::rndf::RNDF::Name ( ) const

Name.

Get the segment name.

Returns
The segment name.
unsigned int manifold::rndf::RNDF::NumSegments ( ) const

Segments.

Get the number of segments stored.

Returns
The number of segments in this RNDF.
unsigned int manifold::rndf::RNDF::NumZones ( ) const

Zones.

Get the number of zones stored.

Returns
The number of zones in this RNDF.
bool manifold::rndf::RNDF::RemoveSegment ( const int  _segmentId)

Remove an existing segment.

Parameters
[in]_segmentIdThe segment Id to be removed.
Returns
True when the segment was successfully deleted from the list or false otherwise (e.g. if the Id of the segment was not found or invalid).
bool manifold::rndf::RNDF::RemoveZone ( const int  _zoneId)

Remove an existing zone.

Parameters
[in]_zoneIdThe zone Id to be removed.
Returns
True when the zone was successfully deleted from the list or false otherwise (e.g. if the Id of the zone was not found or invalid).
bool manifold::rndf::RNDF::Segment ( const int  _segmentId,
rndf::Segment _segment 
) const

Get the details of one of the segments with Id _segmentId.

Parameters
[in]_segmentIdThe segment Id.
[out]_segmentThe segment requested.
Returns
True if the segment was found or false otherwise.
std::vector<rndf::Segment>& manifold::rndf::RNDF::Segments ( )

Get a mutable reference to the vector of segments.

Returns
A mutable reference to the vector of segments.
const std::vector<rndf::Segment>& manifold::rndf::RNDF::Segments ( ) const

Get the vector of segments.

Returns
The vector of segments.
void manifold::rndf::RNDF::SetDate ( const std::string &  _newDate) const

Set the creation date.

Parameters
[in]_dateThe new creation date.
void manifold::rndf::RNDF::SetName ( const std::string &  _name)

Set the segment name.

Parameters
[in]_nameThe new name.
void manifold::rndf::RNDF::SetVersion ( const std::string &  _version) const

Set the format version.

Parameters
[in]_versionThe new version.
bool manifold::rndf::RNDF::UpdateSegment ( const rndf::Segment _segment)

Update an existing segment.

Parameters
[in]_segmentThe updated segment.
Returns
True if the segment was found and updated or false otherwise.
bool manifold::rndf::RNDF::UpdateZone ( const rndf::Zone _zone)

Update an existing zone.

Parameters
[in]_zoneThe updated zone.
Returns
True if the zone was found and updated or false otherwise.
bool manifold::rndf::RNDF::Valid ( ) const

Validation.

Returns
True if the RNDF is valid.
std::string manifold::rndf::RNDF::Version ( ) const

Version.

Get the format version. E.g.: "2.3.6".

Returns
The format version.
bool manifold::rndf::RNDF::Zone ( const int  _zoneId,
rndf::Zone _zone 
) const

Get the details of one of the zones with Id _zoneId.

Parameters
[in]_zoneIdThe zone Id.
[out]_zoneThe zone requested.
Returns
True if the zone was found or false otherwise.
std::vector<rndf::Zone>& manifold::rndf::RNDF::Zones ( )

Get a mutable reference to the vector of zones.

Returns
A mutable reference to the vector of zones.
const std::vector<rndf::Zone>& manifold::rndf::RNDF::Zones ( ) const

Get the vector of zones.

Returns
The vector of zones.

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