3rd Eye Scene C#
3rd Eye Scene C# documentation
Tes::Buffers::DefaultArrayPool< T > Class Template Reference
Inheritance diagram for Tes::Buffers::DefaultArrayPool< T >:
Tes::Buffers::ArrayPool< T > Tes::Buffers::ArrayPool< T >

List of all members.

Classes

class  Bucket
 Provides a thread-safe bucket containing buffers that can be Rent'd and Return'd.

Public Member Functions

override T[] Rent (int minimumLength)
 Retrieves a buffer that is at least the requested length.
override void Return (T[] array, bool clearArray=false)
 Returns to the pool an array that was previously obtained via Rent on the same ArrayPool{T} instance.

template<T>
class Tes::Buffers::DefaultArrayPool< T >


Member Function Documentation

template<T >
override T [] Tes::Buffers::DefaultArrayPool< T >::Rent ( int  minimumLength) [inline, virtual]

Retrieves a buffer that is at least the requested length.

Parameters:
minimumLengthThe minimum length of the array needed.
Returns:
An T:T[] that is at least minimumLength in length.

This buffer is loaned to the caller and should be returned to the same pool via Return so that it may be reused in subsequent usage of Rent. It is not a fatal error to not return a rented buffer, but failure to do so may lead to decreased application performance, as the pool may need to create a new buffer to replace the one lost.

Implements Tes::Buffers::ArrayPool< T >.

template<T >
override void Tes::Buffers::DefaultArrayPool< T >::Return ( T[]  array,
bool  clearArray = false 
) [inline, virtual]

Returns to the pool an array that was previously obtained via Rent on the same ArrayPool{T} instance.

Parameters:
arrayThe buffer previously obtained from Rent to return to the pool.
clearArrayIf true and if the pool will store the buffer to enable subsequent reuse, Return will clear array of its contents so that a subsequent consumer via Rent will not see the previous consumer's content. If false or if the pool will release the buffer, the array's contents are left unchanged.

Once a buffer has been returned to the pool, the caller gives up all ownership of the buffer and must not use it. The reference returned from a given call to Rent must only be returned via Return once. The default ArrayPool{T} may hold onto the returned buffer in order to rent it again, or it may release the returned buffer if it's determined that the pool already has enough buffers stored.

Implements Tes::Buffers::ArrayPool< T >.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations Properties Events