# InternalPacketPool Class Reference

Manage Internal Packet using pools. More...

`#include <InternalPacketPool.h>`

List of all members.

## Public Member Functions

| InternalPacketPool ()
| ~InternalPacketPool ()
InternalPacket * | GetPointer (void)
void | ReleasePointer (InternalPacket *p)
void | ClearPool (void)

## Static Public Member Functions

static InternalPacketPool * | Instance ()

## Private Attributes

BasicDataStructures::Queue< InternalPacket * > | pool
SimpleMutex | poolMutex

## Static Private Attributes

static InternalPacketPool | I

## Detailed Description

Manage Internal Packet using pools.

This class provide memory management for packets used internaly in RakNet.

See also:
  PacketPool

Note:
  Implement Singleton Pattern

## Constructor & Destructor Documentation

InternalPacketPool::InternalPacketPool | ( |  | ) |

| Constructor

InternalPacketPool::~InternalPacketPool | ( |  | ) |

| Destructor

## Member Function Documentation

void InternalPacketPool::ClearPool | ( | void |  | ) |

| Clear the pool

InternalPacket * InternalPacketPool::GetPointer | ( | void |  | ) |

Retrieve a new InternalPacket instance.

Returns:
  a pointer to an InternalPacket structure.

static InternalPacketPool* InternalPacketPool::Instance | ( |  | ) | `[inline, static]`

static function because only static functions can access static members

Returns:
  the unique instance of the class InternalPacketPool.

Note:
  Singleton pattern unique instance access function.

void InternalPacketPool::ReleasePointer | ( | InternalPacket * | p | ) |

Free am InternalPacket instance

Parameters:

  | p | a pointer to the InternalPacket instance.

## Member Data Documentation

InternalPacketPool InternalPacketPool::I `[static, private]`

| Unique Instance

BasicDataStructures::Queue<InternalPacket*> InternalPacketPool::pool `[private]`

| InternalPacket pool

SimpleMutex InternalPacketPool::poolMutex `[private]`

| Multithread access management

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

- Projects/raknet/include/raknet/InternalPacketPool.h
- Projects/raknet/Source/InternalPacketPool.cpp