00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id$ 00028 // 00029 // 00030 // ------------------------------------------------------------ 00031 // GEANT 4 class header file 00032 // 00033 // History: first implementation, based on object model of 00034 // 4th Aug 1998, H.Kurashige 00035 // ------------------------------------------------------------ 00036 // Use STL vector instead of RW vector 1. Mar 00 H.Kurashige 00037 00039 inline 00040 G4bool G4ProcTblElement::Contains(const G4ProcessManager* pManager) const 00041 { 00042 G4ProcMgrVector::iterator i; 00043 for (i = pProcMgrVector->begin(); i!= pProcMgrVector->end(); ++i) { 00044 if (*i==pManager) return true; 00045 } 00046 return false; 00047 } 00048 00050 inline 00051 G4int G4ProcTblElement::GetIndex(const G4ProcessManager* pManager) const 00052 { 00053 G4int index = 0; 00054 G4ProcMgrVector::iterator i; 00055 for (i = pProcMgrVector->begin(); i!= pProcMgrVector->end(); ++i) { 00056 if (*i==pManager) return index; 00057 index +=1; 00058 } 00059 return -1; 00060 } 00061 00062 00064 inline 00065 G4int G4ProcTblElement::Length() const 00066 { 00067 return pProcMgrVector->size(); 00068 } 00069 00071 inline 00072 G4ProcessManager* G4ProcTblElement::GetProcessManager(G4int index) const 00073 { 00074 if ((index < G4int(pProcMgrVector->size())) && (index>=0)){ 00075 return (*pProcMgrVector)[index]; 00076 } else { 00077 return 0; 00078 } 00079 } 00080 00081 00083 inline 00084 G4VProcess* G4ProcTblElement::GetProcess() const 00085 { 00086 return pProcess; 00087 } 00088 00089 00091 inline 00092 void G4ProcTblElement::Insert(G4ProcessManager* aProcMgr) 00093 { 00094 pProcMgrVector->push_back(aProcMgr); 00095 } 00096 00098 inline 00099 void G4ProcTblElement::Remove(G4ProcessManager* aProcMgr) 00100 { 00101 G4ProcMgrVector::iterator i; 00102 for (i = pProcMgrVector->begin(); i!= pProcMgrVector->end(); ++i) { 00103 if (*i==aProcMgr){ 00104 pProcMgrVector->erase(i); 00105 break; 00106 } 00107 } 00108 } 00109 00111 inline 00112 const G4String& G4ProcTblElement::GetProcessName() const 00113 { 00114 return pProcess->GetProcessName(); 00115 }