---
name: "corelinux_AbstractFactory"
section: "3"
platform: "linux"
package: "libcorelinux-dev"
version: "0.4.32-5"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/corelinux_AbstractFactory"
---

# corelinux\_AbstractFactory(3)

AbstractFactory provides an interface for creating families of related or dependent objects without specifying their concrete classes.

## NAME

corelinux::AbstractFactory - **AbstractFactory** provides an interface for creating families of related or dependent objects without specifying their concrete classes.

## SYNOPSIS

`#include <AbstractFactory.hpp>`

Inherits **corelinux::CoreLinuxObject**.

### Public Member Functions

**AbstractFactory** (void)\
 *Default constructor.*  **AbstractFactory** (const  **AbstractFactory** &)\
 *Copy Constructor.*  virtual **~AbstractFactory** (void)\
 *Virtual Destructor.*  **AbstractFactory** & **operator=** (const  **AbstractFactory** &)\
 *Assignment operator.*  bool **operator==** (const  **AbstractFactory** &aRef) const \
 *Equality operator.*  virtual Count **getCreateCount** (void) const =0\
 *Returns the number of total creates for this factory.*  virtual Count **getDestroyCount** (void) const =0\
 *Returns the number of total destroys for this factory.*  virtual **AllocatorPtr** **getAllocator** (UniqueId) const =0  throw (AllocatorNotFoundException)\
 *Retrieve the allocator identified by argument from the implementation.*  virtual void **addAllocator** (UniqueId, **AllocatorPtr**)=0  throw (AllocatorAlreadyExistsException)\
 *Add a allocator to the factory implementation.*  virtual **AllocatorPtr** **removeAllocator** (UniqueId)=0  throw (AllocatorNotFoundException)\
 *Retrieve and remove the allocator identified by argument from the implementation.*  virtual **Iterator**\< **Allocator** \* \> \* **createIterator** (void) const =0\
 *Interface for creating an* **Iterator** *to iterate through the Allocators of an implementation.*  virtual void **destroyIterator** (**Iterator**\< **Allocator** \* \> \*) const =0\
 *Interface for returning a created* **Iterator***.*  virtual **AssociativeIterator**\< UniqueId, **Allocator** \* \> \* **createAssociativeIterator** (void) const =0\
 *Interface for creating an* **AssociativeIterator** *to iterate through the Identifiers and Allocators of an implementation.*  virtual void **destroyAssociativeIterator** (**AssociativeIterator**\< UniqueId, **Allocator** \* \> \*) const =0\
 *Interface for returning a created* **AssociativeIterator***.*

## Detailed Description

### template\<class UniqueId\> class corelinux::AbstractFactory\< UniqueId \>

**AbstractFactory** provides an interface for creating families of related or dependent objects without specifying their concrete classes.

**See also:**

**Allocator**, **AbstractAllocator**, **Identifier**, **Iterator**, **AssociativeIterator**

## Constructor & Destructor Documentation

### template\<class UniqueId\> corelinux::AbstractFactory\< UniqueId \>::AbstractFactory (const AbstractFactory\< UniqueId \> &)` [inline]`

Copy Constructor. **Parameters:**

*AbstractFactory* const reference

## Member Function Documentation

### template\<class UniqueId\> virtual void corelinux::AbstractFactory\< UniqueId \>::addAllocator (UniqueId, AllocatorPtr) throw (AllocatorAlreadyExistsException)` [pure virtual]`

Add a allocator to the factory implementation. **Parameters:**

*Allocator* pointer

**Exceptions:**

*AllocatorAlreadyExistsException* .RE

### template\<class UniqueId\> virtual AssociativeIterator\<UniqueId,Allocator \*\>\* corelinux::AbstractFactory\< UniqueId \>::createAssociativeIterator (void) const` [pure virtual]`

Interface for creating an **AssociativeIterator** to iterate through the Identifiers and Allocators of an implementation. **Returns:**

**AssociativeIterator** pointer of type \<**Identifier**,**Allocator** pointer\>

### template\<class UniqueId\> virtual Iterator\<Allocator \*\>\* corelinux::AbstractFactory\< UniqueId \>::createIterator (void) const` [pure virtual]`

Interface for creating an **Iterator** to iterate through the Allocators of an implementation. **Returns:**

**Iterator** pointer of type **Allocator** pointer

### template\<class UniqueId\> virtual void corelinux::AbstractFactory\< UniqueId \>::destroyAssociativeIterator (AssociativeIterator\< UniqueId, Allocator \* \> \*) const` [pure virtual]`

Interface for returning a created **AssociativeIterator**. **Returns:**

**Iterator** pointer of type \<**Identifier**,**Allocator** pointer\>

### template\<class UniqueId\> virtual void corelinux::AbstractFactory\< UniqueId \>::destroyIterator (Iterator\< Allocator \* \> \*) const` [pure virtual]`

Interface for returning a created **Iterator**. **Returns:**

**Iterator** pointer of type **Allocator** pointer

### template\<class UniqueId\> virtual AllocatorPtr corelinux::AbstractFactory\< UniqueId \>::getAllocator (UniqueId) const throw (AllocatorNotFoundException)` [pure virtual]`

Retrieve the allocator identified by argument from the implementation. **Parameters:**

*Identifier* const reference

**Returns:**

**Allocator** pointer

**Exceptions:**

*AllocatorNotFoundException* .RE

### template\<class UniqueId\> virtual Count corelinux::AbstractFactory\< UniqueId \>::getCreateCount (void) const` [pure virtual]`

Returns the number of total creates for this factory. **Returns:**

corelinux::Count

### template\<class UniqueId\> virtual Count corelinux::AbstractFactory\< UniqueId \>::getDestroyCount (void) const` [pure virtual]`

Returns the number of total destroys for this factory. **Returns:**

corelinux::Count

### template\<class UniqueId\> AbstractFactory& corelinux::AbstractFactory\< UniqueId \>::operator= (const AbstractFactory\< UniqueId \> &)` [inline]`

Assignment operator. **Parameters:**

*AbstractFactory* const reference

**Returns:**

**AbstractFactory** reference

### template\<class UniqueId\> bool corelinux::AbstractFactory\< UniqueId \>::operator== (const AbstractFactory\< UniqueId \> & aRef) const` [inline]`

Equality operator. **Parameters:**

*AbstractFactory* const reference

**Returns:**

bool - true if instances are same

### template\<class UniqueId\> virtual AllocatorPtr corelinux::AbstractFactory\< UniqueId \>::removeAllocator (UniqueId) throw (AllocatorNotFoundException)` [pure virtual]`

Retrieve and remove the allocator identified by argument from the implementation. **Parameters:**

*Identifier* const reference

**Returns:**

**Allocator** pointer

**Exceptions:**

*AllocatorNotFoundException* .RE

## Author

Generated automatically by Doxygen for CoreLinux++ from the source code.
