78 lines
2.5 KiB
Plaintext
78 lines
2.5 KiB
Plaintext
//
|
|
// ********************************************************************
|
|
// * DISCLAIMER *
|
|
// * *
|
|
// * The following disclaimer summarizes all the specific disclaimers *
|
|
// * of contributors to this software. The specific disclaimers,which *
|
|
// * govern, are listed with their locations in: *
|
|
// * http://cern.ch/geant4/license *
|
|
// * *
|
|
// * Neither the authors of this software system, nor their employing *
|
|
// * institutes,nor the agencies providing financial support for this *
|
|
// * work make any representation or warranty, express or implied, *
|
|
// * regarding this software system or assume any liability for its *
|
|
// * use. *
|
|
// * *
|
|
// * This code implementation is the intellectual property of the *
|
|
// * GEANT4 collaboration. *
|
|
// * By copying, distributing or modifying the Program (or any work *
|
|
// * based on the Program) you indicate your acceptance of this *
|
|
// * statement, and all its terms. *
|
|
// ********************************************************************
|
|
//
|
|
//
|
|
// $Id:
|
|
// GEANT4 tag $Name:
|
|
//
|
|
//
|
|
//---------------------------------------------------------------
|
|
//
|
|
// G4FastSimulationVector.hh
|
|
//
|
|
// Description:
|
|
// Extends the STL vector to replace RW.
|
|
//
|
|
// History:
|
|
// May 00: Verderi && MoraDeFreitas - First Implementation.
|
|
//
|
|
//---------------------------------------------------------------
|
|
|
|
template<class T>
|
|
T* G4FastSimulationVector<T>::remove (const T* a)
|
|
{
|
|
for (iterator it = std_pvector::begin();it<std_pvector::end(); it++)
|
|
{
|
|
if (**it==*a)
|
|
{
|
|
T* tmp=*it;
|
|
std_pvector::erase(it);
|
|
return tmp;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
template<class T>
|
|
T* G4FastSimulationVector<T>::removeAt (G4int i)
|
|
{
|
|
iterator it=std_pvector::begin();
|
|
int j;
|
|
for(j=0;j<i;j++) it++;
|
|
if(it!=std_pvector::end())
|
|
{
|
|
T* tmp = std_pvector::operator[](i);
|
|
std_pvector::erase(it);
|
|
return tmp;
|
|
}
|
|
else
|
|
return 0;
|
|
}
|
|
|
|
template<class T>
|
|
void G4FastSimulationVector<T>::clearAndDestroy ()
|
|
{
|
|
for (iterator it = std_pvector::begin();it<std_pvector::end(); it++)
|
|
if(*it) delete *it;
|
|
std_pvector::clear();
|
|
}
|