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

Embed: (wiki syntax)

« Back to documentation index

Arrival Class Reference

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 (  )

Empty Arrival constructor.

Definition at line 21 of file arrival.h.

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:
_crsStation code (in NR style)
_locationNameLocation of arrival (i.e. where the arrival comes from)
_staScheduled time of arrival (in 24-hour format, i.e. "14:03")
_etaEstimated time of arrival (in 24-hour format, "On time", "Delayed" or "Cancelled")
_platformIntended platform
_operatorNameThe train operating company operating the service
_operatorCodeThe 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.