Geant4-11
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes
G4HCIOcatalog Class Reference

#include <G4HCIOcatalog.hh>

Public Member Functions

G4String CurrentHCIOmanager ()
 
 G4HCIOcatalog ()
 
G4VHCIOentryGetEntry (const G4String &name)
 
G4VPHitsCollectionIOGetHCIOmanager (const G4String &name)
 
G4VPHitsCollectionIOGetHCIOmanager (G4int n)
 
std::size_t NumberOfHCIOmanager ()
 
void PrintEntries ()
 
void PrintHCIOmanager ()
 
void RegisterEntry (G4VHCIOentry *d)
 
void RegisterHCIOmanager (G4VPHitsCollectionIO *d)
 
void SetVerboseLevel (G4int v)
 
virtual ~G4HCIOcatalog ()
 

Static Public Member Functions

static G4HCIOcatalogGetHCIOcatalog ()
 

Private Attributes

G4int m_verbose = 0
 
HCIOmap theCatalog
 
HCIOstore theStore
 

Static Private Attributes

static G4ThreadLocal G4HCIOcatalogf_thePointer = 0
 

Detailed Description

Definition at line 49 of file G4HCIOcatalog.hh.

Constructor & Destructor Documentation

◆ G4HCIOcatalog()

G4HCIOcatalog::G4HCIOcatalog ( )

Definition at line 37 of file G4HCIOcatalog.cc.

38{
39}

Referenced by GetHCIOcatalog().

◆ ~G4HCIOcatalog()

virtual G4HCIOcatalog::~G4HCIOcatalog ( )
inlinevirtual

Definition at line 56 of file G4HCIOcatalog.hh.

56{}

Member Function Documentation

◆ CurrentHCIOmanager()

G4String G4HCIOcatalog::CurrentHCIOmanager ( )

Definition at line 129 of file G4HCIOcatalog.cc.

130{
131 G4String list = "";
132 for(auto it = theStore.cbegin(); it != theStore.cend(); ++it)
133 {
134 list += (*it).first + " ";
135 }
136 return list;
137}
HCIOstore theStore

References theStore.

Referenced by G4PersistencyCenter::CurrentHCIOmanager().

◆ GetEntry()

G4VHCIOentry * G4HCIOcatalog::GetEntry ( const G4String name)

Definition at line 86 of file G4HCIOcatalog.cc.

87{
88 if(theCatalog.find(name) == theCatalog.end())
89 {
90 G4cout << "Hit Collection I/O manager entry \"" << name << "\" not found!"
91 << std::endl;
92 return nullptr;
93 }
94 else
95 {
97 return ds;
98 }
99}
G4GLOB_DLL std::ostream G4cout
HCIOmap theCatalog
const char * name(G4int ptype)

References anonymous_namespace{G4QuasiElRatios.cc}::ds, G4cout, G4InuclParticleNames::name(), and theCatalog.

Referenced by G4PersistencyCenter::AddHCIOmanager().

◆ GetHCIOcatalog()

G4HCIOcatalog * G4HCIOcatalog::GetHCIOcatalog ( )
static

◆ GetHCIOmanager() [1/2]

G4VPHitsCollectionIO * G4HCIOcatalog::GetHCIOmanager ( const G4String name)

Definition at line 102 of file G4HCIOcatalog.cc.

103{
104 if(theStore.find(name) == theStore.cend())
105 {
106 G4cout << "Hit Collection I/O manager \"" << name << "\" not found!"
107 << G4endl;
108 return nullptr;
109 }
110 else
111 {
113 return ds;
114 }
115}
#define G4endl
Definition: G4ios.hh:57

References anonymous_namespace{G4QuasiElRatios.cc}::ds, G4cout, G4endl, G4InuclParticleNames::name(), and theStore.

Referenced by G4PersistencyManager::SetVerboseLevel(), and G4VPHitIO::SetVerboseLevel().

◆ GetHCIOmanager() [2/2]

G4VPHitsCollectionIO * G4HCIOcatalog::GetHCIOmanager ( G4int  n)

Definition at line 151 of file G4HCIOcatalog.cc.

152{
153 G4int i = 0;
154 for(auto it = theStore.cbegin(); it != theStore.cend(); ++it)
155 {
156 if(i++ == n)
157 return (*it).second;
158 }
159 return nullptr;
160}
int G4int
Definition: G4Types.hh:85

References CLHEP::detail::n, and theStore.

◆ NumberOfHCIOmanager()

std::size_t G4HCIOcatalog::NumberOfHCIOmanager ( )
inline

Definition at line 86 of file G4HCIOcatalog.hh.

86{ return theStore.size(); }

References theStore.

Referenced by G4PersistencyManager::SetVerboseLevel(), and G4VPHitIO::SetVerboseLevel().

◆ PrintEntries()

void G4HCIOcatalog::PrintEntries ( )

Definition at line 118 of file G4HCIOcatalog.cc.

119{
120 G4cout << "I/O manager entries: ";
121 G4cout << theCatalog.size() << G4endl;
122 for(auto it = theCatalog.cbegin(); it != theCatalog.cend(); ++it)
123 {
124 G4cout << " --- " << (*it).first << G4endl;
125 }
126}

References G4cout, G4endl, and theCatalog.

Referenced by G4PersistencyCenter::PrintAll().

◆ PrintHCIOmanager()

void G4HCIOcatalog::PrintHCIOmanager ( )

Definition at line 140 of file G4HCIOcatalog.cc.

141{
142 G4cout << "I/O managers: ";
143 G4cout << theStore.size() << G4endl;
144 for(auto it = theStore.cbegin(); it != theStore.cend(); ++it)
145 {
146 G4cout << " --- " << (*it).first << ", " << (*it).second << "." << G4endl;
147 }
148}

References G4cout, G4endl, and theStore.

Referenced by G4HCIOentryT< T >::CreateHCIOmanager(), and G4PersistencyCenter::PrintAll().

◆ RegisterEntry()

void G4HCIOcatalog::RegisterEntry ( G4VHCIOentry d)

Definition at line 50 of file G4HCIOcatalog.cc.

51{
52 if(m_verbose > 0)
53 {
54 G4cout << "registering I/O manager entry \"" << d->GetName() << "\" " << d
55 << "." << G4endl;
56 }
57 if(theCatalog.find(d->GetName()) != theCatalog.cend())
58 {
59 G4cout << "Redefining I/O Managers list " << d->GetName() << G4endl;
60 }
61 else
62 {
63 theCatalog[d->GetName()] = d;
64 }
65}
const G4String & GetName()
Definition: G4VHCIOentry.hh:53

References G4cout, G4endl, G4VHCIOentry::GetName(), m_verbose, and theCatalog.

Referenced by G4VHCIOentry::G4VHCIOentry().

◆ RegisterHCIOmanager()

void G4HCIOcatalog::RegisterHCIOmanager ( G4VPHitsCollectionIO d)

Definition at line 68 of file G4HCIOcatalog.cc.

69{
70 if(m_verbose > 0)
71 {
72 G4cout << "registering I/O manager \"" << d->SDname() << "\" " << d << "."
73 << G4endl;
74 }
75 if(theStore.find(d->SDname()) != theStore.cend())
76 {
77 G4cout << "Redefining I/O Manager " << d->SDname() << G4endl;
78 }
79 else
80 {
81 theStore[d->SDname()] = d;
82 }
83}
const G4String & SDname()

References G4cout, G4endl, m_verbose, G4VPHitsCollectionIO::SDname(), and theStore.

Referenced by G4HCIOentryT< T >::CreateHCIOmanager().

◆ SetVerboseLevel()

void G4HCIOcatalog::SetVerboseLevel ( G4int  v)
inline

Definition at line 62 of file G4HCIOcatalog.hh.

62{ m_verbose = v; }

References m_verbose.

Referenced by G4PersistencyManager::SetVerboseLevel().

Field Documentation

◆ f_thePointer

G4ThreadLocal G4HCIOcatalog * G4HCIOcatalog::f_thePointer = 0
staticprivate

Definition at line 95 of file G4HCIOcatalog.hh.

Referenced by GetHCIOcatalog().

◆ m_verbose

G4int G4HCIOcatalog::m_verbose = 0
private

Definition at line 94 of file G4HCIOcatalog.hh.

Referenced by RegisterEntry(), RegisterHCIOmanager(), and SetVerboseLevel().

◆ theCatalog

HCIOmap G4HCIOcatalog::theCatalog
private

Definition at line 96 of file G4HCIOcatalog.hh.

Referenced by GetEntry(), PrintEntries(), and RegisterEntry().

◆ theStore

HCIOstore G4HCIOcatalog::theStore
private

The documentation for this class was generated from the following files: