00001 // Author: 00002 // Ron Fox 00003 // NSCL 00004 // Michigan State University 00005 // East Lansing, MI 48824-1321 00006 // mailto:fox@nscl.msu.edu 00007 // 00008 00009 #ifndef __CDIGITIZERDICTIONARY_H //Required for current class 00010 #define __CDIGITIZERDICTIONARY_H 00011 00012 // 00013 // Include files: 00014 // 00015 00016 00017 #ifndef __STL_STRING 00018 #include <string> 00019 #define __STL_STRING 00020 #endif 00021 00022 00023 #ifndef __STL_MAP 00024 #include <map> 00025 #define __STL_MAP 00026 #endif 00027 00028 class CDigitizerModule; 00035 class CDigitizerDictionary 00036 { 00037 public: 00038 typedef map<string, CDigitizerModule*> DigitizerMap; 00039 typedef DigitizerMap::iterator ModuleIterator; 00040 private: 00041 DigitizerMap m_Modules; 00042 00043 public: 00044 // 00045 CDigitizerDictionary (); 00046 ~CDigitizerDictionary ( ); 00047 private: 00048 CDigitizerDictionary (const CDigitizerDictionary& rhs); 00049 CDigitizerDictionary& operator=(const CDigitizerDictionary& rhs); 00050 int operator== (const CDigitizerDictionary& rhs) const; 00051 int operator!= (const CDigitizerDictionary& rhs) const; 00052 public: 00053 00054 // Selectors: 00055 00056 public: 00057 DigitizerMap getMap() const { 00058 return m_Modules; 00059 } 00060 // Mutators: 00061 00062 protected: 00063 void setMap(DigitizerMap& rMap) { 00064 m_Modules = rMap; 00065 } 00066 public: 00067 00068 ModuleIterator DigitizerBegin () ; // 00069 ModuleIterator DigitizerEnd () ; // 00070 int DigitizerSize () ; // 00071 void DigitizerAdd (CDigitizerModule* pDigitizer) ; // 00072 ModuleIterator DigitizerFind (const string& rName) ; // 00073 void Remove(ModuleIterator p) { 00074 m_Modules.erase(p); 00075 } 00076 00077 // Utility functions: 00078 protected: 00079 void DestroyMap(); 00080 }; 00081 00082 #endif