|
Model Railroad System 2.2.2
|
This class implements a stop. More...
#include <Train.h>
Public Types | |
| enum | FlagType { Origin , Terminate , Transit } |
| Type of stop. More... | |
Public Member Functions | |
| Stop (int stationindex_=0, FlagType flag_=Origin) | |
| Constructor: create a new stop. More... | |
| Stop (const Stop &other) | |
| Copy constructor, create a stop from another stop. More... | |
| Stop & | operator= (const Stop &other) |
| Assignment operator, assign one stop to another stop. More... | |
| ~Stop () | |
| Destructor. More... | |
| double | Layover () const |
| Return layover period. More... | |
| void | SetLayover (double period) |
| Update layover period. More... | |
| double | Departure (double arrival) const |
| Return departure time. More... | |
| int | StationIndex () const |
| Return the station index. More... | |
| Cab * | TheCab () const |
| Return the cab. More... | |
| void | SetCab (Cab *newcab) |
| Update the cab. More... | |
| int | NumberOfNotes () const |
| Return the number of notes. More... | |
| int | Note (int i) const |
| Return the ith note. More... | |
| void | AddNote (int note) |
| Add a note. More... | |
| void | RemoveNote (int note) |
| Remove note. More... | |
| FlagType | Flag () const |
| Return the flag. More... | |
| const char * | StorageTrackName () const |
| Return storage track name. More... | |
| void | SetStorageTrackName (string name) |
| Update storage track name. More... | |
| ostream & | Write (ostream &stream) const |
| Write object to a stream. More... | |
| istream & | Read (istream &stream, const CabNameMap cabs) |
| Read an object from a stream. More... | |
Private Attributes | |
| double | layover |
| The layover time. More... | |
| int | stationindex |
| The station index. More... | |
| Cab * | cab |
| The Cab object. More... | |
| vector< int > | notes |
| The vector of note numbers. More... | |
| FlagType | flag |
| The type of stop, originating, terminating, or passing through. More... | |
| string | storageTrackName |
| The storage track name. More... | |
This class implements a stop.
This specifies the station the train goes through, even if it does not actually stop. A layover of 0 means the train does not stop and this station is a timekeeping check point.
Constructor: create a new stop.
| stationindex_ | The index of the station. |
| flag_ | The type of stop (originating, terminating, or passing through). |
References cab, flag, layover, stationindex, and storageTrackName.
|
inline |
Copy constructor, create a stop from another stop.
| other | The other stop. |
References cab, flag, layover, notes, stationindex, and storageTrackName.
|
inline |
Destructor.
|
inline |
|
inline |
Return departure time.
This is just the layover period added to the arrival time.
| arrival | The arrival time. |
References layover.
|
inline |
Return layover period.
References layover.
|
inline |
|
inline |
Return the number of notes.
References notes.
Assignment operator, assign one stop to another stop.
| other | The other stop. |
References cab, flag, layover, notes, stationindex, and storageTrackName.
| istream & TTSupport::Stop::Read | ( | istream & | stream, |
| const CabNameMap | cabs | ||
| ) |
Read an object from a stream.
| stream | Stream to read from. |
| cabs | Map of cab names. |
|
inline |
|
inline |
|
inline |
|
inline |
Update storage track name.
| name | The name of the storage track. |
References storageTrackName.
|
inline |
Return the station index.
References stationindex.
|
inline |
Return storage track name.
References storageTrackName.
| ostream & TTSupport::Stop::Write | ( | ostream & | stream | ) | const |
Write object to a stream.
| stream | Stream to write to. |
|
private |
The Cab object.
Referenced by operator=(), SetCab(), Stop(), and TheCab().
|
private |
The type of stop, originating, terminating, or passing through.
Referenced by Flag(), operator=(), and Stop().
|
private |
The layover time.
Referenced by Departure(), Layover(), operator=(), SetLayover(), and Stop().
|
private |
The vector of note numbers.
Referenced by AddNote(), Note(), NumberOfNotes(), operator=(), RemoveNote(), and Stop().
|
private |
The station index.
Referenced by operator=(), StationIndex(), and Stop().
|
private |
The storage track name.
Referenced by operator=(), SetStorageTrackName(), Stop(), and StorageTrackName().