Detector Class Reference

A class representing a detector on the road. More...

#include <Detector.h>

Collaboration diagram for Detector:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void setFileHandler (FileHandler *fh)
 Sets the detector's filehandler.
void WriteVehiclesToFile ()
 Writes the detector's vehicles to file.
bool getDirection ()
 Gets the direction of the detector.
void clear ()
 Clears all the detector's current vehicles.
int getPos ()
 Gets the position of the detector.
std::vector< Vehicle * > getVehicles ()
 Gets all the vehicles currently past the detector.
void addVehicle (Vehicle *pVeh)
 Adds a vehicle to the detector.
 Detector (int loc, bool DirPos, FileHandler *fh)
 Constructor.
virtual ~Detector ()
 Default Desctructor.

Private Attributes

FileHandlerm_pFileHandler
int m_Location
bool m_DirPos
std::vector< Vehicle * > m_Vehicles


Detailed Description

A class representing a detector on the road.

Constructor & Destructor Documentation

Detector::Detector ( int  loc,
bool  DirPos,
FileHandler fh 
)

Constructor.

Parameters:
loc The location of the detector
DirPos Whether or not the detector is in the positive direction
fh The filehandler to use

Detector::~Detector (  )  [virtual]

Default Desctructor.


Member Function Documentation

void Detector::setFileHandler ( FileHandler fh  ) 

Sets the detector's filehandler.

Parameters:
fh The filehandler to use

void Detector::WriteVehiclesToFile (  ) 

Writes the detector's vehicles to file.

bool Detector::getDirection (  ) 

Gets the direction of the detector.

Returns:
Whether or not the detector is in the positive direction

void Detector::clear (  ) 

Clears all the detector's current vehicles.

int Detector::getPos (  ) 

Gets the position of the detector.

Returns:
The detector's position

std::vector< Vehicle * > Detector::getVehicles (  ) 

Gets all the vehicles currently past the detector.

Returns:
All the vehicles currently past the detector

void Detector::addVehicle ( Vehicle pVeh  ) 

Adds a vehicle to the detector.

Parameters:
pVeh The vehicle to add


Member Data Documentation

int Detector::m_Location [private]

bool Detector::m_DirPos [private]

std::vector<Vehicle*> Detector::m_Vehicles [private]


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

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