Import Geant4 10.7.0 source tree
This commit is contained in:
@@ -25,11 +25,14 @@
|
||||
//
|
||||
// File: G4DCIOentryT.hh
|
||||
//
|
||||
// History:
|
||||
// '01.09.12 Youhei Morita Initial creation
|
||||
// Class Description:
|
||||
//
|
||||
// Template class of DigitsCollection I/O Manager for late binding
|
||||
|
||||
#ifndef DCIO_ENTRY_T_HH
|
||||
#define DCIO_ENTRY_T_HH 1
|
||||
// Author: Youhei Morita, 12.09.2001
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4DCIOENTRYT_HH
|
||||
#define G4DCIOENTRYT_HH 1
|
||||
|
||||
#include <string>
|
||||
#include "G4Types.hh"
|
||||
@@ -38,50 +41,53 @@
|
||||
// Class inherited:
|
||||
#include "G4VDCIOentry.hh"
|
||||
|
||||
// Class Description:
|
||||
// Template class of DigitsCollection I/O Manager for late binding
|
||||
|
||||
template <class T> class G4DCIOentryT
|
||||
: public G4VDCIOentry
|
||||
template <class T>
|
||||
class G4DCIOentryT : public G4VDCIOentry
|
||||
{
|
||||
public: // With description
|
||||
G4DCIOentryT<T>(std::string n)
|
||||
: G4VDCIOentry(n), f_manager(0)
|
||||
public:
|
||||
|
||||
G4DCIOentryT<T>(std::string n) : G4VDCIOentry(n)
|
||||
{
|
||||
if(m_verbose > 2)
|
||||
{
|
||||
if ( m_verbose > 2 ) {
|
||||
G4cout << "G4DCIOentryT: Registering DigitsCollection IO manager"
|
||||
<< " for \"" << n << "\"" << G4endl;
|
||||
}
|
||||
G4cout << "G4DCIOentryT: Registering DigitsCollection IO manager"
|
||||
<< " for \"" << n << "\"" << G4endl;
|
||||
}
|
||||
}
|
||||
// Constructor
|
||||
|
||||
~G4DCIOentryT() {};
|
||||
~G4DCIOentryT() {}
|
||||
// Destructor
|
||||
|
||||
public: // With description
|
||||
void CreateDCIOmanager(std::string detName, std::string colName)
|
||||
void CreateDCIOmanager(const G4String& detName, const G4String& colName)
|
||||
{
|
||||
if(f_manager == nullptr)
|
||||
{
|
||||
if ( f_manager == 0 ) {
|
||||
f_manager = new T( detName, colName );
|
||||
if ( m_verbose > 2 ) {
|
||||
G4cout << "G4DCIOentryT: Constructing DigitsCollection IO manager"
|
||||
<< " for \"" << detName << "\" " << f_manager << G4endl;
|
||||
}
|
||||
G4DCIOcatalog::GetDCIOcatalog()->RegisterDCIOmanager(f_manager);
|
||||
if ( m_verbose > 2 ) {
|
||||
G4DCIOcatalog::GetDCIOcatalog()->PrintDCIOmanager();
|
||||
}
|
||||
f_manager = new T(detName, colName);
|
||||
if(m_verbose > 2)
|
||||
{
|
||||
G4cout << "G4DCIOentryT: Constructing DigitsCollection IO manager"
|
||||
<< " for \"" << detName << "\" " << f_manager << G4endl;
|
||||
}
|
||||
G4DCIOcatalog::GetDCIOcatalog()->RegisterDCIOmanager(f_manager);
|
||||
if(m_verbose > 2)
|
||||
{
|
||||
G4DCIOcatalog::GetDCIOcatalog()->PrintDCIOmanager();
|
||||
}
|
||||
}
|
||||
}
|
||||
// Create a new digits collection I/O manager
|
||||
|
||||
void DeleteDCIOmanager() { if (f_manager!=0) delete f_manager; };
|
||||
void DeleteDCIOmanager()
|
||||
{
|
||||
if(f_manager != nullptr) { delete f_manager; }
|
||||
}
|
||||
// Delete a digits collection I/O manager
|
||||
|
||||
private:
|
||||
G4VPDigitsCollectionIO* f_manager;
|
||||
private:
|
||||
|
||||
}; // End of class G4DCIOentryT
|
||||
G4VPDigitsCollectionIO* f_manager = nullptr;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user