G4ProcessVector.icc

Go to the documentation of this file.
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 inline G4bool G4ProcessVector::operator==(const G4ProcessVector &right) const
00030 {
00031   return (this == (G4ProcessVector *) &right);
00032 }
00033 
00034 inline G4int G4ProcessVector::entries() const
00035 {
00036   return pProcVector->size();
00037 }
00038 
00039 inline G4int G4ProcessVector::size() const
00040 {
00041   return pProcVector->size();
00042 }
00043 
00044 inline G4int G4ProcessVector::length() const
00045 {
00046   return pProcVector->size();
00047 }
00048 
00049 inline G4int G4ProcessVector::index(G4VProcess* aProcess) const
00050 {
00051   G4ProcVector::iterator it;
00052   size_t j=0;
00053   for (it=pProcVector->begin();it!=pProcVector->end(); ++j,it++) {
00054     if (*(*it)==*aProcess) return j;
00055   }
00056   return -1;
00057 }
00058  
00059 inline G4bool G4ProcessVector::contains(G4VProcess* aProcess) const
00060 {
00061   G4ProcVector::iterator it;
00062   for (it=pProcVector->begin();it!=pProcVector->end(); it++) {
00063     if (*(*it)==*aProcess) return true;
00064   }
00065   return false;
00066 }
00067 
00068 inline G4bool G4ProcessVector::insert(G4VProcess* aProcess)
00069 {
00070   pProcVector->push_back(aProcess);
00071   return true;
00072 }
00073 
00074 inline G4bool G4ProcessVector::insertAt(G4int i,G4VProcess* aProcess)
00075 {
00076   if ( (i<0) || (i>G4int(pProcVector->size())) ) return false;
00077   if (i==G4int(pProcVector->size())) {
00078     pProcVector->push_back(aProcess);
00079   } else {
00080     G4ProcVector::iterator it=pProcVector->begin();
00081     int j;
00082     for(j=0;j!=i;++j) it++;
00083     pProcVector->insert(it, aProcess);
00084   }
00085   return true;
00086 }
00087 
00088 inline G4VProcess* G4ProcessVector::removeAt(G4int i)
00089 {
00090   G4ProcVector::iterator it=pProcVector->begin();
00091   for(size_t j=0;j<pProcVector->size() && G4int(j)<i;++j) it++;
00092   G4VProcess* rValue = *it;
00093   pProcVector->erase(it);
00094   return rValue;
00095 }
00096 
00097 inline G4VProcess* G4ProcessVector::removeLast()
00098 {
00099   G4VProcess* rValue = pProcVector->back();
00100   pProcVector->pop_back();
00101   return rValue;
00102 }
00103 
00104 inline void G4ProcessVector::clear()
00105 {
00106   pProcVector->clear();
00107 }
00108 
00109 inline G4VProcess* const& G4ProcessVector::operator[](G4int i) const
00110 {
00111   return (*pProcVector)[i];
00112 }
00113 
00114 inline G4VProcess* const& G4ProcessVector::operator()(G4int i) const
00115 {
00116   return (*pProcVector)[i];
00117 }
00118 
00119 inline G4VProcess* & G4ProcessVector::operator[](G4int i)
00120 {
00121   return (*pProcVector)[i];
00122 }
00123 
00124 inline G4VProcess* & G4ProcessVector::operator()(G4int i)
00125 {
00126   return (*pProcVector)[i];
00127 }
00128 
00129 
00130 
00131 

Generated on Mon May 27 17:49:26 2013 for Geant4 by  doxygen 1.4.7