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

The CarType class represents a type of railroad car (rolling stock). More...

#include <CarType.h>

Public Types

enum  CarTypeConsts { NumberOfCarTypes = 91 , MaxCarTypes = 128 }
 Some specific constants relating to car types. More...
 

Public Member Functions

 CarType ()
 Default constructor. More...
 
 CarType (CarType &other)
 Copy constructor. More...
 
CarTypeoperator= (CarType &other)
 Assignment operaror. More...
 
 CarType (const char *c, const char *t, char g)
 Full constructor. More...
 
 ~CarType ()
 Destructor. More...
 
const char * Comment () const
 Return the car type's commentary. More...
 
const char * Type () const
 Return the car type name. More...
 
char Group () const
 Return the car type's group code. More...
 

Private Attributes

string comment
 The commentary string. More...
 
string type
 The type name. More...
 
char group
 The group code. More...
 

Friends

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

Detailed Description

The CarType class represents a type of railroad car (rolling stock).

Car types are represented as a single printable character and have associated with that printable character is a type name and possibly a short commentary.

Car types are also collected into groups as well.

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

Member Enumeration Documentation

◆ CarTypeConsts

Some specific constants relating to car types.

Enumerator
NumberOfCarTypes 

The number of usable car type characters.

MaxCarTypes 

The maximum number of car types (based on 7-bit ASCII).

Constructor & Destructor Documentation

◆ CarType() [1/3]

FCFSupport::CarType::CarType ( )
inline

Default constructor.

Create a default instance.

References comment, group, and type.

◆ CarType() [2/3]

FCFSupport::CarType::CarType ( CarType other)
inline

Copy constructor.

Copy a car type from another instance.

Parameters
otherThe other instance.

References comment, group, and type.

◆ CarType() [3/3]

FCFSupport::CarType::CarType ( const char *  c,
const char *  t,
char  g 
)
inline

Full constructor.

Create a fully quallified car type object.

Parameters
cThe name of the car type.
tThe brief commentary about the car type.
gThe car type's group code.

References comment, group, and type.

◆ ~CarType()

FCFSupport::CarType::~CarType ( )
inline

Destructor.

Member Function Documentation

◆ Comment()

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

Return the car type's commentary.

References comment.

◆ Group()

char FCFSupport::CarType::Group ( ) const
inline

Return the car type's group code.

References group.

◆ operator=()

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

Assignment operaror.

Copy a car type from another instance.

Parameters
otherThe other instance.

References comment, group, and type.

◆ Type()

const char* FCFSupport::CarType::Type ( ) const
inline

Return the car type name.

References type.

Friends And Related Function Documentation

◆ System

friend class System
friend

The System class is a friend.

Member Data Documentation

◆ comment

string FCFSupport::CarType::comment
private

The commentary string.

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

◆ group

char FCFSupport::CarType::group
private

The group code.

Referenced by CarType(), Group(), and operator=().

◆ type

string FCFSupport::CarType::type
private

The type name.

Referenced by CarType(), operator=(), and Type().