API for linking to the Huxley National Rail REST proxy for the retrieval of live National Rail data. Still needs work (sadly), but works well for the time being!
Dependencies: EthernetInterface
Arrival Class Reference
Arrival Stores a single arrival. More...
#include <arrival.h>
Public Member Functions | |
Arrival () | |
Empty Arrival constructor. | |
Arrival (const std::string &_crs, const std::string &_locationName, const std::string &_sta, const std::string &_eta, const std::string &_platform, const std::string &_operatorName, const std::string &_operatorCode) | |
Arrival constructor. | |
bool | IsDelayed () |
Determine if the arrival is delayed. | |
bool | IsCancelled () |
Determine if a arrival is cancelled. | |
bool | IsOnTime () |
Determine if a arrival is on time. | |
std::string | GetETAFormatted () |
Get the estimated time of arrival. |
Detailed Description
Arrival Stores a single arrival.
Definition at line 9 of file arrival.h.
Constructor & Destructor Documentation
Arrival | ( | const std::string & | _crs, |
const std::string & | _locationName, | ||
const std::string & | _sta, | ||
const std::string & | _eta, | ||
const std::string & | _platform, | ||
const std::string & | _operatorName, | ||
const std::string & | _operatorCode | ||
) |
Arrival constructor.
- Parameters:
-
_crs Station code (in NR style) _locationName Location of arrival (i.e. where the arrival comes from) _sta Scheduled time of arrival (in 24-hour format, i.e. "14:03") _eta Estimated time of arrival (in 24-hour format, "On time", "Delayed" or "Cancelled") _platform Intended platform _operatorName The train operating company operating the service _operatorCode The train operating companies' NR code
Definition at line 5 of file arrival.cpp.
Member Function Documentation
std::string GetETAFormatted | ( | ) |
Get the estimated time of arrival.
- Returns:
- a time string with the estimated time of arrival (in format "HH:MM"), the phrase "Unknown" if it is not known, or the phrase "Cancelled" if it is cancelled
Definition at line 16 of file arrival.cpp.
bool IsCancelled | ( | ) |
Determine if a arrival is cancelled.
- Returns:
- a boolean stating if the arrival is cancelled
Definition at line 23 of file arrival.cpp.
bool IsDelayed | ( | ) |
Determine if the arrival is delayed.
- Returns:
- a boolean stating if the arrival is delayed
bool IsOnTime | ( | ) |
Determine if a arrival is on time.
- Returns:
- a boolean stating if the arrival is on time
Definition at line 29 of file arrival.cpp.
Generated on Mon Jul 18 2022 22:01:04 by 1.7.2