An abstraction to represent a Route Network Definition File (RNDF).
More...
#include <RNDF.hh>
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
manifold::rndf::RNDF::RNDF |
( |
| ) |
|
manifold::rndf::RNDF::RNDF |
( |
const std::string & |
_filepath | ) |
|
|
explicit |
Constructor.
- Parameters
-
[in] | _filepath | Path to an existing RNDF file. |
virtual manifold::rndf::RNDF::~RNDF |
( |
| ) |
|
|
virtual |
bool manifold::rndf::RNDF::AddSegment |
( |
const rndf::Segment & |
_newSegment | ) |
|
Add a new segment.
- Parameters
-
[in] | _newSegment | A 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] | _newZone | A 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] | _filePath | Path 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] | _segmentId | The 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] | _zoneId | The 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] | _segmentId | The segment Id. |
[out] | _segment | The segment requested. |
- Returns
- True if the segment was found or false otherwise.
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] | _date | The new creation date. |
void manifold::rndf::RNDF::SetName |
( |
const std::string & |
_name | ) |
|
Set the segment name.
- Parameters
-
void manifold::rndf::RNDF::SetVersion |
( |
const std::string & |
_version | ) |
const |
Set the format version.
- Parameters
-
[in] | _version | The new version. |
bool manifold::rndf::RNDF::UpdateSegment |
( |
const rndf::Segment & |
_segment | ) |
|
Update an existing segment.
- Parameters
-
[in] | _segment | The 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] | _zone | The 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] | _zoneId | The zone Id. |
[out] | _zone | The 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: