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

Departure Class Reference

Departure Class Reference

Departure Stores a single departure. More...

#include <departure.h>

Public Member Functions

 Departure ()
 Empty Departure constructor.
 Departure (const std::string &_crs, const std::string &_locationName, const std::string &_std, const std::string &_etd, const std::string &_platform, const std::string &_operatorName, const std::string &_operatorCode)
 Departure constructor.
bool IsDelayed ()
 Determine if the departure is delayed.
bool IsCancelled ()
 Determine if a departure is cancelled.
bool IsOnTime ()
 Determine if a departure is on time.
std::string GetETDFormatted ()
 Get the estimated time of departure.

Detailed Description

Departure Stores a single departure.

Definition at line 9 of file departure.h.


Constructor & Destructor Documentation

Departure (  )

Empty Departure constructor.

Definition at line 21 of file departure.h.

Departure ( const std::string &  _crs,
const std::string &  _locationName,
const std::string &  _std,
const std::string &  _etd,
const std::string &  _platform,
const std::string &  _operatorName,
const std::string &  _operatorCode 
)

Departure constructor.

Parameters:
_crsStation code (in NR style)
_locationNameLocation of departure (i.e. where the train is going)
_stdScheduled time of departure (in 24-hour format, i.e. "14:03")
_etdEstimated time of departure (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 4 of file departure.cpp.


Member Function Documentation

std::string GetETDFormatted (  )

Get the estimated time of departure.

Returns:
a time string with the estimated time of departure (in format "HH:MM"), the phrase "Unknown" if it is not known, or the phrase "Cancelled" if it is cancelled

Definition at line 22 of file departure.cpp.

bool IsCancelled (  )

Determine if a departure is cancelled.

Returns:
a boolean stating if the departure is cancelled

Definition at line 29 of file departure.cpp.

bool IsDelayed (  )

Determine if the departure is delayed.

Returns:
a boolean stating if the departure is delayed

Definition at line 15 of file departure.cpp.

bool IsOnTime (  )

Determine if a departure is on time.

Returns:
a boolean stating if the departure is on time

Definition at line 35 of file departure.cpp.