Photon Quantum 3.0.0

Public Member Functions | Public Attributes | List of all members
Photon.Deterministic.DeterministicCommandPool< T > Class Template Reference

Create a deterministic command pool for a specific command type. Make sure to reset all command data when reusing the objects. More...

Inheritance diagram for Photon.Deterministic.DeterministicCommandPool< T >:
Photon.Deterministic.IDeterministicCommandFactory Photon.Deterministic.IDeterministicCommandPool

Public Member Functions

DeterministicCommand Acquire ()
 Creates a new command or retrieves one from the pool. More...
 
DeterministicCommand GetCommandInstance ()
 Creates a new instance of the command and calls Acquire. More...
 
bool Release (DeterministicCommand cmd)
 Release a command and return it to the pool. More...
 

Public Attributes

Type CommandType => typeof(T)
 The type of the command that the pool is managing. More...
 

Additional Inherited Members

- Properties inherited from Photon.Deterministic.IDeterministicCommandFactory
Type CommandType [get]
 The type of commands to create. More...
 
- Properties inherited from Photon.Deterministic.IDeterministicCommandPool
Type CommandType [get]
 The type of commands pooled. More...
 

Detailed Description

Create a deterministic command pool for a specific command type. Make sure to reset all command data when reusing the objects.

Template Parameters
TCommand type
Type Constraints
T :DeterministicCommand 
T :new() 

Member Function Documentation

◆ GetCommandInstance()

Creates a new instance of the command and calls Acquire.

Returns

Implements Photon.Deterministic.IDeterministicCommandFactory.

◆ Acquire()

Creates a new command or retrieves one from the pool.

Returns
Command object

Implements Photon.Deterministic.IDeterministicCommandPool.

◆ Release()

Release a command and return it to the pool.

Parameters
cmdCommand instance
Returns
true if successfully returned to the pool

Implements Photon.Deterministic.IDeterministicCommandPool.

Member Data Documentation

◆ CommandType

Type Photon.Deterministic.DeterministicCommandPool< T >.CommandType => typeof(T)

The type of the command that the pool is managing.