]>
Commit | Line | Data |
---|---|---|
2817d3e2 | 1 | // $Id$ |
2 | // Category: global | |
3 | // | |
79401af9 | 4 | // Author: I. Hrivnacova |
5 | // | |
6 | // Class TG4IntMap | |
7 | // --------------- | |
2817d3e2 | 8 | // The map container for integer numbers associated with names. |
9 | ||
10 | #ifndef TG4_INT_MAP_H | |
11 | #define TG4_INT_MAP_H | |
12 | ||
63c8351a | 13 | #include <g4std/map> |
14 | #include <globals.hh> | |
2817d3e2 | 15 | |
16 | class TG4IntMap | |
17 | { | |
79401af9 | 18 | typedef G4std::map<G4String, G4int, G4std::less<G4String> > Map; |
19 | typedef Map:: iterator MapIterator; | |
20 | typedef Map:: const_iterator MapConstIterator; | |
21 | ||
2817d3e2 | 22 | public: |
23 | TG4IntMap(); | |
24 | // --> protected | |
25 | // TG4IntMap(const TG4IntMap& right); | |
26 | virtual ~TG4IntMap(); | |
27 | ||
28 | // methods | |
29 | G4bool Add(const G4String& first, G4int second); | |
11755011 | 30 | G4int GetSecond(const G4String& name, G4bool warn = true); |
79401af9 | 31 | void PrintAll() const; |
2817d3e2 | 32 | void Clear(); |
33 | ||
34 | protected: | |
35 | TG4IntMap(const TG4IntMap& right); | |
36 | ||
37 | // operators | |
38 | TG4IntMap& operator=(const TG4IntMap& right); | |
39 | ||
40 | private: | |
41 | G4bool IsDefined(const G4String& first); | |
42 | ||
43 | // data members | |
79401af9 | 44 | Map fMap; //map container |
2817d3e2 | 45 | }; |
46 | ||
47 | #endif //TG4_NAME_MAP_H |