Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
TypedAllocationManager Class Reference

#include "lib/typed-allocation-manager.hpp"

Description

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.

Todo:
currently (as of 8/09) the low-level pooled allocator isn't implemented; instead we do just heap allocations. see Ticket 231

Definition at line 93 of file typed-allocation-manager.hpp.

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...
 

Public Member Functions

template<class XX >
size_t numSlots () const
 
template<class XX , typename... ARGS>
shared_ptr< XX > create (ARGS &&...args)
 

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 releaseSlot (void *entry)
 
template<class XX >
void destroyElement (XX *entry)
 

Private Types

typedef TypedAllocationManager _TheManager
 

Private Attributes

lib::TypedCounter allocCnt_
 

Member Typedef Documentation

◆ _TheManager

Definition at line 95 of file typed-allocation-manager.hpp.

Member Function Documentation

◆ numSlots()

template<class XX >
size_t numSlots ( ) const

Definition at line 246 of file typed-allocation-manager.hpp.

References TypedAllocationManager::allocCnt_, and TypedCounter::get().

Referenced by PlacementIndex::Table::element_cnt(), CommandRegistry::instance_count(), and TypedAllocationManager_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

template<class XX , typename... ARGS>
shared_ptr< XX > create ( ARGS &&...  args)
inline

Definition at line 172 of file typed-allocation-manager.hpp.

Referenced by PlacementIndex::Table::addEntry(), CommandRegistry::createCloneImpl(), CommandRegistry::newCommandImpl(), TypedAllocationManager_test::run(), and PlacementIndex::Table::setupRoot().

+ Here is the caller graph for this function:

◆ allocateSlot()

template<class XX >
Slot< XX > allocateSlot ( )
inlineprotected

Definition at line 194 of file typed-allocation-manager.hpp.

References TypedAllocationManager::allocCnt_, and TypedCounter::inc().

+ Here is the call graph for this function:

◆ releaseSlot()

template<class XX >
void releaseSlot ( void *  entry)
inlineprotected

Definition at line 205 of file typed-allocation-manager.hpp.

References TypedAllocationManager::allocCnt_, and TypedCounter::dec().

+ Here is the call graph for this function:

◆ destroyElement()

template<class XX >
void destroyElement ( XX *  entry)
inlineprotected

Definition at line 217 of file typed-allocation-manager.hpp.

References lumiera_error().

Referenced by TypedAllocationManager::Killer< XOX >::operator()().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ allocCnt_

Friends And Related Symbol Documentation

◆ Killer

template<class >
friend class Killer
friend

especially all Killers are entitled to desroyElement()

Definition at line 235 of file typed-allocation-manager.hpp.

+ Collaboration diagram for TypedAllocationManager:

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