CoreLinux++  0.4.32
Public Member Functions | Protected Member Functions | List of all members
corelinux::AbstractAllocator< TypeImpl > Class Template Referenceabstract

AbstractAllocator is a abstract template which provides for the extension of memory managment on a TypeImpl object by TypeImpl object basis. More...

#include <AbstractAllocator.hpp>

Public Member Functions

 AbstractAllocator (void)
 Default constructor.
 
 AbstractAllocator (const AbstractAllocator &aRef)
 Copy constructor. More...
 
virtual ~AbstractAllocator (void)
 Virtual destructor.
 
AbstractAllocatoroperator= (const AbstractAllocator &aRef)
 Assingment operator overload. More...
 
bool operator== (const AbstractAllocator &aRef) const
 Equality operator overload. More...
 
TypeImpl * createType (void)
 Create type will invoke the allocateObject method of the derivation and will increment the number of allocations. More...
 
void destroyType (TypeImpl *aPtr)
 Destroy type will invoke the deallocateObject method of the derivation and will increment the number of deallocation. More...
 
- Public Member Functions inherited from corelinux::Allocator
 Allocator (void)
 Default constructor.
 
 Allocator (AllocatorCref)
 Copy constructor. More...
 
virtual ~Allocator (void)
 Virtual destructor.
 
Allocatoroperator= (AllocatorCref)
 Assingment operator overload. More...
 
bool operator== (AllocatorCref) const
 Equality operator overload. More...
 
virtual CountCref getAllocateCount (void) const
 Retrieves the number of allocations by this Allocator. More...
 
virtual CountCref getDeallocateCount (void) const
 Retrieves the number of deallocations by this Allocator. More...
 
virtual void incrementAllocates (void)
 Increment the allocates.
 
virtual void decrementAllocates (void)
 Decrement the allocates.
 
virtual void incrementDeallocates (void)
 Increment the deallocates.
 
virtual void decrementDeallocates (void)
 Decrement the deallocates.
 
- Public Member Functions inherited from corelinux::Strategy
 Strategy (void)
 Default Constructor.
 
 Strategy (StrategyCref)
 Copy Constructor. More...
 
virtual ~Strategy (void)
 Virtual Destructor.
 
StrategyRef operator= (StrategyCref)
 Assignment operator overload. More...
 
bool operator== (StrategyCref) const
 Equality operator overload. More...
 
bool operator!= (StrategyCref) const
 Non-equality operator overload. More...
 

Protected Member Functions

virtual TypeImpl * allocateObject (void)=0
 allocates a object in the subclass More...
 
virtual void deallocateObject (TypeImpl *)=0
 de-allocates a object in the subclass More...
 

Detailed Description

template<class TypeImpl>
class corelinux::AbstractAllocator< TypeImpl >

AbstractAllocator is a abstract template which provides for the extension of memory managment on a TypeImpl object by TypeImpl object basis.

The derivation needs to implement the allocateObject and deallocateObject mutators for memory management.

See Also
Allocator, AbstractFactory

Constructor & Destructor Documentation

template<class TypeImpl >
corelinux::AbstractAllocator< TypeImpl >::AbstractAllocator ( const AbstractAllocator< TypeImpl > &  aRef)
inline

Copy constructor.

Parameters
AbstractAllocatorconst reference

Member Function Documentation

template<class TypeImpl >
virtual TypeImpl* corelinux::AbstractAllocator< TypeImpl >::allocateObject ( void  )
protectedpure virtual

allocates a object in the subclass

Returns
TypeImpl pointer

Referenced by corelinux::AbstractAllocator< TypeImpl >::createType().

template<class TypeImpl >
TypeImpl* corelinux::AbstractAllocator< TypeImpl >::createType ( void  )
inline

Create type will invoke the allocateObject method of the derivation and will increment the number of allocations.

In the event of any exception, the allocation count will be adjusted.

Returns
TypeImpl pointer
Exceptions
any

References corelinux::AbstractAllocator< TypeImpl >::allocateObject(), corelinux::Allocator::decrementAllocates(), and corelinux::Allocator::incrementAllocates().

template<class TypeImpl >
virtual void corelinux::AbstractAllocator< TypeImpl >::deallocateObject ( TypeImpl *  )
protectedpure virtual

de-allocates a object in the subclass

Parameters
TypeImplpointer

Referenced by corelinux::AbstractAllocator< TypeImpl >::destroyType().

template<class TypeImpl >
void corelinux::AbstractAllocator< TypeImpl >::destroyType ( TypeImpl *  aPtr)
inline

Destroy type will invoke the deallocateObject method of the derivation and will increment the number of deallocation.

In the event of any exception, the deallocation count will be adjusted

Parameters
TypeImplpointer
Exceptions
any

References corelinux::AbstractAllocator< TypeImpl >::deallocateObject(), corelinux::Allocator::decrementDeallocates(), and corelinux::Allocator::incrementDeallocates().

template<class TypeImpl >
AbstractAllocator& corelinux::AbstractAllocator< TypeImpl >::operator= ( const AbstractAllocator< TypeImpl > &  aRef)
inline

Assingment operator overload.

Parameters
AbstractAllocatorconst reference
Returns
AbstractAllocator reference to self

References corelinux::Allocator::operator=().

template<class TypeImpl >
bool corelinux::AbstractAllocator< TypeImpl >::operator== ( const AbstractAllocator< TypeImpl > &  aRef) const
inline

Equality operator overload.

Parameters
AbstractAllocatorconst reference
Returns
true if same identity

References corelinux::Allocator::operator==().


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

This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium