Show / Hide Table of Contents

Class ThreadwiseKeyCache<Item>

The purpose of this class is to contain a cache of items, with a separate cache per thread. The use case is that some class needs to maintain a unique list of items, uses a cache for this, and wants the list to be kept separate for each thread - even if the instance of the cache and/or client class is the same.

Inheritance
object
ThreadwiseKeyCache<Item>
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.Threading
Assembly: SoCore.dll
Syntax
public class ThreadwiseKeyCache<Item>
Type Parameters
Name Description
Item

Constructors

ThreadwiseKeyCache()

The purpose of this class is to contain a cache of items, with a separate cache per thread. The use case is that some class needs to maintain a unique list of items, uses a cache for this, and wants the list to be kept separate for each thread - even if the instance of the cache and/or client class is the same.

Declaration
public ThreadwiseKeyCache()

ThreadwiseKeyCache(int)

The purpose of this class is to contain a cache of items, with a separate cache per thread. The use case is that some class needs to maintain a unique list of items, uses a cache for this, and wants the list to be kept separate for each thread - even if the instance of the cache and/or client class is the same.

Declaration
public ThreadwiseKeyCache(int defaultAllocationSize)
Parameters
Type Name Description
int defaultAllocationSize

Methods

Add(Item)

The purpose of this class is to contain a cache of items, with a separate cache per thread. The use case is that some class needs to maintain a unique list of items, uses a cache for this, and wants the list to be kept separate for each thread - even if the instance of the cache and/or client class is the same.

Declaration
public bool Add(Item item)
Parameters
Type Name Description
Item item
Returns
Type Description
bool

ContainsKey(Item)

The purpose of this class is to contain a cache of items, with a separate cache per thread. The use case is that some class needs to maintain a unique list of items, uses a cache for this, and wants the list to be kept separate for each thread - even if the instance of the cache and/or client class is the same.

Declaration
public bool ContainsKey(Item item)
Parameters
Type Name Description
Item item
Returns
Type Description
bool

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
ObjectExtensions.AssignByReflection<T>(T, T)
ObjectExtensions.GraphCopy<T>(T)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top