Abstraction for representing road segments. More...
#include <Segment.hh>
Public Member Functions | |
| Segment () | |
| Default constructor. More... | |
| Segment (const int _id) | |
| Constructor. More... | |
| Segment (const Segment &_other) | |
| Copy constructor. More... | |
| virtual | ~Segment () |
| Destructor. More... | |
| bool | AddLane (const rndf::Lane &_newLane) |
| Add a new lane. More... | |
| int | Id () const |
| Id. More... | |
| bool | Lane (const int _laneId, rndf::Lane &_lane) const |
| Get the details of one of the lane with Id _laneId. More... | |
| std::vector< rndf::Lane > & | Lanes () |
| Get a mutable reference to the vector of lanes. More... | |
| const std::vector< rndf::Lane > & | Lanes () const |
| Get the vector of lanes. More... | |
| bool | Load (std::ifstream &_rndfFile, int &_lineNumber) |
| Parsing. More... | |
| std::string | Name () const |
| Name. More... | |
| unsigned int | NumLanes () const |
| Lanes. More... | |
| bool | operator!= (const Segment &_other) const |
| Inequality. More... | |
| Segment & | operator= (const Segment &_other) |
| Assignment operator. More... | |
| bool | operator== (const Segment &_other) const |
| Operators. More... | |
| bool | RemoveLane (const int _laneId) |
| Remove an existing lane. More... | |
| bool | SetId (const int _id) |
| Set the identifier of the segment. More... | |
| void | SetName (const std::string &_name) const |
| Set the segment name. More... | |
| bool | UpdateLane (const rndf::Lane &_lane) |
| Update an existing lane. More... | |
| bool | Valid () const |
| Validation. More... | |
Abstraction for representing road segments.
A road network is composed by one or more segments, each of which comprises one or more lanes.
| manifold::rndf::Segment::Segment | ( | ) |
Default constructor.
|
explicit |
| manifold::rndf::Segment::Segment | ( | const Segment & | _other | ) |
|
virtual |
Destructor.
| bool manifold::rndf::Segment::AddLane | ( | const rndf::Lane & | _newLane | ) |
Add a new lane.
| [in] | _newLane | A new lane to be added. |
| int manifold::rndf::Segment::Id | ( | ) | const |
Id.
Get the unique identifier of the segment.
| bool manifold::rndf::Segment::Lane | ( | const int | _laneId, |
| rndf::Lane & | _lane | ||
| ) | const |
Get the details of one of the lane with Id _laneId.
| [in] | _laneId | The lane Id. |
| [out] | _lane | The lane requested. |
| std::vector<rndf::Lane>& manifold::rndf::Segment::Lanes | ( | ) |
Get a mutable reference to the vector of lanes.
| const std::vector<rndf::Lane>& manifold::rndf::Segment::Lanes | ( | ) | const |
Get the vector of lanes.
| bool manifold::rndf::Segment::Load | ( | std::ifstream & | _rndfFile, |
| int & | _lineNumber | ||
| ) |
Parsing.
Load a segment from an input stream coming from a text file. The expected format is the one specified on the RNDF spec.
| [in,out] | _rndfFile | Input file stream. |
| [in,out] | _lineNumber | Line number pointed by the stream position indicator. |
| std::string manifold::rndf::Segment::Name | ( | ) | const |
Name.
Get the segment name. E.g.: "Wisconsin_Ave".
| unsigned int manifold::rndf::Segment::NumLanes | ( | ) | const |
Lanes.
Get the number of lanes stored.
| bool manifold::rndf::Segment::operator!= | ( | const Segment & | _other | ) | const |
Assignment operator.
| [in] | _other | The new segment. |
| bool manifold::rndf::Segment::operator== | ( | const Segment & | _other | ) | const |
Operators.
Equality operator, result = this == _other
| [in] | _other | Segment to check for equality. |
| bool manifold::rndf::Segment::RemoveLane | ( | const int | _laneId | ) |
Remove an existing lane.
| [in] | _laneId | The lane Id to be removed. |
| bool manifold::rndf::Segment::SetId | ( | const int | _id | ) |
Set the identifier of the segment.
| [in] | _id | New unique Id. |
| void manifold::rndf::Segment::SetName | ( | const std::string & | _name | ) | const |
Set the segment name.
E.g.: "Wisconsin_Ave".
| [in] | _name | The new name. |
| bool manifold::rndf::Segment::UpdateLane | ( | const rndf::Lane & | _lane | ) |
Update an existing lane.
| [in] | _lane | The updated lane. |
| bool manifold::rndf::Segment::Valid | ( | ) | const |
Validation.