Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
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 119 of file G4CacheDetails.hh.

Member Function Documentation

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

Definition at line 238 of file G4CacheDetails.hh.

238  {
239  if ( cache && last ) {
240 #ifdef g4cdebug
241  cout<<"Destroying element"<<id<<" is last?"<<last<<"-Pointer template specialization-"<<endl;
242 #endif
243  delete cache;
244  cache = 0;
245  }
246 }
G4double & G4CacheReference< G4double >::GetCache ( unsigned int  id) const
inline

Definition at line 248 of file G4CacheDetails.hh.

248  {
249  return cache->operator[](id);
250 }
void G4CacheReference< G4double >::Initialize ( unsigned int  id)
inline

Definition at line 227 of file G4CacheDetails.hh.

228 {
229 #ifdef g4cdebug
230  cout<<"Specialized template for G4double"<<endl;
231 #endif
232  if ( cache == 0 )
233  cache = new cache_container;
234  if ( cache->size() <= id )
235  cache->resize(id+1,static_cast<G4double>(0));
236 }

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