Model Railroad System 2.2.2
Public Member Functions | Private Attributes | List of all members
TTSupport::StationTimes Class Reference

Station times class, used by the LaTeX generator methods. More...

#include <TimeTableSystem.h>

Public Member Functions

 StationTimes (double a=-1, double d=-1, Stop::FlagType f=Stop::Transit)
 Constructor: create an entry for a time table cell. More...
 
 StationTimes (const StationTimes &other)
 Copy constructor: create an entry for a time table cell from an existing StationTimes object. More...
 
StationTimesoperator= (const StationTimes &other)
 Assignment operator: copy the fields from another StationTimes object. More...
 
double Arrival () const
 Accessor for the arrival time. More...
 
double Departure () const
 Accessor for the departure time. More...
 
Stop::FlagType Flag () const
 Accessor for the type of stop flag. More...
 

Private Attributes

double arrival
 The arrival time, in scale time units. More...
 
double departure
 The departure time, in scale time units. More...
 
Stop::FlagType flag
 The stop flag: Origin, Terminate, or Transit. More...
 

Detailed Description

Station times class, used by the LaTeX generator methods.

This class holds time table information used in the code that generates the LaTeX tables. Each StationTimes item contains one table element in the form of an arrival time and a departure time. The flag member indicates if only the arrival time, departure time, or both times are valid. An originating train has no arrival time and a terminating train has no departure time.

This class is actually used to hold the information for a single cell in a formatted time table. Each cell contains an arrivial time and a departure time. Each row in the table contains the information for a specific station and each column contains the information for a single train.

See also
TrainStationTimes TrainTimesAtStation.
Author
Robert Heller <heller@deepsoft.com>

Constructor & Destructor Documentation

◆ StationTimes() [1/2]

TTSupport::StationTimes::StationTimes ( double  a = -1,
double  d = -1,
Stop::FlagType  f = Stop::Transit 
)
inline

Constructor: create an entry for a time table cell.

Parameters
aThe arrival time.
dThe departure time.
fThe stop flag: Origin, Terminate, or Transit.

References arrival, departure, and flag.

◆ StationTimes() [2/2]

TTSupport::StationTimes::StationTimes ( const StationTimes other)
inline

Copy constructor: create an entry for a time table cell from an existing StationTimes object.

Parameters
otherThe other StationTimes object.

References arrival, departure, and flag.

Member Function Documentation

◆ Arrival()

double TTSupport::StationTimes::Arrival ( ) const
inline

Accessor for the arrival time.

References arrival.

◆ Departure()

double TTSupport::StationTimes::Departure ( ) const
inline

Accessor for the departure time.

References departure.

◆ Flag()

Stop::FlagType TTSupport::StationTimes::Flag ( ) const
inline

Accessor for the type of stop flag.

References flag.

◆ operator=()

StationTimes & TTSupport::StationTimes::operator= ( const StationTimes other)
inline

Assignment operator: copy the fields from another StationTimes object.

Parameters
otherThe other StationTimes object.

References arrival, departure, and flag.

Member Data Documentation

◆ arrival

double TTSupport::StationTimes::arrival
private

The arrival time, in scale time units.

Only used for trains in transit and for terminating trains.

Referenced by Arrival(), operator=(), and StationTimes().

◆ departure

double TTSupport::StationTimes::departure
private

The departure time, in scale time units.

Only used for trains in transit and for originating trains.

Referenced by Departure(), operator=(), and StationTimes().

◆ flag

Stop::FlagType TTSupport::StationTimes::flag
private

The stop flag: Origin, Terminate, or Transit.

Referenced by Flag(), operator=(), and StationTimes().