Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
OwnUniqueAdapter< FAC > Class Template Reference

#include "lib/allocator-handle.hpp"

Description

template<class FAC>
class lib::allo::OwnUniqueAdapter< FAC >

Adapter to use a generic factory FAC for creating managed object instances with unique ownership.

Generated objects are attached to a std::unique_ptr handle, which enforces scoped ownership and destroys automatically. The factory can either be stateless (≙monostate) or tied to a distinct, statefull allocator or manager backend. In the latter case, this adapter must be created with appropriate wiring and each generated unique_ptr handle will also carry a back-reference to the manager instance.

Definition at line 223 of file allocator-handle.hpp.

Classes

struct  StatefulDeleter
 < More...
 

Public Member Functions

 OwnUniqueAdapter (FAC const &factory)
 
template<class TY , typename... ARGS>
auto make_unique (ARGS &&...args)
 Factory function: generate object with scoped ownership and automated clean-up.
 

Static Private Member Functions

template<typename TY >
static void dispose (TY *elm)
 

Constructor & Destructor Documentation

◆ OwnUniqueAdapter()

template<class FAC >
OwnUniqueAdapter ( FAC const &  factory)
inline

Definition at line 251 of file allocator-handle.hpp.

Member Function Documentation

◆ dispose()

template<class FAC >
template<typename TY >
static void dispose ( TY *  elm)
inlinestaticprivate
Parameters
elm

callback for unique_ptr using stateless FAC

Definition at line 228 of file allocator-handle.hpp.

Referenced by OwnUniqueAdapter< FAC >::make_unique().

+ Here is the caller graph for this function:

◆ make_unique()

template<class FAC >
template<class TY , typename... ARGS>
auto make_unique ( ARGS &&...  args)
inline

Factory function: generate object with scoped ownership and automated clean-up.

Definition at line 261 of file allocator-handle.hpp.

References OwnUniqueAdapter< FAC >::dispose().

Referenced by TestTracking_test::demonstrate_checkAllocator().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:
+ Inheritance diagram for OwnUniqueAdapter< FAC >:
+ Collaboration diagram for OwnUniqueAdapter< FAC >:

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