---
name: "corelinux_Allocator"
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_Allocator"
---

# corelinux\_Allocator(3)

Allocator is a Strategy class used by AbstractAllocator and AbstractFactory.Each Allocator instance tracks allocates and deallocates.

## NAME

corelinux::Allocator - **Allocator** is a **Strategy** class used by **AbstractAllocator** and AbstractFactory.Each **Allocator** instance tracks allocates and deallocates.

## SYNOPSIS

`#include <Allocator.hpp>`

Inherits **corelinux::Strategy**.

Inherited by **corelinux::AbstractAllocator\< TypeImpl \>**, and **corelinux::AbstractAllocator\< WallFlyweight \>**.

### Public Member Functions

**Allocator** (void)\
 *Default constructor.*  **Allocator** (**AllocatorCref**)\
 *Copy constructor.*  virtual **~Allocator** (void)\
 *Virtual destructor.*  **Allocator** & **operator=** (**AllocatorCref**)\
 *Assingment operator overload.*  bool **operator==** (**AllocatorCref**) const \
 *Equality operator overload.*  virtual CountCref **getAllocateCount** (void) const \
 *Retrieves the number of allocations by this* **Allocator***.*  virtual CountCref **getDeallocateCount** (void) const \
 *Retrieves the number of deallocations by this* **Allocator***.*  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.*

## Detailed Description

**Allocator** is a **Strategy** class used by **AbstractAllocator** and AbstractFactory.Each **Allocator** instance tracks allocates and deallocates.

**See also:**

**Strategy**, **AbstractAllocator**, **AbstractFactory**

## Constructor & Destructor Documentation

### corelinux::Allocator::Allocator (AllocatorCref)

Copy constructor. **Parameters:**

*Allocator* const reference

## Member Function Documentation

### CountCref corelinux::Allocator::getAllocateCount (void) const` [virtual]`

Retrieves the number of allocations by this **Allocator**. **Returns:**

Count - number of allocates

### CountCref corelinux::Allocator::getDeallocateCount (void) const` [virtual]`

Retrieves the number of deallocations by this **Allocator**. **Returns:**

Count - number of deallocates

### AllocatorRef corelinux::Allocator::operator= (AllocatorCref)

Assingment operator overload. **Parameters:**

*Allocator* const reference

**Returns:**

**Allocator** reference to self

### bool corelinux::Allocator::operator== (AllocatorCref) const

Equality operator overload. **Parameters:**

*Allocator* const reference

**Returns:**

true if same identity

## Author

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