1 | // |
---|
2 | // ******************************************************************** |
---|
3 | // * License and Disclaimer * |
---|
4 | // * * |
---|
5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
7 | // * conditions of the Geant4 Software License, included in the file * |
---|
8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
9 | // * include a list of copyright holders. * |
---|
10 | // * * |
---|
11 | // * Neither the authors of this software system, nor their employing * |
---|
12 | // * institutes,nor the agencies providing financial support for this * |
---|
13 | // * work make any representation or warranty, express or implied, * |
---|
14 | // * regarding this software system or assume any liability for its * |
---|
15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
16 | // * for the full disclaimer and the limitation of liability. * |
---|
17 | // * * |
---|
18 | // * This code implementation is the result of the scientific and * |
---|
19 | // * technical work of the GEANT4 collaboration. * |
---|
20 | // * By using, copying, modifying or distributing the software (or * |
---|
21 | // * any work based on the software) you agree to acknowledge its * |
---|
22 | // * use in resulting scientific publications, and indicate your * |
---|
23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
24 | // ******************************************************************** |
---|
25 | // |
---|
26 | // |
---|
27 | // $Id: G4ProcTblElement.icc,v 1.8 2006/06/29 21:07:22 gunter Exp $ |
---|
28 | // GEANT4 tag $Name: geant4-09-04-beta-01 $ |
---|
29 | // |
---|
30 | // |
---|
31 | // ------------------------------------------------------------ |
---|
32 | // GEANT 4 class header file |
---|
33 | // |
---|
34 | // History: first implementation, based on object model of |
---|
35 | // 4th Aug 1998, H.Kurashige |
---|
36 | // ------------------------------------------------------------ |
---|
37 | // Use STL vector instead of RW vector 1. Mar 00 H.Kurashige |
---|
38 | |
---|
39 | ///////////// |
---|
40 | inline |
---|
41 | G4bool G4ProcTblElement::Contains(const G4ProcessManager* pManager) const |
---|
42 | { |
---|
43 | G4ProcMgrVector::iterator i; |
---|
44 | for (i = pProcMgrVector->begin(); i!= pProcMgrVector->end(); ++i) { |
---|
45 | if (*i==pManager) return true; |
---|
46 | } |
---|
47 | return false; |
---|
48 | } |
---|
49 | |
---|
50 | ////////////////////////// |
---|
51 | inline |
---|
52 | G4int G4ProcTblElement::GetIndex(const G4ProcessManager* pManager) const |
---|
53 | { |
---|
54 | G4int index = 0; |
---|
55 | G4ProcMgrVector::iterator i; |
---|
56 | for (i = pProcMgrVector->begin(); i!= pProcMgrVector->end(); ++i) { |
---|
57 | if (*i==pManager) return index; |
---|
58 | index +=1; |
---|
59 | } |
---|
60 | return -1; |
---|
61 | } |
---|
62 | |
---|
63 | |
---|
64 | ////////////////////////// |
---|
65 | inline |
---|
66 | G4int G4ProcTblElement::Length() const |
---|
67 | { |
---|
68 | return pProcMgrVector->size(); |
---|
69 | } |
---|
70 | |
---|
71 | ////////////////////////// |
---|
72 | inline |
---|
73 | G4ProcessManager* G4ProcTblElement::GetProcessManager(G4int index) const |
---|
74 | { |
---|
75 | if ((index < G4int(pProcMgrVector->size())) && (index>=0)){ |
---|
76 | return (*pProcMgrVector)[index]; |
---|
77 | } else { |
---|
78 | return 0; |
---|
79 | } |
---|
80 | } |
---|
81 | |
---|
82 | |
---|
83 | ////////////////////////// |
---|
84 | inline |
---|
85 | G4VProcess* G4ProcTblElement::GetProcess() const |
---|
86 | { |
---|
87 | return pProcess; |
---|
88 | } |
---|
89 | |
---|
90 | |
---|
91 | ////////////////////////// |
---|
92 | inline |
---|
93 | void G4ProcTblElement::Insert(G4ProcessManager* aProcMgr) |
---|
94 | { |
---|
95 | pProcMgrVector->push_back(aProcMgr); |
---|
96 | } |
---|
97 | |
---|
98 | ////////////////////////// |
---|
99 | inline |
---|
100 | void G4ProcTblElement::Remove(G4ProcessManager* aProcMgr) |
---|
101 | { |
---|
102 | G4ProcMgrVector::iterator i; |
---|
103 | for (i = pProcMgrVector->begin(); i!= pProcMgrVector->end(); ++i) { |
---|
104 | if (*i==aProcMgr){ |
---|
105 | pProcMgrVector->erase(i); |
---|
106 | break; |
---|
107 | } |
---|
108 | } |
---|
109 | } |
---|
110 | |
---|
111 | ////////////////////////// |
---|
112 | inline |
---|
113 | const G4String& G4ProcTblElement::GetProcessName() const |
---|
114 | { |
---|
115 | return pProcess->GetProcessName(); |
---|
116 | } |
---|