]>
Commit | Line | Data |
---|---|---|
2817d3e2 | 1 | // $Id$ |
2 | // Category: global | |
3 | // | |
4 | // The map container for associated names. | |
5 | // The names can be added into map either in pairs (Add() method) | |
6 | // or standalone - then they are paired with the fSecond data member | |
7 | // (AddName() method) | |
8 | ||
9 | #ifndef TG4_NAME_MAP_H | |
10 | #define TG4_NAME_MAP_H | |
11 | ||
63c8351a | 12 | #include <g4std/map> |
13 | #include <globals.hh> | |
2817d3e2 | 14 | |
15 | class TG4NameMap | |
16 | { | |
17 | public: | |
18 | TG4NameMap(); | |
19 | // --> protected | |
20 | // TG4NameMap(const TG4NameMap& right); | |
21 | virtual ~TG4NameMap(); | |
22 | ||
23 | // methods | |
24 | G4bool Add(const G4String& first, const G4String& second); | |
25 | G4bool AddName(const G4String& name); | |
26 | const G4String& GetSecond(const G4String& name); | |
27 | void PrintAll(); | |
28 | void Clear(); | |
29 | ||
30 | // set methods | |
31 | void SetSecond(const G4String& name); | |
32 | ||
33 | protected: | |
34 | TG4NameMap(const TG4NameMap& right); | |
35 | ||
36 | // operators | |
37 | TG4NameMap& operator=(const TG4NameMap& right); | |
38 | ||
39 | private: | |
40 | // static data members | |
41 | static G4String fgUndefined; //the value of undefined second | |
42 | ||
43 | // data members | |
a8f41ccf | 44 | G4std::map<G4String, G4String, G4std::less<G4String> > fMap; //map container |
2817d3e2 | 45 | G4String fSecond; //the current second |
46 | }; | |
47 | ||
48 | // inline methods | |
49 | inline void TG4NameMap::SetSecond(const G4String& secondName) | |
50 | { fSecond = secondName; } | |
51 | ||
52 | #endif //TG4_NAME_MAP_H |