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 inline implementation 00032 // 00033 // History: first implementation, based on object model of 00034 // 2nd December 1995, G.Cosmo 00035 // 00036 // ------------------------------------------------------------ 00037 00038 inline 00039 void G4PhysicsTable::clearAndDestroy() 00040 { 00041 G4PhysicsVector* a=0; 00042 while (size()>0) 00043 { 00044 a = G4PhysCollection::back(); 00045 G4PhysCollection::pop_back(); 00046 if ( a ) { delete a; } 00047 } 00048 00049 vecFlag.clear(); 00050 } 00051 00052 inline 00053 G4PhysicsVector*& G4PhysicsTable::operator()(size_t i) 00054 { 00055 return (*this)[i]; 00056 } 00057 00058 inline 00059 G4PhysicsVector* const& G4PhysicsTable::operator()(size_t i) const 00060 { 00061 return (*this)[i]; 00062 } 00063 00064 inline 00065 void G4PhysicsTable::push_back(G4PhysicsVector* pvec) 00066 { 00067 G4PhysCollection::push_back(pvec); 00068 vecFlag.push_back(true); 00069 } 00070 00071 inline 00072 void G4PhysicsTable::insert(G4PhysicsVector* pvec) 00073 { 00074 G4PhysCollection::push_back(pvec); 00075 vecFlag.push_back(true); 00076 } 00077 00078 inline 00079 void G4PhysicsTable::insertAt (size_t idx, G4PhysicsVector* pvec) 00080 { 00081 G4PhysicsTableIterator itr=begin(); 00082 for (size_t i=0; i<idx; ++i) { itr++; } 00083 G4PhysCollection::insert(itr, pvec); 00084 00085 G4FlagCollection::iterator itrF=vecFlag.begin(); 00086 for (size_t j=0; j<idx; ++j) { itrF++; } 00087 vecFlag.insert(itrF, true); 00088 } 00089 00090 inline 00091 size_t G4PhysicsTable::entries() const 00092 { 00093 return G4PhysCollection::size(); 00094 } 00095 00096 inline 00097 size_t G4PhysicsTable::length() const 00098 { 00099 return G4PhysCollection::size(); 00100 } 00101 00102 inline 00103 G4bool G4PhysicsTable::isEmpty() const 00104 { 00105 return G4PhysCollection::empty(); 00106 } 00107 00108 inline 00109 G4bool G4PhysicsTable::GetFlag(size_t i) const 00110 { 00111 return vecFlag[i]; 00112 } 00113 00114 inline 00115 void G4PhysicsTable::ClearFlag(size_t i) 00116 { 00117 vecFlag[i] = false; 00118 }