Compute Library
 19.08
ILifetimeManager Class Referenceabstract

Interface for managing the lifetime of objects. More...

#include <ILifetimeManager.h>

Public Member Functions

virtual ~ILifetimeManager ()=default
 Virtual Destructor. More...
 
virtual void register_group (IMemoryGroup *group)=0
 Registers a group to the lifetime manager and assigns a group id. More...
 
virtual void start_lifetime (void *obj)=0
 Registers and starts lifetime of an object. More...
 
virtual void end_lifetime (void *obj, IMemory &obj_memory, size_t size, size_t alignment)=0
 Ends lifetime of an object. More...
 
virtual bool are_all_finalized () const =0
 Checks if the lifetime of the registered object is complete. More...
 
virtual std::unique_ptr< IMemoryPoolcreate_pool (IAllocator *allocator)=0
 Creates a memory pool depending on the memory requirements. More...
 
virtual MappingType mapping_type () const =0
 Returns the type of mappings that the lifetime manager returns. More...
 

Detailed Description

Interface for managing the lifetime of objects.

Definition at line 41 of file ILifetimeManager.h.

Constructor & Destructor Documentation

◆ ~ILifetimeManager()

virtual ~ILifetimeManager ( )
virtualdefault

Virtual Destructor.

Member Function Documentation

◆ are_all_finalized()

virtual bool are_all_finalized ( ) const
pure virtual

Checks if the lifetime of the registered object is complete.

Returns
True if all object lifetimes are finalized else false.

Implemented in ISimpleLifetimeManager.

◆ create_pool()

virtual std::unique_ptr<IMemoryPool> create_pool ( IAllocator allocator)
pure virtual

Creates a memory pool depending on the memory requirements.

Parameters
allocatorAllocator to use
Returns
A memory pool

Implemented in BlobLifetimeManager, and OffsetLifetimeManager.

◆ end_lifetime()

virtual void end_lifetime ( void *  obj,
IMemory obj_memory,
size_t  size,
size_t  alignment 
)
pure virtual

Ends lifetime of an object.

Parameters
[in]objObject
[in]obj_memoryObject memory
[in]sizeSize of the given object at given time
[in]alignmentAlignment requirements for the object

Implemented in ISimpleLifetimeManager.

◆ mapping_type()

virtual MappingType mapping_type ( ) const
pure virtual

Returns the type of mappings that the lifetime manager returns.

Returns
Mapping type of the lifetime manager

Implemented in BlobLifetimeManager, and OffsetLifetimeManager.

◆ register_group()

virtual void register_group ( IMemoryGroup group)
pure virtual

Registers a group to the lifetime manager and assigns a group id.

Parameters
[in]groupThe group id of the group

Implemented in ISimpleLifetimeManager.

◆ start_lifetime()

virtual void start_lifetime ( void *  obj)
pure virtual

Registers and starts lifetime of an object.

Parameters
[in]objObject to register

Implemented in ISimpleLifetimeManager.


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