Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions
G4HadronicInteractionRegistry Class Reference

#include <G4HadronicInteractionRegistry.hh>

Public Member Functions

 ~G4HadronicInteractionRegistry ()
 
void Clean ()
 
void RegisterMe (G4HadronicInteraction *aModel)
 
void RemoveMe (G4HadronicInteraction *aModel)
 
G4HadronicInteractionFindModel (const G4String &name)
 

Static Public Member Functions

static
G4HadronicInteractionRegistry
Instance ()
 

Detailed Description

Definition at line 43 of file G4HadronicInteractionRegistry.hh.

Constructor & Destructor Documentation

G4HadronicInteractionRegistry::~G4HadronicInteractionRegistry ( )

Definition at line 48 of file G4HadronicInteractionRegistry.cc.

References Clean().

Member Function Documentation

void G4HadronicInteractionRegistry::Clean ( )

Definition at line 53 of file G4HadronicInteractionRegistry.cc.

Referenced by ~G4HadronicInteractionRegistry(), and G4HadronicProcessStore::~G4HadronicProcessStore().

54 {
55  size_t nModels = allModels.size();
56  //G4cout << "G4HadronicInteractionRegistry::Clean() start " << nModels << G4endl;
57  if(0 < nModels) {
58  for (size_t i=0; i<nModels; ++i) {
59  if( allModels[i] ) {
60  //G4cout << "delete " << i << G4endl;
61  //G4cout << allModels[i]->GetModelName() << G4endl;
62  G4HadronicInteraction * model = allModels[i];
63  allModels[i] = 0;
64  delete model;
65  }
66  }
67  allModels.clear();
68  }
69  //G4cout << "G4HadronicInteractionRegistry::Clean() is done " << G4endl;
70 }
const XML_Char XML_Content * model
G4HadronicInteraction * G4HadronicInteractionRegistry::FindModel ( const G4String name)
G4HadronicInteractionRegistry * G4HadronicInteractionRegistry::Instance ( void  )
static
void G4HadronicInteractionRegistry::RegisterMe ( G4HadronicInteraction aModel)

Definition at line 73 of file G4HadronicInteractionRegistry.cc.

Referenced by G4HadronicInteraction::G4HadronicInteraction().

74 {
75  if(!aModel) { return; }
76  size_t nModels = allModels.size();
77  if(nModels > 0) {
78  for (size_t i=0; i<nModels; ++i) {
79  if( aModel == allModels[i] ) { return; }
80  }
81  }
82  //G4cout << "Register model <" << aModel->GetModelName()
83  //<< "> " << nModels+1 << G4endl;
84  allModels.push_back(aModel);
85 }
void G4HadronicInteractionRegistry::RemoveMe ( G4HadronicInteraction aModel)

Definition at line 88 of file G4HadronicInteractionRegistry.cc.

Referenced by G4HadronicInteraction::~G4HadronicInteraction().

89 {
90  if(!aModel) { return; }
91  size_t nModels = allModels.size();
92  if(0 == nModels) { return; }
93  for (size_t i=0; i<nModels; ++i) {
94  if( aModel == allModels[i] ) {
95  //G4cout << "DeRegister model <" << aModel->GetModelName()
96  //<< "> " << i << G4endl;
97  allModels[i] = 0;
98  return;
99  }
100  }
101 }

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