Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

corelinux::AbstractAllocator Template Class Reference

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>

Inheritance diagram for corelinux::AbstractAllocator

Inheritance graph
[legend]
Collaboration diagram for corelinux::AbstractAllocator:

Collaboration graph
[legend]
List of all members.

Public Methods

 AbstractAllocator ( void )
 Default constructor.

 AbstractAllocator ( const AbstractAllocator & aRef )
 Copy constructor. More...

virtual ~AbstractAllocator ( void )
 Virtual destructor.

AbstractAllocator& operator= ( 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...


Protected Methods

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> template class corelinux::AbstractAllocator

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<classTypeImpl>
corelinux::AbstractAllocator<TypeImpl>::AbstractAllocator<TypeImpl> ( const AbstractAllocator<TypeImpl> & aRef )
 

Copy constructor.

Parameters:
AbstractAllocator   const reference


Member Function Documentation

template<classTypeImpl>
TypeImpl * corelinux::AbstractAllocator<TypeImpl>::allocateObject ( void ) [protected, pure virtual]
 

allocates a object in the subclass.

Returns:
TypeImpl pointer

Reimplemented in WallFactory.

template<classTypeImpl>
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  

template<classTypeImpl>
void corelinux::AbstractAllocator<TypeImpl>::deallocateObject ( TypeImpl * ) [protected, pure virtual]
 

de-allocates a object in the subclass.

Parameters:
TypeImpl   pointer

template<classTypeImpl>
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:
TypeImpl   pointer
Exceptions:
any  

template<classTypeImpl>
AbstractAllocator<TypeImpl> & corelinux::AbstractAllocator<TypeImpl>::operator= ( const AbstractAllocator<TypeImpl> & aRef ) [inline]
 

Assingment operator overload.

Parameters:
AbstractAllocator   const reference
Returns:
AbstractAllocator reference to self

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

Equality operator overload.

Parameters:
AbstractAllocator   const reference
Returns:
true if same identity


The documentation for this class was generated from the following file:
This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium