]>
Commit | Line | Data |
---|---|---|
1 | // $Id$ | |
2 | // Category: global | |
3 | // | |
4 | // Author: I. Hrivnacova | |
5 | // | |
6 | // Class TG4IntMap | |
7 | // --------------- | |
8 | // The map container for integer numbers associated with names. | |
9 | ||
10 | #ifndef TG4_INT_MAP_H | |
11 | #define TG4_INT_MAP_H | |
12 | ||
13 | #include <g4std/map> | |
14 | #include <globals.hh> | |
15 | ||
16 | class TG4IntMap | |
17 | { | |
18 | typedef G4std::map<G4String, G4int, G4std::less<G4String> > Map; | |
19 | typedef Map:: iterator MapIterator; | |
20 | typedef Map:: const_iterator MapConstIterator; | |
21 | ||
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); | |
30 | G4int GetSecond(const G4String& name, G4bool warn = true); | |
31 | void PrintAll() const; | |
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 | |
44 | Map fMap; //map container | |
45 | }; | |
46 | ||
47 | #endif //TG4_NAME_MAP_H |