Model Railroad System  2.2.1
Public Member Functions | Private Attributes | List of all members
TTSupport::Cab Class Reference

This class maintains information about cabs. More...

#include <Cab.h>

Public Member Functions

 Cab (string name_="", string color_="")
 Construct a new cab. More...
 
 ~Cab ()
 Clean things up. More...
 
const char * Name () const
 Return the name of the cab. More...
 
const char * Color () const
 Return the color of the cab. More...
 
 Cab (const Cab &other)
 Copy constructor. More...
 
Caboperator= (const Cab &other)
 Assignment operator. More...
 
ostream & Write (ostream &stream) const
 Write object to a stream. More...
 
istream & Read (istream &stream)
 Read an object from a stream. More...
 

Private Attributes

string name
 The name of the cab. More...
 
string color
 The color of the cab. More...
 

Detailed Description

This class maintains information about cabs.

A cab has a color and a name.

Author
Robert Heller <heller@deepsoft.com>

Constructor & Destructor Documentation

◆ Cab() [1/2]

TTSupport::Cab::Cab ( string  name_ = "",
string  color_ = "" 
)
inline

Construct a new cab.

Parameters
name_The name of the new cab.
color_The color of the cab.

References color, and name.

◆ ~Cab()

TTSupport::Cab::~Cab ( )
inline

Clean things up.

◆ Cab() [2/2]

TTSupport::Cab::Cab ( const Cab other)
inline

Copy constructor.

Create a new cab as a copy of an existing cab.

Parameters
otherThe other cab.

References color, and name.

Member Function Documentation

◆ Color()

const char* TTSupport::Cab::Color ( ) const
inline

Return the color of the cab.

References color.

◆ Name()

const char* TTSupport::Cab::Name ( ) const
inline

Return the name of the cab.

References name.

◆ operator=()

Cab& TTSupport::Cab::operator= ( const Cab other)
inline

Assignment operator.

Assign one cab to another cab.

Parameters
otherThe other cab.

References color, and name.

◆ Read()

istream& TTSupport::Cab::Read ( istream &  stream)

Read an object from a stream.

Parameters
streamStream to read from.

◆ Write()

ostream& TTSupport::Cab::Write ( ostream &  stream) const

Write object to a stream.

Parameters
streamStream to write to.

Member Data Documentation

◆ color

string TTSupport::Cab::color
private

The color of the cab.

Referenced by Cab(), Color(), and operator=().

◆ name

string TTSupport::Cab::name
private

The name of the cab.

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