CStatDetector Class Reference

A class for the general Detector object that can be saved to file. More...

#include <StatDetector.h>

List of all members.

Public Member Functions

 CStatDetector ()
virtual ~CStatDetector ()
void Serialize (CArchive &ar)
std::string getStdStrMetricsDir ()
WORD getDetectorType ()
bool getDirPos ()
WORD getVehicleType ()
int getTimeInterval ()
int getLocation ()
void setMetricsDir (CString dir)
void setDetectorType (WORD type)
void setDirPos (bool dirpos)
void setVehicleType (WORD type)
void setTimeInterval (int interval)
void setLocation (int loc)

Private Attributes

CString m_MetricsDir
WORD m_DetectorType
bool m_DirPos
WORD m_VehicleType
int m_TimeInterval
int m_Location


Detailed Description

A class for the general Detector object that can be saved to file.

Definition at line 16 of file StatDetector.h.


Constructor & Destructor Documentation

CStatDetector::CStatDetector (  ) 

Definition at line 21 of file StatDetector.cpp.

References METRICS_TYPE_FLOWDENSITY, and METRICS_VEH_ALL.

00022 {
00023         m_DetectorType  = METRICS_TYPE_FLOWDENSITY;
00024         m_DirPos                = true;
00025         m_VehicleType   = METRICS_VEH_ALL;
00026         m_TimeInterval  = 60;
00027         m_Location              = 1000;
00028 }

CStatDetector::~CStatDetector (  )  [virtual]

Definition at line 30 of file StatDetector.cpp.

00031 {
00032 
00033 }


Member Function Documentation

void CStatDetector::Serialize ( CArchive &  ar  ) 

Definition at line 35 of file StatDetector.cpp.

References m_DetectorType, m_DirPos, m_Location, m_TimeInterval, and m_VehicleType.

00036 {
00037     if (ar.IsStoring())
00038     {
00039         ar      << m_DetectorType
00040                         << static_cast<int>(m_DirPos)   // because I read in an int below
00041                         << m_VehicleType
00042                         << m_TimeInterval
00043                         << m_Location;
00044     }
00045     else
00046         {
00047                 int temp;
00048         ar      >> m_DetectorType
00049                         >> temp
00050                         >> m_VehicleType
00051                         >> m_TimeInterval
00052                         >> m_Location;
00053 
00054                 m_DirPos = temp == 0 ? false : true;
00055         }
00056 }

std::string CStatDetector::getStdStrMetricsDir (  ) 

Definition at line 113 of file StatDetector.cpp.

References m_MetricsDir.

Referenced by Road::SetMetricDetFromStatDet().

00114 {
00115         std::string str = (LPCTSTR)m_MetricsDir;
00116         return str;
00117 }

WORD CStatDetector::getDetectorType (  ) 

bool CStatDetector::getDirPos (  ) 

Definition at line 63 of file StatDetector.cpp.

References m_DirPos.

Referenced by CEvolveTrafficView::DrawDetectors(), CStatDetectorDlg::LoadStatDetectorsIntoGrid(), and Road::SetMetricDetFromStatDet().

00064 {
00065         return m_DirPos;
00066 }

WORD CStatDetector::getVehicleType (  ) 

Definition at line 68 of file StatDetector.cpp.

References m_VehicleType.

Referenced by CStatDetectorDlg::LoadStatDetectorsIntoGrid(), and Road::SetMetricDetFromStatDet().

00069 {
00070         return m_VehicleType;
00071 }

int CStatDetector::getTimeInterval (  ) 

int CStatDetector::getLocation (  ) 

void CStatDetector::setMetricsDir ( CString  dir  ) 

Definition at line 108 of file StatDetector.cpp.

References m_MetricsDir.

Referenced by CEvolveTrafficDoc::initSim().

00109 {
00110         m_MetricsDir = dir;
00111 }

void CStatDetector::setDetectorType ( WORD  type  ) 

Definition at line 83 of file StatDetector.cpp.

References m_DetectorType.

Referenced by CStatDetectorDlg::SetParamData().

00084 {
00085         m_DetectorType = type;
00086 }

void CStatDetector::setDirPos ( bool  dirpos  ) 

Definition at line 88 of file StatDetector.cpp.

References m_DirPos.

Referenced by CStatDetectorDlg::SetParamData().

00089 {
00090         m_DirPos = dirpos;
00091 }

void CStatDetector::setVehicleType ( WORD  type  ) 

Definition at line 93 of file StatDetector.cpp.

References m_VehicleType.

Referenced by CStatDetectorDlg::SetParamData().

00094 {
00095         m_VehicleType = type;
00096 }

void CStatDetector::setTimeInterval ( int  interval  ) 

Definition at line 98 of file StatDetector.cpp.

References m_TimeInterval.

Referenced by CStatDetectorDlg::SetParamData().

00099 {
00100         m_TimeInterval = interval;
00101 }

void CStatDetector::setLocation ( int  loc  ) 

Definition at line 103 of file StatDetector.cpp.

References m_Location.

Referenced by CStatDetectorDlg::SetParamData().

00104 {
00105         m_Location = loc;
00106 }


Member Data Documentation

CString CStatDetector::m_MetricsDir [private]

Definition at line 43 of file StatDetector.h.

Referenced by getStdStrMetricsDir(), and setMetricsDir().

Definition at line 44 of file StatDetector.h.

Referenced by getDetectorType(), Serialize(), and setDetectorType().

bool CStatDetector::m_DirPos [private]

Definition at line 45 of file StatDetector.h.

Referenced by getDirPos(), Serialize(), and setDirPos().

Definition at line 46 of file StatDetector.h.

Referenced by getVehicleType(), Serialize(), and setVehicleType().

Definition at line 47 of file StatDetector.h.

Referenced by getTimeInterval(), Serialize(), and setTimeInterval().

Definition at line 48 of file StatDetector.h.

Referenced by getLocation(), Serialize(), and setLocation().


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

Generated on Wed Aug 20 00:48:46 2008 for EvolveTraffic by  doxygen 1.5.6