Model Railroad System
2.2.1
|
The global switch list structure. More...
#include <SwitchList.h>
Public Member Functions | |
SwitchList () | |
Constructor. More... | |
~SwitchList () | |
Destructor. More... | |
void | ResetSwitchList () |
Reset the switch list pointer. More... | |
void | DiscardSwitchList () |
Clobber the switch list. More... | |
void | AddSwitchListElement (const Industry *pickloc, const Car *pickcar, const Train *picktrain, const Train *lasttrain, const Industry *istop) |
Add a switch list element for a manifest freight (industry stop). More... | |
void | AddSwitchListElement (const Industry *pickloc, const Car *pickcar, const Train *picktrain, const Train *lasttrain, const Station *sstop) |
Add a switch list element for a local freight (station stop). More... | |
SwitchListElement & | operator[] (int ielement) |
Random index access to the switch list. More... | |
const SwitchListElement | operator[] (int ielement) const |
Random index access to the switch list, const version. More... | |
int | NextSwitchListForCarAndIndustry (const Car *car, const Industry *industry) |
Return the next switch list list element for a selected car and industry. More... | |
unsigned int | PickIndex () const |
Return the pick index. More... | |
int | LimitCars () const |
Return the limit count. More... | |
void | ResetLastIndex () |
Reset the last index. More... | |
bool | PickLocationEq (int Gx, const Industry *Ix) const |
Is the selected element for the specificed industry? More... | |
bool | PickCarEq (int Gx, const Car *Cx) const |
Is the selected element for the specificed car? More... | |
bool | PickTrainEq (int Gx, const Train *Tx) const |
Is the selected element for the specificed train? More... | |
Private Attributes | |
SwitchListElementVector | theList |
The switch list vector. More... | |
unsigned int | pickIndex |
The pick index. More... | |
int | limitCars |
The limit index. More... | |
int | lastIndex |
The last index. More... | |
Friends | |
ostream & | operator<< (ostream &stream, const SwitchList &list) |
Output stream operator for switch lists. More... | |
The global switch list structure.
FCFSupport::SwitchList::SwitchList | ( | ) |
Constructor.
FCFSupport::SwitchList::~SwitchList | ( | ) |
Destructor.
void FCFSupport::SwitchList::DiscardSwitchList | ( | ) |
Clobber the switch list.
|
inline |
Return the limit count.
int FCFSupport::SwitchList::NextSwitchListForCarAndIndustry | ( | const Car * | car, |
const Industry * | industry | ||
) |
Return the next switch list list element for a selected car and industry.
car | The selected car. |
industry | The selected industry. |
SwitchListElement& FCFSupport::SwitchList::operator[] | ( | int | ielement | ) |
Random index access to the switch list.
ielement | The index into the switch list. |
const SwitchListElement FCFSupport::SwitchList::operator[] | ( | int | ielement | ) | const |
Random index access to the switch list, const version.
ielement | The index into the switch list. |
bool FCFSupport::SwitchList::PickCarEq | ( | int | Gx, |
const Car * | Cx | ||
) | const |
Is the selected element for the specificed car?
Gx | The index to check. |
Cx | The car to check for. |
|
inline |
Return the pick index.
bool FCFSupport::SwitchList::PickLocationEq | ( | int | Gx, |
const Industry * | Ix | ||
) | const |
Is the selected element for the specificed industry?
Gx | The index to check. |
Ix | The industry to check for. |
bool FCFSupport::SwitchList::PickTrainEq | ( | int | Gx, |
const Train * | Tx | ||
) | const |
Is the selected element for the specificed train?
Gx | The index to check. |
Tx | The train to check for. |
|
inline |
Reset the last index.
References FCFSupport::operator<<(), and lcc::stream.
void FCFSupport::SwitchList::ResetSwitchList | ( | ) |
Reset the switch list pointer.
|
friend |
Output stream operator for switch lists.
stream | The stream to write to. |
list | The switch list to write out. |
|
private |
The last index.
|
private |
The limit index.
|
private |
The pick index.
|
private |
The switch list vector.