Truck Class Reference

A class to represent a Truck. More...

#include <Truck.h>

Inheritance diagram for Truck:

Inheritance graph
[legend]
Collaboration diagram for Truck:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void doSAFTData (char *pTruck)
 Prepares a truck for printing to a SAFT file.
void doCASTORData (char *pTruck)
 Prepares a truck for printing to a CASTOR file.
void createSAFTTruck (std::string data)
 Creates a truck from a given SAFT string.
void createCASTORTruck (std::string data)
 Creates a truck from a given CASTOR string.
void setDriver ()
void setNoAxles (int axNo)
 Sets the truck's number of axles to a given number.
void setGVW (double weight)
 Sets the GVW of the truck to a given weight.
 Truck ()
 Default constructor.
virtual ~Truck ()
 Default destructor.
void setAW (int i, double w)
 Sets the weight of a given axle.
void setAS (int i, double s)
 Sets the spacing of a given axle.
double getGVW ()
 Gets the GVW of the truck.
int getNoAxles ()
 Gets the truck's number of axles.
double getAS (int i)
 Gets the spacing of a given axle.
double getAW (int i)
 Gets the weight of a given axle.
bool operator== (Truck &x)
bool operator< (const Truck &x)
double getTime () const
 Gets the current time of the truck in seconds.
void returnTruckData (int truckData[])
 Parses the Truck's data into an array.

Private Attributes

std::vector< Axle * > axles
int noAxles
double overhangFront
double overhangBack
double GVW
int hour
int min
int sec
int hndt
int day
int month
int year
int trns
int TimeMod
int head
int order
int dir


Detailed Description

A class to represent a Truck.

Constructor & Destructor Documentation

Truck::Truck (  ) 

Default constructor.

Default Constructor.

Truck::~Truck (  )  [virtual]

Default destructor.

Default Destructor.


Member Function Documentation

void Truck::doSAFTData ( char *  pTruck  )  [virtual]

Prepares a truck for printing to a SAFT file.

Parameters:
pTruck The string of data to represent the truck
This function takes in a string, and writes all of its properties to the string in SAFT format, in order to prepare for printing of the truck

Reimplemented from Vehicle.

void Truck::doCASTORData ( char *  pTruck  )  [virtual]

Prepares a truck for printing to a CASTOR file.

Parameters:
pTruck The string of data to represent the truck
This function takes in a string, and writes all of its properties to the string in CASTOR format, in order to prepare for printing of the truck

Reimplemented from Vehicle.

void Truck::createSAFTTruck ( std::string  data  ) 

Creates a truck from a given SAFT string.

Parameters:
data The SAFT string of data
This function takes in a string from a SAFT file and creates a truck based on the properties supplied by the data string

void Truck::createCASTORTruck ( std::string  data  ) 

Creates a truck from a given CASTOR string.

Parameters:
data The CASTOR string of data
This function takes in a string from a CASTOR file and creates a truck based on the properties supplied by the data string

void Truck::setDriver (  ) 

void Truck::setNoAxles ( int  axNo  ) 

Sets the truck's number of axles to a given number.

Parameters:
axNo the desired number of axles
This function sets the Truck's number of Axles and current differentiates between large and small trucks based on the number of Axles

void Truck::setGVW ( double  weight  ) 

Sets the GVW of the truck to a given weight.

Parameters:
weight the desired GVW

void Truck::setAW ( int  i,
double  w 
)

Sets the weight of a given axle.

Parameters:
i the axle to operate upon
w the desired weight

void Truck::setAS ( int  i,
double  s 
)

Sets the spacing of a given axle.

The space of a given axle to the next axle

Parameters:
i the axle to operate upon
s the desired spacing

double Truck::getGVW (  ) 

Gets the GVW of the truck.

Returns:
the GVW of the truck

int Truck::getNoAxles (  ) 

Gets the truck's number of axles.

Returns:
the truck's number of axles

double Truck::getAS ( int  i  ) 

Gets the spacing of a given axle.

The space of a given axle to the next axle

Parameters:
i the axle to operate upon
Returns:
the space between this axle and the next

double Truck::getAW ( int  i  ) 

Gets the weight of a given axle.

Parameters:
i the axle to operate upon
Returns:
the weight of the axle

bool Truck::operator== ( Truck x  ) 

bool Truck::operator< ( const Truck x  ) 

double Truck::getTime (  )  const

Gets the current time of the truck in seconds.

Returns:
The time of the truck in seconds

void Truck::returnTruckData ( int  truckData[]  ) 

Parses the Truck's data into an array.


Member Data Documentation

std::vector<Axle*> Truck::axles [private]

int Truck::noAxles [private]

double Truck::overhangFront [private]

double Truck::overhangBack [private]

double Truck::GVW [private]

int Truck::hour [private]

int Truck::min [private]

int Truck::sec [private]

int Truck::hndt [private]

int Truck::day [private]

int Truck::month [private]

int Truck::year [private]

int Truck::trns [private]

int Truck::TimeMod [private]

int Truck::head [private]

int Truck::order [private]

int Truck::dir [private]


The documentation for this class was generated from the following files:

Generated on Fri Jul 25 16:11:22 2008 for EvolveTraffic by  doxygen 1.5.6