Model Railroad System
2.2.1
|
The Station class implements a station. More...
#include <Station.h>
Public Member Functions | |
Station (string name_="Unknown", double smile_=0) | |
Construct a station object, given a name and a scale mile location. More... | |
Station (const Station &other) | |
Copy constructor. More... | |
Station & | operator= (const Station &other) |
Assignment operator. More... | |
~Station () | |
Destructor. More... | |
const char * | Name () const |
Return the name of the station. More... | |
double | SMile () const |
Return the scale mile of the station. More... | |
int | DuplicateStationIndex () const |
Return the duplicate station index. More... | |
void | SetDuplicateStationIndex (int index) |
Set the duplication station index. More... | |
StorageTrack * | AddStorageTrack (string name_) |
Add a storage track. More... | |
StorageTrack * | FindStorageTrack (string name) |
Find a storage track by name. More... | |
StorageTrack * | FindTrackTrainIsStoredOn (string trainNumber, double fromtime, double totime) |
Find track a train is stored on. More... | |
int | NumberOfStorageTracks () const |
Number of storage tracks. More... | |
StorageTrackMap::const_iterator | FirstStorageTrack () const |
Return a const_iterator for the first element in the storage track map. More... | |
StorageTrackMap::const_iterator | LastStorageTrack () const |
Return a const_iterator for the last element in the storage track map. More... | |
ostream & | Write (ostream &stream) const |
Write object to a stream. More... | |
istream & | Read (istream &stream) |
Read an object from a stream. More... | |
Private Attributes | |
string | name |
Station name. More... | |
StorageTrackMap | storageTracks |
Storage track map. More... | |
double | smile |
Scale Mile. More... | |
int | duplicateStationIndex |
Duplicate station index. More... | |
The Station class implements a station.
Stations are not specifically passenger stations, but are any place where trains stop or meet or might just be important mile post locations used for time keeping checks. They also can be just sidings.
|
inline |
Construct a station object, given a name and a scale mile location.
name_ | The name of the station. |
smile_ | The scale mile location of the station. |
References duplicateStationIndex, name, and smile.
|
inline |
Copy constructor.
Copy one station to another.
other | The other station. |
References duplicateStationIndex, name, smile, and storageTracks.
|
inline |
Destructor.
StorageTrack* TTSupport::Station::AddStorageTrack | ( | string | name_ | ) |
Add a storage track.
name_ | The name of the storage track. |
|
inline |
Return the duplicate station index.
This is the index of another station that is the physical duplicate of this one. Only meaningful on out-and-back type layouts or other layout configurations where stations are logically duplicated due to trackage having dual meaning.
References duplicateStationIndex.
|
inline |
Find a storage track by name.
name | The name of the storage track. |
References name, and storageTracks.
StorageTrack* TTSupport::Station::FindTrackTrainIsStoredOn | ( | string | trainNumber, |
double | fromtime, | ||
double | totime | ||
) |
Find track a train is stored on.
trainNumber | The train number (symbol) to search for. |
fromtime | The from time to check. |
totime | The to time to check. |
|
inline |
Return a const_iterator for the first element in the storage track map.
References storageTracks.
|
inline |
Return a const_iterator for the last element in the storage track map.
References storageTracks.
|
inline |
Return the name of the station.
References name.
|
inline |
Number of storage tracks.
Assignment operator.
Assign one station to another.
other | The other station. |
References duplicateStationIndex, name, smile, and storageTracks.
istream& TTSupport::Station::Read | ( | istream & | stream | ) |
Read an object from a stream.
stream | Stream to read from. |
|
inline |
Set the duplication station index.
index | The index of the duplicate station. |
References duplicateStationIndex.
|
inline |
Return the scale mile of the station.
References smile.
ostream& TTSupport::Station::Write | ( | ostream & | stream | ) | const |
Write object to a stream.
stream | Stream to write to. |
|
private |
Duplicate station index.
Referenced by DuplicateStationIndex(), operator=(), SetDuplicateStationIndex(), and Station().
|
private |
Station name.
Referenced by FindStorageTrack(), Name(), operator=(), and Station().
|
private |
Scale Mile.
Referenced by operator=(), SMile(), and Station().
|
private |
Storage track map.
Referenced by FindStorageTrack(), FirstStorageTrack(), LastStorageTrack(), operator=(), and Station().