Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 #ifndef G4Pair_h 23 #ifndef G4Pair_h 27 #define G4Pair_h 24 #define G4Pair_h 28 25 29 template <class t1, class t2> 26 template <class t1, class t2> 30 class G4Pair << 27 struct G4Pair 31 { 28 { 32 public: << 29 t1 first; 33 typedef t1 first; << 30 t2 second; 34 typedef t2 rest; << 35 }; 31 }; 36 << 37 class G4Terminator << 38 { << 39 }; << 40 << 41 #define GROUP1(t1) G4Pair<t1, G4Terminator > << 42 #define GROUP2(t1,t2) G4Pair<t1, GROUP1(t2) > << 43 #define GROUP3(t1,t2,t3) G4Pair<t1, GROUP2(t2, << 44 #define GROUP4(t1,t2,t3,t4) G4Pair<t1, GROUP3( << 45 #define GROUP5(t1,t2,t3,t4,t5) G4Pair<t1, GROU << 46 #define GROUP6(t1,t2,t3,t4,t5,t6) G4Pair<t1, G << 47 #define GROUP7(t1,t2,t3,t4,t5,t6,t7) G4Pair<t1 << 48 #define GROUP8(t1,t2,t3,t4,t5,t6,t7,t8) G4Pair << 49 #define GROUP9(t1,t2,t3,t4,t5,t6,t7,t8,t9) G4P << 50 #define GROUP10(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 51 #define GROUP11(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 52 #define GROUP12(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 53 #define GROUP13(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 54 #define GROUP14(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 55 #define GROUP15(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 56 #define GROUP16(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 57 #define GROUP17(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 58 #define GROUP18(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 59 #define GROUP19(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 60 #define GROUP20(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 61 #define GROUP21(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 62 #define GROUP22(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 63 #define GROUP23(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 64 #define GROUP24(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 65 #define GROUP25(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 66 #define GROUP26(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 67 #define GROUP27(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 68 #define GROUP28(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 69 #define GROUP29(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 70 #define GROUP30(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 71 #define GROUP31(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 72 #define GROUP32(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 73 #define GROUP33(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 74 #define GROUP34(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 75 #define GROUP35(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 76 #define GROUP36(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 77 #define GROUP37(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 78 #define GROUP38(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 79 #define GROUP39(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 80 #define GROUP40(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 81 #define GROUP41(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 82 #define GROUP42(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 83 #define GROUP43(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 84 #define GROUP44(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 85 #define GROUP45(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 86 #define GROUP46(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 87 #define GROUP47(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 88 #define GROUP48(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 89 #define GROUP49(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 90 #define GROUP50(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 91 #define GROUP51(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 92 #define GROUP52(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 93 #define GROUP53(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 94 #define GROUP54(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 95 #define GROUP55(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 96 #define GROUP56(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 97 #define GROUP57(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 98 #define GROUP58(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 99 #define GROUP59(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 100 #define GROUP60(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 101 #define GROUP61(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 102 #define GROUP62(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 103 #define GROUP63(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 104 #define GROUP64(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 105 #define GROUP65(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 106 #define GROUP66(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 107 #define GROUP67(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 108 #define GROUP68(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 109 #define GROUP69(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 110 #define GROUP70(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 111 #define GROUP71(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 112 #define GROUP72(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 113 #define GROUP73(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 114 #define GROUP74(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 115 #define GROUP75(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 116 #define GROUP76(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 117 #define GROUP77(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 118 #define GROUP78(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 119 #define GROUP79(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 120 #define GROUP80(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 121 #define GROUP81(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 122 #define GROUP82(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 123 #define GROUP83(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 124 #define GROUP84(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 125 #define GROUP85(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 126 #define GROUP86(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 127 #define GROUP87(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 128 #define GROUP88(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 129 #define GROUP89(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 130 #define GROUP90(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 131 #define GROUP91(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 132 #define GROUP92(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 133 #define GROUP93(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 134 #define GROUP94(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 135 #define GROUP95(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 136 #define GROUP96(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 137 #define GROUP97(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 138 #define GROUP98(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 139 #define GROUP99(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 << 140 << 141 << 142 template <class A> << 143 class VCall << 144 { << 145 public: << 146 virtual void call(A* aA) = 0; << 147 }; << 148 << 149 template <class g, class f, class A> << 150 class Call : public VCall<A> << 151 { << 152 public: << 153 virtual void call(A* aA) << 154 { << 155 typename g::first aL; << 156 f aF; << 157 aF(&aL, aA); << 158 } << 159 }; << 160 << 161 << 162 template <class group> << 163 class G4ForEach << 164 { << 165 private: << 166 template <class T1> static void ActOn(T1* aT << 167 { << 168 aV->call(aT1); << 169 } << 170 public: << 171 template <class T1, class functor> static vo << 172 { << 173 Call<group, functor, T1> aCall; << 174 aCall.call(aT1); << 175 typedef typename group::rest tail; << 176 G4ForEach<tail>::Apply(aFP, aT1); << 177 } << 178 template <class functor> << 179 static void Apply() << 180 { << 181 Call<group, functor, int> aCall; << 182 int i=0; << 183 aCall.call(i); << 184 typedef typename group::rest tail; << 185 G4ForEach<tail>::Apply(); << 186 } << 187 }; << 188 << 189 template<> << 190 class G4ForEach<G4Terminator> << 191 { << 192 public: << 193 template <class T1, class functor> static vo << 194 template <class functor> static void Apply( << 195 }; << 196 << 197 template <class t1, int i2, class t3> << 198 class G4IntGrp << 199 { << 200 public: << 201 typedef t1 it; << 202 enum {i = i2}; << 203 typedef t3 rest; << 204 }; << 205 << 206 template<class T1, int I1, int I2, int I3, int << 207 class INT4 << 208 { << 209 public: << 210 typedef T1 it; << 211 enum {i1=I1, i2=I2, i3=I3, i4=I4}; << 212 }; << 213 << 214 #endif 32 #endif 215 << 216 33