Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
Loading...
Searching...
No Matches
bertini::detail::Pool< ObjT, PointerPolicy > Class Template Reference

A process-wide cache of objects, held by pointer, that hands out shared references. More...

#include <pool.hpp>

Public Types

using HeldType = typename PointerPolicy::PointerType
 The pointer type the pool holds.
using PoolHolderType = std::vector< HeldType >
 The container of held pointers.

Static Public Member Functions

static HeldType NonPtrAdd (ObjT d)
 Add an object (by value) to the pool, returning the held pointer.
static HeldType PtrAdd (HeldType d)
 Add an already-held pointer to the pool, returning it.
template<typename ... Ts>
static HeldType Make (Ts &&...ts)
 Construct an object in place in the pool, returning the held pointer.
static void PurgeCache ()
 Drop pooled objects that are no longer referenced anywhere else.

Detailed Description

template<typename ObjT, class PointerPolicy = DefaultPointerPolicy<ObjT>>
class bertini::detail::Pool< ObjT, PointerPolicy >

A process-wide cache of objects, held by pointer, that hands out shared references.

Member Typedef Documentation

◆ HeldType

template<typename ObjT, class PointerPolicy = DefaultPointerPolicy<ObjT>>
using bertini::detail::Pool< ObjT, PointerPolicy >::HeldType = typename PointerPolicy::PointerType

The pointer type the pool holds.

◆ PoolHolderType

template<typename ObjT, class PointerPolicy = DefaultPointerPolicy<ObjT>>
using bertini::detail::Pool< ObjT, PointerPolicy >::PoolHolderType = std::vector< HeldType >

The container of held pointers.

Member Function Documentation

◆ Make()

template<typename ObjT, class PointerPolicy = DefaultPointerPolicy<ObjT>>
template<typename ... Ts>
HeldType bertini::detail::Pool< ObjT, PointerPolicy >::Make ( Ts &&... ts)
inlinestatic

Construct an object in place in the pool, returning the held pointer.

◆ NonPtrAdd()

template<typename ObjT, class PointerPolicy = DefaultPointerPolicy<ObjT>>
HeldType bertini::detail::Pool< ObjT, PointerPolicy >::NonPtrAdd ( ObjT d)
inlinestatic

Add an object (by value) to the pool, returning the held pointer.

◆ PtrAdd()

template<typename ObjT, class PointerPolicy = DefaultPointerPolicy<ObjT>>
HeldType bertini::detail::Pool< ObjT, PointerPolicy >::PtrAdd ( HeldType d)
inlinestatic

Add an already-held pointer to the pool, returning it.

◆ PurgeCache()

template<typename ObjT, class PointerPolicy = DefaultPointerPolicy<ObjT>>
void bertini::detail::Pool< ObjT, PointerPolicy >::PurgeCache ( )
inlinestatic

Drop pooled objects that are no longer referenced anywhere else.