|
Model Railroad System 2.2.2
|
This class records a train sitting on a storage track during a specified time frame. More...
#include <Station.h>
Public Member Functions | |
| Occupied (string trainnum_="", double from_=0.0, double until_=0.0, string trainnum2_="") | |
| Constructor: record a train occupying a storage track. More... | |
| const char * | TrainNum () const |
| Return the train that arrives. More... | |
| const char * | TrainNum2 () const |
| Return the train that departs. More... | |
| double | From () const |
| Return the start time;. More... | |
| double | Until () const |
| Return the end time. More... | |
| Occupied (const Occupied &other) | |
| Copy constructor – create an instance from another Occupied instance. More... | |
| Occupied & | operator= (const Occupied &other) |
| Assignment operator. More... | |
| ostream & | Write (ostream &stream) const |
| Write ourselves to an output stream. More... | |
| istream & | Read (istream &stream) |
| Read ourselves from an input stream. More... | |
Private Attributes | |
| string | trainnum |
| The train that arrived. More... | |
| string | trainnum2 |
| The train that departs. More... | |
| double | from |
| The start time of the occupation. More... | |
| double | until |
| The end time of the occupation. More... | |
Friends | |
| class | TimeTableSystem |
| We are best buddies with the TimeTableSystem class. More... | |
This class records a train sitting on a storage track during a specified time frame.
The train number (symbol) might change when the train leaves the storage track.
|
inline |
Constructor: record a train occupying a storage track.
| trainnum_ | The arriving train number (symbol). |
| from_ | The arrival time. |
| until_ | The departure time. |
| trainnum2_ | The departing train number (symbol). If it is the empty string, the departing train has the same number (symbol) as the arriving train. |
|
inline |
|
inline |
Return the start time;.
References from.
| istream & TTSupport::Occupied::Read | ( | istream & | stream | ) |
Read ourselves from an input stream.
| stream | The stream to read from. |
|
inline |
Return the train that arrives.
References trainnum.
|
inline |
Return the train that departs.
References trainnum2.
|
inline |
Return the end time.
References until.
| ostream & TTSupport::Occupied::Write | ( | ostream & | stream | ) | const |
Write ourselves to an output stream.
| stream | The stream to write to. |
|
friend |
We are best buddies with the TimeTableSystem class.
|
private |
The start time of the occupation.
Referenced by From(), Occupied(), and operator=().
|
private |
The train that arrived.
Referenced by Occupied(), operator=(), and TrainNum().
|
private |
The train that departs.
Referenced by Occupied(), operator=(), and TrainNum2().
|
private |
The end time of the occupation.
Referenced by Occupied(), operator=(), and Until().