Model Railroad System  2.2.1
Public Member Functions | Private Attributes | Friends | List of all members
FCFSupport::Station Class Reference

The Station class implements a single station. More...

#include <Station.h>

Public Member Functions

 Station ()
 Default constructor. More...
 
 Station (const Station &other)
 Copy constructor, copy from another station instance. More...
 
Stationoperator= (Station &other)
 Assignment operator, copy from another station instance. More...
 
 Station (const char *n, Division *d, const char *c)
 Full constructor. More...
 
 ~Station ()
 Destructor. More...
 
const char * Name () const
 Return the station's name. More...
 
DivisionMyDivision () const
 Return the station's division. More...
 
const char * Comment () const
 Return the station's comment. More...
 
int NumberOfIndustries () const
 Return the number of industries at this station. More...
 
FCFSupport::IndustryTheIndustry (int i) const
 Return the Ith industry at this station. More...
 
int AppendIndustry (FCFSupport::Industry *industry)
 Append an industry to this station's list of industries. More...
 

Private Attributes

string name
 The station's name. More...
 
string comment
 The station's comment. More...
 
Divisiondivision
 The station's division. More...
 
vector< Industry * > industries
 The list of industries at this station. More...
 

Friends

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

Detailed Description

The Station class implements a single station.

A station exists within a division and contains a number of industries.
A Station has a name, a comment, it belongs to a division, and has a list of industries.

Author
Robert Heller <heller@deepsoft.com>

Constructor & Destructor Documentation

◆ Station() [1/3]

FCFSupport::Station::Station ( )
inline

Default constructor.

Initialize all slots to empty values.

References comment, division, and name.

◆ Station() [2/3]

FCFSupport::Station::Station ( const Station other)
inline

Copy constructor, copy from another station instance.

Parameters
otherThe other station instance.

References comment, division, industries, and name.

◆ Station() [3/3]

FCFSupport::Station::Station ( const char *  n,
Division d,
const char *  c 
)
inline

Full constructor.

Create a fresh station instance, given a name, division, and a comment. Initially, the industry list is empty.

Parameters
nThe new station's name.
dThe division the station belongs to.
cA comment string.

References comment, division, and name.

◆ ~Station()

FCFSupport::Station::~Station ( )
inline

Destructor.

Member Function Documentation

◆ AppendIndustry()

int FCFSupport::Station::AppendIndustry ( FCFSupport::Industry industry)
inline

Append an industry to this station's list of industries.

Parameters
industryThe industry to append.

References industries.

◆ Comment()

const char* FCFSupport::Station::Comment ( ) const
inline

Return the station's comment.

References comment.

◆ MyDivision()

Division* FCFSupport::Station::MyDivision ( ) const
inline

Return the station's division.

References division.

◆ Name()

const char* FCFSupport::Station::Name ( ) const
inline

Return the station's name.

References name.

◆ NumberOfIndustries()

int FCFSupport::Station::NumberOfIndustries ( ) const
inline

Return the number of industries at this station.

References industries.

◆ operator=()

Station& FCFSupport::Station::operator= ( Station other)
inline

Assignment operator, copy from another station instance.

Parameters
otherThe other station instance.

References comment, division, industries, and name.

◆ TheIndustry()

FCFSupport::Industry* FCFSupport::Station::TheIndustry ( int  i) const
inline

Return the Ith industry at this station.

Parameters
iThe industry index.

References i, and industries.

Friends And Related Function Documentation

◆ System

friend class System
friend

The System class is a friend.

Member Data Documentation

◆ comment

string FCFSupport::Station::comment
private

The station's comment.

Referenced by Comment(), operator=(), and Station().

◆ division

Division* FCFSupport::Station::division
private

The station's division.

Referenced by MyDivision(), operator=(), and Station().

◆ industries

vector<Industry *> FCFSupport::Station::industries
private

The list of industries at this station.

Referenced by AppendIndustry(), NumberOfIndustries(), operator=(), Station(), and TheIndustry().

◆ name

string FCFSupport::Station::name
private

The station's name.

Referenced by Name(), operator=(), and Station().