// // ******************************************************************** // * 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: tpvector.icc,v 1.8.4.1 2001/06/28 19:09:58 gunter Exp $ // GEANT4 tag $Name: $ // // //--------------------------------------------------------------- // 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()) { size_t e=n-std_pvector::size(); for(size_t i=0;i void G4RWTPtrVector::reshape( size_t n ) { std_pvector::resize(n); rwsize=n; }