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

The Division class implements a single division, which contains a number of contigious stations. More...

#include <Division.h>

Public Member Functions

 Division ()
 Default constructor. More...
 
 Division (Division &other)
 Copy constructor. More...
 
Divisionoperator= (Division &other)
 Assignment operator. More...
 
 Division (char s, FCFSupport::Industry *h, char a, const char *n)
 Constructor given a set of field values. More...
 
 ~Division ()
 Destructor. More...
 
const char * Name () const
 Return the division's name. More...
 
FCFSupport::IndustryHome () const
 Return the division's home yard. More...
 
char Symbol () const
 Return the division's Symbol. More...
 
char Area () const
 Return the division's area. More...
 
int NumberOfStations () const
 Return the number of stations in this division. More...
 
const FCFSupport::StationTheStation (int i) const
 Return a selected station in the division. More...
 
void AppendStation (FCFSupport::Station *station)
 Append an additional station to this division. More...
 

Private Attributes

string name
 The name of the division. More...
 
StationVector stations
 The vector of stations in the division. More...
 
Industryhome
 The division's home yard. More...
 
char symbol
 The division's symbol. More...
 
char area
 The division's area. More...
 

Friends

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

Detailed Description

The Division class implements a single division, which contains a number of contigious stations.

A division has a name, a symbol, an area, a home yard,and a list of stations.

@author Robert Heller \<heller\@deepsoft.com\>

Constructor & Destructor Documentation

◆ Division() [1/3]

FCFSupport::Division::Division ( )
inline

Default constructor.

All fields are initialized to empty or NULL values.

References area, home, name, and symbol.

◆ Division() [2/3]

FCFSupport::Division::Division ( Division other)
inline

Copy constructor.

A new division is created as a copy of an existing division.

Parameters
otherThe other division.

References area, home, name, stations, and symbol.

◆ Division() [3/3]

FCFSupport::Division::Division ( char  s,
FCFSupport::Industry h,
char  a,
const char *  n 
)
inline

Constructor given a set of field values.

Parameters
sThe division's symbol.
hThe division's home yard.
aThe division's area.
nThe division's name.

References area, home, name, and symbol.

◆ ~Division()

FCFSupport::Division::~Division ( )
inline

Destructor.

Member Function Documentation

◆ AppendStation()

void FCFSupport::Division::AppendStation ( FCFSupport::Station station)
inline

Append an additional station to this division.

Parameters
stationThe station to append.

References stations.

◆ Area()

char FCFSupport::Division::Area ( ) const
inline

Return the division's area.

References area.

◆ Home()

FCFSupport::Industry * FCFSupport::Division::Home ( ) const
inline

Return the division's home yard.

References home.

◆ Name()

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

Return the division's name.

References name.

◆ NumberOfStations()

int FCFSupport::Division::NumberOfStations ( ) const
inline

Return the number of stations in this division.

References stations.

◆ operator=()

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

Assignment operator.

Copy one division to another.

Parameters
otherThe other division.

References area, home, name, stations, and symbol.

◆ Symbol()

char FCFSupport::Division::Symbol ( ) const
inline

Return the division's Symbol.

References symbol.

◆ TheStation()

const FCFSupport::Station * FCFSupport::Division::TheStation ( int  i) const
inline

Return a selected station in the division.

Parameters
iThe station index.

References i, and stations.

Friends And Related Function Documentation

◆ System

friend class System
friend

The System class is a friend.

Member Data Documentation

◆ area

char FCFSupport::Division::area
private

The division's area.

Referenced by Area(), Division(), and operator=().

◆ home

Industry* FCFSupport::Division::home
private

The division's home yard.

Referenced by Division(), Home(), and operator=().

◆ name

string FCFSupport::Division::name
private

The name of the division.

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

◆ stations

StationVector FCFSupport::Division::stations
private

The vector of stations in the division.

Referenced by AppendStation(), Division(), NumberOfStations(), operator=(), and TheStation().

◆ symbol

char FCFSupport::Division::symbol
private

The division's symbol.

Referenced by Division(), operator=(), and Symbol().