Photon Server API Documentation v5.0RC1

Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
ExitGames.Memory.TLSObjectPool< 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 TLSObjectPool< T > Create (int maxElements)
 

Static Public Attributes

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

Protected Member Functions

 TLSObjectPool (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 
T :new 

Constructor & Destructor Documentation

◆ TLSObjectPool()

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

Creates new pool with min and max parameters

Parameters
max

Member Function Documentation

◆ Create()

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

Parameters
maxElements
Returns

◆ Rent()

T ExitGames.Memory.TLSObjectPool< 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.TLSObjectPool< T >.Return ( rented)
inline

returns rented object to pool

Parameters
rented

Member Data Documentation

◆ Instance

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

Reference for default pool