Lumiera
0.pre.03
»edit your freedom«
|
#include "lib/typed-allocation-manager.hpp"
Foundation for a custom allocation manager, tracking the created objects by smart-ptrs.
The public interface provides forwarding functions to invoke the ctor of the objects to be created, thereby placing them into the storage maintained by a low-level allocator or pooled storage manager. The created smart-ptr owns the new object and is wired internally to #releaseSlot. Subclasses may also directly allocate and de-allocate such a (typed) storage slot.
Definition at line 102 of file typed-allocation-manager.hpp.
Public Member Functions | |
template<class XX , typename... ARGS> | |
shared_ptr< XX > | create (ARGS &&...args) |
template<class XX > | |
size_t | numSlots () const |
Classes | |
class | Killer |
opaque link to the manager, to be used by handles and smart-ptrs to trigger preconfigured destruction. More... | |
struct | Slot |
a token representing a newly opened slot capable for holding an object of type XOX . More... | |
Friends | |
template<class > | |
class | Killer |
especially all Killers are entitled to desroyElement() | |
Protected Member Functions | |
template<class XX > | |
Slot< XX > | allocateSlot () |
template<class XX > | |
void | destroyElement (XX *entry) |
template<class XX > | |
void | releaseSlot (void *entry) |
Private Types | |
typedef TypedAllocationManager | _TheManager |
Private Attributes | |
lib::TypedCounter | allocCnt_ |