Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TG4NameMap.h
Go to the documentation of this file.
1#ifndef TG4_NAME_MAP_H
2#define TG4_NAME_MAP_H
3
4//------------------------------------------------
5// The Geant4 Virtual Monte Carlo package
6// Copyright (C) 2007 - 2014 Ivana Hrivnacova
7// All rights reserved.
8//
9// For the licensing terms see geant4_vmc/LICENSE.
10// Contact: root-vmc@cern.ch
11//-------------------------------------------------
12
17
18#include <globals.hh>
19#include <map>
20
29
31{
32 public:
34 typedef std::map<G4String, G4String, std::less<G4String> > Map;
35
37 typedef Map::iterator MapIterator;
38
40 typedef Map::const_iterator MapConstIterator;
41
42 public:
43 TG4NameMap();
45
46 // methods
47 G4bool Add(const G4String& first, const G4String& second);
48 G4bool AddInverse(const G4String& first, const G4String& second);
49 G4bool AddName(const G4String& name);
50 const G4String& GetFirst(const G4String& second) const;
51 const G4String& GetSecond(const G4String& first) const;
52 void PrintAll() const;
53 void Clear();
54
55 // set methods
56 void SetSecond(const G4String& name);
57
58 private:
60 TG4NameMap(const TG4NameMap& right);
63
64 // static data members
65 static G4String fgUndefined;
66
67 // data members
70 G4String fSecond;
71};
72
73// inline methods
74
75inline void TG4NameMap::SetSecond(const G4String& secondName)
76{
78 fSecond = secondName;
79}
80
81#endif // TG4_NAME_MAP_H
The map container for associated names.
Definition TG4NameMap.h:31
Map fInverseMap
inverse map container
Definition TG4NameMap.h:69
G4bool Add(const G4String &first, const G4String &second)
TG4NameMap(const TG4NameMap &right)
Not implemented.
const G4String & GetSecond(const G4String &first) const
std::map< G4String, G4String, std::less< G4String > > Map
The map of strings to strings.
Definition TG4NameMap.h:34
Map::iterator MapIterator
The iterator for the map of strings to strings.
Definition TG4NameMap.h:37
Map::const_iterator MapConstIterator
The constant iterator for the map of strings to strings.
Definition TG4NameMap.h:40
G4String fSecond
the current second
Definition TG4NameMap.h:70
void SetSecond(const G4String &name)
Definition TG4NameMap.h:75
static G4String fgUndefined
the value of undefined second
Definition TG4NameMap.h:65
Map fMap
map container
Definition TG4NameMap.h:68
TG4NameMap & operator=(const TG4NameMap &right)
Not implemented.
void PrintAll() const
const G4String & GetFirst(const G4String &second) const
G4bool AddName(const G4String &name)
G4bool AddInverse(const G4String &first, const G4String &second)