ReusableResourceStoreBase<TResource> Class

Definition

Provides a base class for storing a frequently-used object that can be reused instead of reallocated, such as StringBuilders or small arrays.

generic <typename TResource>
 where TResource : classpublic ref class ReusableResourceStoreBase abstract
public abstract class ReusableResourceStoreBase<TResource> where TResource : class
type ReusableResourceStoreBase<'Resource (requires 'Resource : null)> = class
Public MustInherit Class ReusableResourceStoreBase(Of TResource)

Type Parameters

TResource

The type of object stored by this store.

Inheritance
ReusableResourceStoreBase<TResource>
Derived

Constructors

ReusableResourceStoreBase<TResource>()

Initializes a new instance of ReusableResourceStoreBase.

Methods

AcquireCore()

Gets access to the resource stored by this object, and removes the resource so that subsequent callers cannot be handed the same resource at the same time.

Cleanup(TResource)

Immediately before releasing an object, performs cleanup on that object. This might be necessary to clean up state stored in the object to prevent leaking memory.

Applies to