Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4HCIOcatalog.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // File: G4HCIOcatalog.hh
27 //
28 // History:
29 // '01.09.12 Youhei Morita Initial creation
30 
31 #ifndef HCIO_CATALOG_HH
32 #define HCIO_CATALOG_HH 1
33 
34 #include <map>
35 #include "G4Types.hh"
36 #include "G4VPHitsCollectionIO.hh"
37 
39 
40 typedef std::map<std::string, G4VHCIOentry*, std::less<std::string> > HCIOmap;
41 
42 typedef std::map<std::string, G4VPHitsCollectionIO*, std::less<std::string> > HCIOstore;
43 
44 // Class Description:
45 // Catalog for the I/O manager of hits collection for each detector.
46 
48 {
49  public: // With description
50  G4HCIOcatalog();
51  // Constructor
52 
53  virtual ~G4HCIOcatalog() {};
54  // Destructor
55 
56  public: // With description
57  static G4HCIOcatalog* GetHCIOcatalog();
58  // Construct G4HCIOcatalog and returns the pointer
59 
60  void SetVerboseLevel(int v) { m_verbose = v; };
61  // Set verbose level.
62 
63  void RegisterEntry(G4VHCIOentry* d);
64  // Register I/O manager entry
65 
67  // Register I/O manager
68 
69  G4VHCIOentry* GetEntry(std::string name);
70  // Returns the I/O manager entry
71 
73  // Returns the registered I/O manager entry
74 
75  void PrintEntries();
76  // Prints the list of I/O manager entries
77 
78  std::string CurrentHCIOmanager();
79  // Returns the list of I/O managers
80 
81  void PrintHCIOmanager();
82  // Prints the list of I/O managers
83 
84  size_t NumberOfHCIOmanager() { return theStore.size(); };
85  // Returns the number of registered I/O managers.
86 
88  // Returns the n-th registered I/O manager entry
89 
90  private:
91  int m_verbose;
92  static G4ThreadLocal G4HCIOcatalog* f_thePointer;
93  HCIOmap theCatalog;
94  HCIOstore theStore;
95 
96 }; // End of class G4HCIOcatalog
97 
98 #endif
99 
std::map< std::string, G4VPHitsCollectionIO *, std::less< std::string > > HCIOstore
G4VHCIOentry * GetEntry(std::string name)
std::string CurrentHCIOmanager()
void RegisterEntry(G4VHCIOentry *d)
const XML_Char * name
static G4HCIOcatalog * GetHCIOcatalog()
#define G4ThreadLocal
Definition: tls.hh:52
size_t NumberOfHCIOmanager()
std::map< std::string, G4VHCIOentry *, std::less< std::string > > HCIOmap
void PrintHCIOmanager()
G4VPHitsCollectionIO * GetHCIOmanager(std::string name)
const G4int n
void RegisterHCIOmanager(G4VPHitsCollectionIO *d)
virtual ~G4HCIOcatalog()
void SetVerboseLevel(int v)