◆ TypedKeyMap() [1/2]
FiftyOne.Pipeline.Core.TypedMap.TypedKeyMap.TypedKeyMap | ( | ) |
Default constructor.
Creates a non-thread safe TypedKeyMap
\r\n
A collection that stores data of multiple different types.
Data is accessed using an ITypedKey<T> that specifies the unique 'name' to store the data under and the type of the data being stored.
TypedKeyMap ()
Default constructor. More...
| |
TypedKeyMap (bool threadSafe)
Constructor. More...
| |
void | Add< T > (ITypedKey< T > key, T data)
Add the specified data to the collection using the specified key. More...
|
T | Get< T > (ITypedKey< T > key)
Get the data associated with the specified key. More...
|
T | Get< T > ()
Get the data associated with the specified type. More...
|
ICollection< string > | GetKeys ()
Return string values of the keys in the map. More...
|
IDictionary< string, object > | AsStringKeyDictionary ()
Return the entire collection as a IDictionary<TKey, TValue> object. More...
|
bool | TryGetValue< T > (ITypedKey< T > key, out T value)
Check if the map contains an item with the specified key name and type. More...
|
FiftyOne.Pipeline.Core.TypedMap.TypedKeyMap.TypedKeyMap | ( | ) |
Default constructor.
Creates a non-thread safe TypedKeyMap
FiftyOne.Pipeline.Core.TypedMap.TypedKeyMap.TypedKeyMap | ( | bool | threadSafe | ) |
Constructor.
Creates a thread-safe or non-thread safe TypedKeyMap
void FiftyOne.Pipeline.Core.TypedMap.TypedKeyMap.Add< T > | ( | ITypedKey< T > | key, |
T | data | ||
) |
Add the specified data to the collection using the specified key.
Implements FiftyOne.Pipeline.Core.TypedMap.ITypedKeyMap.
IDictionary<string, object> FiftyOne.Pipeline.Core.TypedMap.TypedKeyMap.AsStringKeyDictionary | ( | ) |
Return the entire collection as a IDictionary<TKey, TValue> object.
Note that this is the actual internal dictionary instance so any changes to it will be reflected in the TypedKeyMap object.
Implements FiftyOne.Pipeline.Core.TypedMap.ITypedKeyMap.
T FiftyOne.Pipeline.Core.TypedMap.TypedKeyMap.Get< T > | ( | ITypedKey< T > | key | ) |
Get the data associated with the specified key.
If the key is not present or the data value is null then the return value will be default(T)
.
Implements FiftyOne.Pipeline.Core.TypedMap.ITypedKeyMap.
T FiftyOne.Pipeline.Core.TypedMap.TypedKeyMap.Get< T > | ( | ) |
Get the data associated with the specified type.
Implements FiftyOne.Pipeline.Core.TypedMap.ITypedKeyMap.
ICollection<string> FiftyOne.Pipeline.Core.TypedMap.TypedKeyMap.GetKeys | ( | ) |
Return string values of the keys in the map.
Implements FiftyOne.Pipeline.Core.TypedMap.ITypedKeyMap.
bool FiftyOne.Pipeline.Core.TypedMap.TypedKeyMap.TryGetValue< T > | ( | ITypedKey< T > | key, |
out T | value | ||
) |
Check if the map contains an item with the specified key name and type.
If it does exist, retrieve it.
Implements FiftyOne.Pipeline.Core.TypedMap.ITypedKeyMap.