lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
Pool.hh File Reference

Pool, the abstract base of fixed-size buffer pools, and the PoolDeclare macro that routes a class's new and delete through a pool. More...

#include "PoolEntry.hh"
#include <cstdint>

Classes

class  Pds::Pool
 Abstract pool of numberofObjects equal buffers, each preceded by a PoolEntry, with allocation and free counters. More...
 

Namespaces

namespace  Pds
 Outer namespace of the HSD digitizer helpers.
 

Macros

#define PoolDeclare
 Declares an operator new(size, Pool*) that allocates from the pool and an operator delete that returns the buffer with Pool::free(); put it in a class body to allocate that class from a Pool.
 

Detailed Description

Pool, the abstract base of fixed-size buffer pools, and the PoolDeclare macro that routes a class's new and delete through a pool.

Macro Definition Documentation

◆ PoolDeclare

#define PoolDeclare
Value:
void* operator new (size_t size, \
Pool* pool) { return pool->alloc(size); } \
void operator delete(void* buffer) { Pool::free(buffer); }

Declares an operator new(size, Pool*) that allocates from the pool and an operator delete that returns the buffer with Pool::free(); put it in a class body to allocate that class from a Pool.