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

#include <G4DCIOcatalog.hh>

Public Member Functions

G4String CurrentDCIOmanager ()
 
 G4DCIOcatalog ()
 
G4VPDigitsCollectionIOGetDCIOmanager (const G4String &name)
 
G4VPDigitsCollectionIOGetDCIOmanager (G4int n)
 
G4VDCIOentryGetEntry (const G4String &name)
 
std::size_t NumberOfDCIOmanager ()
 
void PrintDCIOmanager ()
 
void PrintEntries ()
 
void RegisterDCIOmanager (G4VPDigitsCollectionIO *d)
 
void RegisterEntry (G4VDCIOentry *d)
 
void SetVerboseLevel (int v)
 
virtual ~G4DCIOcatalog ()
 

Static Public Member Functions

static G4DCIOcatalogGetDCIOcatalog ()
 

Private Attributes

G4int m_verbose = 0
 
DCIOmap theCatalog
 
DCIOstore theStore
 

Static Private Attributes

static G4ThreadLocal G4DCIOcatalogf_thePointer = nullptr
 

Detailed Description

Definition at line 48 of file G4DCIOcatalog.hh.

Constructor & Destructor Documentation

◆ G4DCIOcatalog()

G4DCIOcatalog::G4DCIOcatalog ( )

Definition at line 37 of file G4DCIOcatalog.cc.

38{
39}

Referenced by GetDCIOcatalog().

◆ ~G4DCIOcatalog()

virtual G4DCIOcatalog::~G4DCIOcatalog ( )
inlinevirtual

Definition at line 55 of file G4DCIOcatalog.hh.

55{}

Member Function Documentation

◆ CurrentDCIOmanager()

G4String G4DCIOcatalog::CurrentDCIOmanager ( )

Definition at line 129 of file G4DCIOcatalog.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}
DCIOstore theStore

References theStore.

Referenced by G4PersistencyCenter::CurrentDCIOmanager().

◆ GetDCIOcatalog()

G4DCIOcatalog * G4DCIOcatalog::GetDCIOcatalog ( )
static

◆ GetDCIOmanager() [1/2]

G4VPDigitsCollectionIO * G4DCIOcatalog::GetDCIOmanager ( const G4String name)

Definition at line 102 of file G4DCIOcatalog.cc.

103{
104 if(theStore.find(name) == theStore.cend())
105 {
106 G4cout << "Digit 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
G4GLOB_DLL std::ostream G4cout
const char * name(G4int ptype)

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

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

◆ GetDCIOmanager() [2/2]

G4VPDigitsCollectionIO * G4DCIOcatalog::GetDCIOmanager ( G4int  n)

Definition at line 151 of file G4DCIOcatalog.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.

◆ GetEntry()

G4VDCIOentry * G4DCIOcatalog::GetEntry ( const G4String name)

Definition at line 86 of file G4DCIOcatalog.cc.

87{
88 if(theCatalog.find(name) == theCatalog.cend())
89 {
90 G4cout << "Digit Collection I/O manager entry \"" << name << "\" not found!"
91 << G4endl;
92 return nullptr;
93 }
94 else
95 {
97 return ds;
98 }
99}
DCIOmap theCatalog

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

Referenced by G4PersistencyCenter::AddDCIOmanager().

◆ NumberOfDCIOmanager()

std::size_t G4DCIOcatalog::NumberOfDCIOmanager ( )
inline

Definition at line 85 of file G4DCIOcatalog.hh.

85{ return theStore.size(); }

References theStore.

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

◆ PrintDCIOmanager()

void G4DCIOcatalog::PrintDCIOmanager ( )

Definition at line 140 of file G4DCIOcatalog.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 G4DCIOentryT< T >::CreateDCIOmanager(), and G4PersistencyCenter::PrintAll().

◆ PrintEntries()

void G4DCIOcatalog::PrintEntries ( )

Definition at line 118 of file G4DCIOcatalog.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().

◆ RegisterDCIOmanager()

void G4DCIOcatalog::RegisterDCIOmanager ( G4VPDigitsCollectionIO d)

Definition at line 68 of file G4DCIOcatalog.cc.

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

References G4VPDigitsCollectionIO::DMname(), G4cout, G4endl, m_verbose, and theStore.

Referenced by G4DCIOentryT< T >::CreateDCIOmanager().

◆ RegisterEntry()

void G4DCIOcatalog::RegisterEntry ( G4VDCIOentry d)

Definition at line 50 of file G4DCIOcatalog.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: G4VDCIOentry.hh:53

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

Referenced by G4VDCIOentry::G4VDCIOentry().

◆ SetVerboseLevel()

void G4DCIOcatalog::SetVerboseLevel ( int  v)
inline

Definition at line 61 of file G4DCIOcatalog.hh.

61{ m_verbose = v; }

References m_verbose.

Referenced by G4PersistencyManager::SetVerboseLevel().

Field Documentation

◆ f_thePointer

G4ThreadLocal G4DCIOcatalog * G4DCIOcatalog::f_thePointer = nullptr
staticprivate

Definition at line 94 of file G4DCIOcatalog.hh.

Referenced by GetDCIOcatalog().

◆ m_verbose

G4int G4DCIOcatalog::m_verbose = 0
private

Definition at line 93 of file G4DCIOcatalog.hh.

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

◆ theCatalog

DCIOmap G4DCIOcatalog::theCatalog
private

Definition at line 95 of file G4DCIOcatalog.hh.

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

◆ theStore

DCIOstore G4DCIOcatalog::theStore
private

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