Model Railroad System 2.2.2
Classes | Public Member Functions | Private Attributes | Friends | List of all members
FCFSupport::SwitchListElement Class Reference

This class implements each switch list element. More...

#include <SwitchList.h>

Classes

union  StationOrIndustry
 A const pointer to a train's stop, which can be either a station or an industry, depending on what kind of train it is. More...
 

Public Member Functions

 SwitchListElement ()
 Default constructor. More...
 
 SwitchListElement (const SwitchListElement &other)
 Copy constructor. More...
 
SwitchListElementoperator= (const SwitchListElement &other)
 Assignment operator. More...
 
 SwitchListElement (const Industry *pickloc, const Car *pickcar, const Train *picktrain, const Train *lasttrain, const Industry *istop)
 Constructor, given a manifest freight's stop at an industry. More...
 
 SwitchListElement (const Industry *pickloc, const Car *pickcar, const Train *picktrain, const Train *lasttrain, const Station *sstop)
 Constructor, given a local freight's stop at a station. More...
 
const IndustryPickLocation () const
 Return the pickup location for this switch list element. More...
 
const CarPickCar () const
 Return the car picked up for this switch list element. More...
 
const TrainPickTrain () const
 Return the pickup train for this switch list element. More...
 
const TrainLastTrain () const
 Return the train train for the car this switch list element is for. More...
 
const IndustryDropStopIndustry () const
 Return the industry this switch list element is dropping off at. More...
 
const StationDropStopStation () const
 Return the station this switch list element is dropping off at. More...
 
bool DropStopEQ (int Px) const
 Is the drop stop at the stop number specified? More...
 

Private Attributes

const IndustrypickLoc
 The pickup industry. More...
 
const CarpickCar
 The car picked up. More...
 
const TrainpickTrain
 The train picking this car up. More...
 
const TrainlastTrain
 The train that previously handled this car. More...
 
StationOrIndustry dropStop
 The station or industry where this car will be dropped off at. More...
 

Friends

class System
 The System class is a friend. More...
 

Detailed Description

This class implements each switch list element.

Author
Robert Heller <heller@deepsoft.com>

Constructor & Destructor Documentation

◆ SwitchListElement() [1/4]

FCFSupport::SwitchListElement::SwitchListElement ( )
inline

Default constructor.

Initialise all slots to NULL.

References dropStop, FCFSupport::SwitchListElement::StationOrIndustry::industry, lastTrain, pickCar, pickLoc, and pickTrain.

◆ SwitchListElement() [2/4]

FCFSupport::SwitchListElement::SwitchListElement ( const SwitchListElement other)
inline

Copy constructor.

Parameters
otherThe other switch list element.

References dropStop, FCFSupport::SwitchListElement::StationOrIndustry::industry, lastTrain, pickCar, pickLoc, and pickTrain.

◆ SwitchListElement() [3/4]

FCFSupport::SwitchListElement::SwitchListElement ( const Industry pickloc,
const Car pickcar,
const Train picktrain,
const Train lasttrain,
const Industry istop 
)
inline

Constructor, given a manifest freight's stop at an industry.

Parameters
picklocPickup location of car.
pickcarCar being picked up by this train.
picktrainTrain picking this car up.
lasttrainThe last train this car was on.
istopWhere this train will drop this car.

References dropStop, FCFSupport::SwitchListElement::StationOrIndustry::industry, lastTrain, pickCar, pickLoc, and pickTrain.

◆ SwitchListElement() [4/4]

FCFSupport::SwitchListElement::SwitchListElement ( const Industry pickloc,
const Car pickcar,
const Train picktrain,
const Train lasttrain,
const Station sstop 
)
inline

Constructor, given a local freight's stop at a station.

Parameters
picklocPickup location of car.
pickcarCar being picked up by this train.
picktrainTrain picking this car up.
lasttrainThe last train this car was on.
sstopWhere this train will drop this car.

References dropStop, lastTrain, pickCar, pickLoc, pickTrain, and FCFSupport::SwitchListElement::StationOrIndustry::station.

Member Function Documentation

◆ DropStopEQ()

bool FCFSupport::SwitchListElement::DropStopEQ ( int  Px) const
inline

◆ DropStopIndustry()

const Industry * FCFSupport::SwitchListElement::DropStopIndustry ( ) const
inline

Return the industry this switch list element is dropping off at.

References dropStop, FCFSupport::SwitchListElement::StationOrIndustry::industry, FCFSupport::Train::Manifest, pickTrain, and FCFSupport::Train::Type().

◆ DropStopStation()

const Station * FCFSupport::SwitchListElement::DropStopStation ( ) const
inline

◆ LastTrain()

const Train * FCFSupport::SwitchListElement::LastTrain ( ) const
inline

Return the train train for the car this switch list element is for.

References lastTrain.

◆ operator=()

SwitchListElement & FCFSupport::SwitchListElement::operator= ( const SwitchListElement other)
inline

Assignment operator.

Parameters
otherThe other switch list element.

References dropStop, FCFSupport::SwitchListElement::StationOrIndustry::industry, lastTrain, pickCar, pickLoc, and pickTrain.

◆ PickCar()

const Car * FCFSupport::SwitchListElement::PickCar ( ) const
inline

Return the car picked up for this switch list element.

References pickCar.

◆ PickLocation()

const Industry * FCFSupport::SwitchListElement::PickLocation ( ) const
inline

Return the pickup location for this switch list element.

References pickLoc.

◆ PickTrain()

const Train * FCFSupport::SwitchListElement::PickTrain ( ) const
inline

Return the pickup train for this switch list element.

References pickTrain.

Friends And Related Function Documentation

◆ System

friend class System
friend

The System class is a friend.

Member Data Documentation

◆ dropStop

StationOrIndustry FCFSupport::SwitchListElement::dropStop
private

The station or industry where this car will be dropped off at.

Referenced by DropStopEQ(), DropStopIndustry(), DropStopStation(), operator=(), and SwitchListElement().

◆ lastTrain

const Train* FCFSupport::SwitchListElement::lastTrain
private

The train that previously handled this car.

Referenced by LastTrain(), operator=(), and SwitchListElement().

◆ pickCar

const Car* FCFSupport::SwitchListElement::pickCar
private

The car picked up.

Referenced by operator=(), PickCar(), and SwitchListElement().

◆ pickLoc

const Industry* FCFSupport::SwitchListElement::pickLoc
private

The pickup industry.

Referenced by operator=(), PickLocation(), and SwitchListElement().

◆ pickTrain

const Train* FCFSupport::SwitchListElement::pickTrain
private

The train picking this car up.

Referenced by DropStopEQ(), DropStopIndustry(), DropStopStation(), operator=(), PickTrain(), and SwitchListElement().