Geant4-11
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes
G4VMoleculeCounter Class Referenceabstract

#include <G4VMoleculeCounter.hh>

Inheritance diagram for G4VMoleculeCounter:
G4MoleculeCounter

Public Types

using Reactant = const G4MolecularConfiguration
 

Public Member Functions

virtual void AddAMoleculeAtTime (Reactant *, G4double time, const G4ThreeVector *position=nullptr, int number=1)=0
 
virtual void DontRegister (const G4MoleculeDefinition *)
 
virtual void Initialize ()=0
 
virtual bool IsRegistered (const G4MoleculeDefinition *)
 
virtual void RegisterAll ()
 
virtual void RemoveAMoleculeAtTime (Reactant *, G4double time, const G4ThreeVector *position=nullptr, int number=1)=0
 
virtual void ResetCounter ()=0
 

Static Public Member Functions

static void DeleteInstance ()
 
static void InitializeInstance ()
 
static G4VMoleculeCounterInstance ()
 
static G4bool InUse ()
 
static void SetInstance (G4VMoleculeCounter *)
 
static void Use (G4bool flag=true)
 

Protected Member Functions

 G4VMoleculeCounter ()=default
 
virtual ~G4VMoleculeCounter ()=default
 

Static Protected Attributes

static G4ThreadLocal G4VMoleculeCounterfpInstance = nullptr
 
static G4bool fUse = false
 

Detailed Description

Definition at line 43 of file G4VMoleculeCounter.hh.

Member Typedef Documentation

◆ Reactant

Definition at line 58 of file G4VMoleculeCounter.hh.

Constructor & Destructor Documentation

◆ G4VMoleculeCounter()

G4VMoleculeCounter::G4VMoleculeCounter ( )
protecteddefault

◆ ~G4VMoleculeCounter()

virtual G4VMoleculeCounter::~G4VMoleculeCounter ( )
protectedvirtualdefault

Member Function Documentation

◆ AddAMoleculeAtTime()

virtual void G4VMoleculeCounter::AddAMoleculeAtTime ( Reactant ,
G4double  time,
const G4ThreeVector position = nullptr,
int  number = 1 
)
pure virtual

◆ DeleteInstance()

void G4VMoleculeCounter::DeleteInstance ( )
static

Definition at line 78 of file G4VMoleculeCounter.cc.

79{
80 if (fpInstance != nullptr)
81 {
82 delete fpInstance;
83 fpInstance = nullptr;
84 }
85}
static G4ThreadLocal G4VMoleculeCounter * fpInstance

References fpInstance.

Referenced by G4DNAChemistryManager::Clear().

◆ DontRegister()

virtual void G4VMoleculeCounter::DontRegister ( const G4MoleculeDefinition )
inlinevirtual

Reimplemented in G4MoleculeCounter.

Definition at line 94 of file G4VMoleculeCounter.hh.

95 {
96 }

◆ Initialize()

virtual void G4VMoleculeCounter::Initialize ( )
pure virtual

Implemented in G4MoleculeCounter.

Referenced by InitializeInstance().

◆ InitializeInstance()

void G4VMoleculeCounter::InitializeInstance ( )
static

Definition at line 89 of file G4VMoleculeCounter.cc.

90{
91 if (fpInstance)
92 {
94 }
95}
virtual void Initialize()=0

References fpInstance, and Initialize().

Referenced by G4DNAChemistryManager::InitializeThread().

◆ Instance()

G4VMoleculeCounter * G4VMoleculeCounter::Instance ( )
static

◆ InUse()

G4bool G4VMoleculeCounter::InUse ( )
static

◆ IsRegistered()

virtual bool G4VMoleculeCounter::IsRegistered ( const G4MoleculeDefinition )
inlinevirtual

Reimplemented in G4MoleculeCounter.

Definition at line 98 of file G4VMoleculeCounter.hh.

99 {
100 return false;
101 }

◆ RegisterAll()

virtual void G4VMoleculeCounter::RegisterAll ( )
inlinevirtual

Reimplemented in G4MoleculeCounter.

Definition at line 103 of file G4VMoleculeCounter.hh.

104 {
105 }

◆ RemoveAMoleculeAtTime()

virtual void G4VMoleculeCounter::RemoveAMoleculeAtTime ( Reactant ,
G4double  time,
const G4ThreeVector position = nullptr,
int  number = 1 
)
pure virtual

◆ ResetCounter()

virtual void G4VMoleculeCounter::ResetCounter ( )
pure virtual

Implemented in G4MoleculeCounter.

Referenced by G4DNAChemistryManager::Run().

◆ SetInstance()

void G4VMoleculeCounter::SetInstance ( G4VMoleculeCounter pCounterInstance)
static

Definition at line 43 of file G4VMoleculeCounter.cc.

44{
45 if (fpInstance != nullptr)
46 {
48 errMsg << "The G4MoleculeCounter was already initialized." << G4endl
49 << "The previous instance will be deleted in order to use yours." << G4endl
50 << "However this can generate conflicts. Make sure you call G4MoleculeCounter::SetInstance"
51 "at the beginning of your application."
52 << "A good place would be ActionInitialization::Build & BuildForMaster"
53 << G4endl;
54
55 G4Exception("G4MoleculeCounter::SetInstance",
56 "SINGLETON_ALREADY_INITIALIZED",
57 JustWarning, errMsg);
58 delete fpInstance;
59 fpInstance = nullptr;
60 }
61
62 fpInstance = pCounterInstance;
63}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
#define G4endl
Definition: G4ios.hh:57

References fpInstance, G4endl, G4Exception(), and JustWarning.

◆ Use()

void G4VMoleculeCounter::Use ( G4bool  flag = true)
static

Definition at line 99 of file G4VMoleculeCounter.cc.

100{
101 fUse = flag;
102}

References fUse.

Referenced by G4DNAEventScheduler::ClearAndReChargeCounter().

Field Documentation

◆ fpInstance

G4ThreadLocal G4VMoleculeCounter * G4VMoleculeCounter::fpInstance = nullptr
staticprotected

◆ fUse

G4bool G4VMoleculeCounter::fUse = false
staticprotected

Definition at line 47 of file G4VMoleculeCounter.hh.

Referenced by InUse(), and Use().


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