Geant4-11
Data Structures | Namespaces | Macros
G4INCLAllocationPool.hh File Reference

Singleton for recycling allocation of instances of a given class. More...

#include "globals.hh"
#include <stack>
#include <new>
#include <cstddef>

Go to the source code of this file.

Data Structures

class  G4INCL::AllocationPool< T >
 

Namespaces

namespace  G4INCL
 

Macros

#define G4INCLALLOCATIONPOOL_HH
 
#define INCL_DECLARE_ALLOCATION_POOL(T)
 
#define INCLXX_IN_GEANT4_MODE   1
 

Detailed Description

Singleton for recycling allocation of instances of a given class.

Date
2nd October 2014
Author
Davide Mancusi

Definition in file G4INCLAllocationPool.hh.

Macro Definition Documentation

◆ G4INCLALLOCATIONPOOL_HH

#define G4INCLALLOCATIONPOOL_HH

Definition at line 46 of file G4INCLAllocationPool.hh.

◆ INCL_DECLARE_ALLOCATION_POOL

#define INCL_DECLARE_ALLOCATION_POOL (   T)
Value:
public: \
static void *operator new(size_t /* s */) { \
return allocator.getObject(); \
} \
static void operator delete(void *a, size_t /* s */) { \
allocator.recycleObject(static_cast<T *>(a)); \
}
static AllocationPool & getInstance()

Definition at line 103 of file G4INCLAllocationPool.hh.

◆ INCLXX_IN_GEANT4_MODE

#define INCLXX_IN_GEANT4_MODE   1

Definition at line 34 of file G4INCLAllocationPool.hh.