Enhanced C#
Loyc library documentation
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Public Member Functions | List of all members
Loyc.Collections.IAutoCreatePool< in TKey, out TValue > Interface Template Reference

Represents a pool of objects in which an object is automatically created when requested by its key. More...


Source file:
Inheritance diagram for Loyc.Collections.IAutoCreatePool< in TKey, out TValue >:
Loyc.Collections.IIndexed< in K, out V >

Remarks

Represents a pool of objects in which an object is automatically created when requested by its key.

Template Parameters
TKeyKey type.
TValueValue type.

This design assumes that the values in the pool know their own key, so it implements IEnumerable{TValue} rather than IEnumerable{KeyValuePair{TKey,TValue}}.

Public Member Functions

TValue GetIfExists (TKey key)
 Gets the item with the specified key, if it was created earlier. More...
 

Additional Inherited Members

- Properties inherited from Loyc.Collections.IIndexed< in K, out V >
this[K key] [get]
 Gets the value associated with the specified key. More...
 

Member Function Documentation

TValue Loyc.Collections.IAutoCreatePool< in TKey, out TValue >.GetIfExists ( TKey  key)

Gets the item with the specified key, if it was created earlier.

Returns
The value corresponding to the specified key, or default(TValue) if the value has not been created.