Empeld
Empeld plugin documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
pluginbase.Helpers.Collections.TypeCache< TKey, TVal > Class Template Reference

Public Member Functions

 TypeCache ()
 
void Cache< T > (TKey key, T val)
 
bool TryGetValue< T > (TKey key, out T val)
 

Constructor & Destructor Documentation

pluginbase.Helpers.Collections.TypeCache< TKey, TVal >.TypeCache ( )
12  {
13  }

Member Function Documentation

void pluginbase.Helpers.Collections.TypeCache< TKey, TVal >.Cache< T > ( TKey  key,
val 
)

Attribute: Tuple.Create(typeof(T), key)

= val;

Type Constraints
T :TVal 
16  : TVal
17  {
18  _cache[Tuple.Create(typeof(T), key)] = val;
19  }
bool pluginbase.Helpers.Collections.TypeCache< TKey, TVal >.TryGetValue< T > ( TKey  key,
out T  val 
)
Type Constraints
T :TVal 
22  : TVal
23  {
24  TVal outVal;
25  if (_cache.TryGetValue(Tuple.Create(typeof(T), key), out outVal)
26  && outVal is T)
27  {
28  val = (T)outVal;
29  return true;
30  }
31  val = default(T);
32  return false;
33  }

The documentation for this class was generated from the following file: