An abstraction for representing a parking spot within a zone.
More...
#include <ParkingSpot.hh>
An abstraction for representing a parking spot within a zone.
manifold::rndf::ParkingSpot::ParkingSpot |
( |
| ) |
|
manifold::rndf::ParkingSpot::ParkingSpot |
( |
const int |
_spotId | ) |
|
|
explicit |
Constructor.
- Parameters
-
[in] | _spotId | Parking spot Id (a positive number). |
manifold::rndf::ParkingSpot::ParkingSpot |
( |
const ParkingSpot & |
_other | ) |
|
Copy constructor.
- Parameters
-
[in] | _other | Other parking spot. |
virtual manifold::rndf::ParkingSpot::~ParkingSpot |
( |
| ) |
|
|
virtual |
bool manifold::rndf::ParkingSpot::AddWaypoint |
( |
const rndf::Waypoint & |
_newWaypoint | ) |
|
Add a new waypoint.
- Parameters
-
[in] | _newWaypoint | A new waypoint to be added. |
- Returns
- True when the waypoint was successfully added to the list or false otherwise (e.g. if the Id of the waypoint was already existing or invalid).
Checkpoint.
Get a mutable reference to the checkpoint.
- Returns
- A mutable reference to the checkpoint.
Get the checkpoint.
- Returns
- The checkpoint.
int manifold::rndf::ParkingSpot::Id |
( |
| ) |
const |
Id.
Get the Id.
- Returns
- The parking spot Id.
bool manifold::rndf::ParkingSpot::Load |
( |
std::ifstream & |
_rndfFile, |
|
|
const int |
_zoneId, |
|
|
int & |
_lineNumber |
|
) |
| |
Parsing.
Load a parking spot from an input stream coming from a text file. The expected format is the one specified on the RNDF spec.
- Parameters
-
[in,out] | _rndfFile | Input file stream. |
[in] | _zoneId | The zone Id in which the spot is located. |
[in,out] | _lineNumber | Line number pointed by the stream position indicator. |
- Returns
- True if a parking spot block was found and parsed or false otherwise (e.g.: EoF or incorrect format found).
unsigned int manifold::rndf::ParkingSpot::NumWaypoints |
( |
| ) |
const |
Waypoints.
Get the number of waypoints stored.
- Returns
- The number of waypoints in the current parking spot.
bool manifold::rndf::ParkingSpot::operator!= |
( |
const ParkingSpot & |
_other | ) |
const |
Inequality.
- Parameters
-
[in] | _other | Parking spot to check for inequality. |
- Returns
- true if this != _other
Assignment operator.
- Parameters
-
[in] | _other | The new parking spot. |
- Returns
- A reference to this instance.
bool manifold::rndf::ParkingSpot::operator== |
( |
const ParkingSpot & |
_other | ) |
const |
Operators.
Equality operator, result = this == _other
- Parameters
-
[in] | _other | Parking spot to check for equality. |
- Returns
- true if this == _other
bool manifold::rndf::ParkingSpot::RemoveWaypoint |
( |
const int |
_wpId | ) |
|
Remove an existing waypoint.
- Parameters
-
[in] | _wpId | The waypoint Id to be removed. |
- Returns
- True when the waypoint was successfully deleted from the list or false otherwise (e.g. if the Id of the waypoint was not found or invalid).
bool manifold::rndf::ParkingSpot::SetId |
( |
const int |
_id | ) |
|
Set the identifier of the parking spot.
- Parameters
-
- Returns
- True if the operation succeed or false otherwise (e.g.: if the id is not valid).
- See Also
- Valid.
bool manifold::rndf::ParkingSpot::SetWidth |
( |
const double |
_newWidth | ) |
|
Set the parking spot width.
- Parameters
-
[in] | _newWidth | The new width in meters. |
bool manifold::rndf::ParkingSpot::UpdateWaypoint |
( |
const rndf::Waypoint & |
_wp | ) |
|
Update an existing waypoint.
- Parameters
-
[in] | _wp | The updated waypoint. |
- Returns
- True if the waypoint was found and updated or false otherwise.
bool manifold::rndf::ParkingSpot::Valid |
( |
| ) |
const |
Validation.
- Returns
- True if the parking spot is valid.
bool manifold::rndf::ParkingSpot::Waypoint |
( |
const int |
_wpId, |
|
|
rndf::Waypoint & |
_wp |
|
) |
| const |
Get the details of one of the waypoints with Id _wpId.
- Parameters
-
[in] | _wpId | The waypoint Id. |
[out] | _wp | The waypoint requested. |
- Returns
- True if the waypoint was found or false otherwise.
std::vector<rndf::Waypoint>& manifold::rndf::ParkingSpot::Waypoints |
( |
| ) |
|
Get a mutable reference to the vector of waypoints;.
- Returns
- A mutable reference to the vector of waypoints.
const std::vector<rndf::Waypoint>& manifold::rndf::ParkingSpot::Waypoints |
( |
| ) |
const |
Get the vector of waypoints;.
- Returns
-
The vector of waypoints.
double manifold::rndf::ParkingSpot::Width |
( |
| ) |
const |
Width.
Get the parking spot width in meters.
- Returns
- Return the parking spot width in meters.
The documentation for this class was generated from the following file: