Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4CacheReference< G4double > Class Template Reference

#include <G4CacheDetails.hh>

Public Member Functions

void Initialize (unsigned int id)
 
void Destroy (unsigned int id, G4bool last)
 
G4doubleGetCache (unsigned int id) const
 

Detailed Description

template<>
class G4CacheReference< G4double >

Definition at line 120 of file G4CacheDetails.hh.

Member Function Documentation

void G4CacheReference< G4double >::Destroy ( unsigned int  id,
G4bool  last 
)
inline

Definition at line 256 of file G4CacheDetails.hh.

256  {
257 #endif
258  if ( cache && last ) {
259 #ifdef g4cdebug
260  cout<<"Destroying element"<<id<<" is last?"<<last<<"-Pointer template specialization-"<<endl;
261 #endif
262  delete cache;
263  cache = 0;
264  }
265 }
G4double & G4CacheReference< G4double >::GetCache ( unsigned int  id) const
inline

Definition at line 267 of file G4CacheDetails.hh.

267  {
268  return cache->operator[](id);
269 }
void G4CacheReference< G4double >::Initialize ( unsigned int  id)
inline

Definition at line 242 of file G4CacheDetails.hh.

243 {
244 #ifdef g4cdebug
245  cout<<"Specialized template for G4double"<<endl;
246 #endif
247  if ( cache == 0 )
248  cache = new cache_container;
249  if ( cache->size() <= id )
250  cache->resize(id+1,static_cast<G4double>(0));
251 }

The documentation for this class was generated from the following files: