// 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: tpvector.icc,v 1.7 2000/03/10 15:53:24 gcosmo Exp $ // GEANT4 tag $Name: geant4-02-00 $ // // //--------------------------------------------------------------- // GEANT 4 class header file // // G4RWTPtrVector //--------------------------------------------------------------- template G4RWTPtrVector::G4RWTPtrVector () : std_pvector(), rwsize(0){} template G4RWTPtrVector::G4RWTPtrVector (size_t n) : std_pvector(n, (T*)0), rwsize(n){} // Here Rogue-Wave would leave // pointers T* uninitialised. template G4RWTPtrVector::G4RWTPtrVector (size_t n, T* const & iPtr) : std_pvector(n, iPtr), rwsize(n){} template G4RWTPtrVector::G4RWTPtrVector (const G4RWTPtrVector& iPtr) : std_pvector(iPtr), rwsize(iPtr.rwsize){} template G4RWTPtrVector::~G4RWTPtrVector(){} template G4RWTPtrVector& G4RWTPtrVector::operator = (T* p) { rwsize=0; for(iterator i = std_pvector::begin(); i != std_pvector::end(); ++i) { *i = p; rwsize++; } return *this; } template T* G4RWTPtrVector::operator () ( size_t n ) const { #ifdef G4DEBUG if(n>=rwsize) G4RWTHROW(G4RWBoundsErr("G4RWTPtrVector operator()",rwsize,n)); #endif return std_pvector::operator[](n); } template T*& G4RWTPtrVector::operator () ( size_t n ) { // temporarly commented; to allow use as left-value rwsize is increased // #ifdef G4DEBUG // if(n>=rwsize) // G4RWTHROW(G4RWBoundsErr("G4RWTPtrVector operator()",rwsize,n)); // #endif if(rwsize<=n && n T* G4RWTPtrVector::operator [] ( size_t n ) const { if(n>=rwsize) G4RWTHROW(G4RWBoundsErr("G4RWTPtrVector",rwsize,n)); return std_pvector::operator[](n); } template T*& G4RWTPtrVector::operator [] ( size_t n ) { if(n>=rwsize) G4RWTHROW(G4RWBoundsErr("G4RWTPtrVector",rwsize,n)); return std_pvector::operator[](n); } template T* const * G4RWTPtrVector::data() const { return &(std_pvector::front()); } template size_t G4RWTPtrVector::length() { return std_pvector::size(); } template void G4RWTPtrVector::resize ( size_t n ) { if(n>std_pvector::size()) { int e=n-std_pvector::size(); for(int i=0;i void G4RWTPtrVector::reshape( size_t n ) { std_pvector::resize(n); rwsize=n; }