00001 00003 #include "CDigitizerDictionary.h" 00004 #include "CReadableObject.h" 00005 00010 CDigitizerDictionary::CDigitizerDictionary () 00011 { 00012 } 00013 00019 CDigitizerDictionary::~CDigitizerDictionary ( ) //Destructor - Delete dynamic objects 00020 { 00021 DestroyMap(); 00022 } 00023 // Functions for class CDigitizerDictionary 00024 00032 CDigitizerDictionary::ModuleIterator 00033 CDigitizerDictionary::DigitizerBegin() 00034 { 00035 return m_Modules.begin(); 00036 } 00037 00045 CDigitizerDictionary::ModuleIterator 00046 CDigitizerDictionary::DigitizerEnd() 00047 { 00048 return m_Modules.end(); 00049 } 00050 00056 int 00057 CDigitizerDictionary::DigitizerSize() 00058 { 00059 return m_Modules.size(); 00060 } 00061 00069 void 00070 CDigitizerDictionary::DigitizerAdd(CReadableObject* pDigitizer) 00071 { 00072 if(pDigitizer) { 00073 m_Modules[pDigitizer->getName()] = pDigitizer; 00074 } 00075 } 00076 00083 CDigitizerDictionary::ModuleIterator 00084 CDigitizerDictionary::DigitizerFind(const string& rName) 00085 { 00086 return m_Modules.find(rName); 00087 } 00094 void 00095 CDigitizerDictionary::DestroyMap() 00096 { 00097 CDigitizerDictionary::ModuleIterator p = DigitizerBegin(); 00098 while(p != DigitizerEnd()) { 00099 (p->second)->OnDelete(); 00100 delete p->second; 00101 p++; 00102 } 00103 }