Photon Server API Documentation v5.0RC1

Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
ExitGames.Memory.ObjectPool< T > Class Template Reference

Simple implementation of pool for fiber actions More...

Public Member Functions

Rent (Func< T > factory)
 returns an instance of T which might be used and should be returned Once using Return method More...
 
void Return (T rented)
 returns rented object to pool More...
 

Static Public Member Functions

static ObjectPool< T > Create (int maxElements)
 

Static Public Attributes

static readonly ObjectPool< T > Instance = new ObjectPool<T>(100)
 Reference for default pool More...
 

Protected Member Functions

 ObjectPool (int max)
 Creates new pool with min and max parameters More...
 

Detailed Description

Simple implementation of pool for fiber actions

Template Parameters
T
Type Constraints
T :class 

Constructor & Destructor Documentation

◆ ObjectPool()

ExitGames.Memory.ObjectPool< T >.ObjectPool ( int  max)
inlineprotected

Creates new pool with min and max parameters

Parameters
max

Member Function Documentation

◆ Create()

static ObjectPool<T> ExitGames.Memory.ObjectPool< T >.Create ( int  maxElements)
inlinestatic

Parameters
maxElements
Returns

◆ Rent()

T ExitGames.Memory.ObjectPool< T >.Rent ( Func< T >  factory)
inline

returns an instance of T which might be used and should be returned Once using Return method

Returns

◆ Return()

void ExitGames.Memory.ObjectPool< T >.Return ( rented)
inline

returns rented object to pool

Parameters
rented

Member Data Documentation

◆ Instance

readonly ObjectPool<T> ExitGames.Memory.ObjectPool< T >.Instance = new ObjectPool<T>(100)
static

Reference for default pool