System::Collections::Generic::IDictionary class

IDictionary class

Interface for dictionary-alike containers. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

template<typename TKey,typename TValue>class IDictionary : public System::Collections::Generic::ICollection<KeyValuePair<TKey, TValue>>
ParameterDescription
TKeyKey type.
TValueValue type.

Methods

MethodDescription
virtual Add(const TKey&, const TValue&)Adds key-value pair into container.
virtual ContainsKey(const TKey&) constChecks if container contains key.
CopyTo(ArrayPtr<KeyValuePair<TKey, TValue>>, int) overrideCopies dictionary contents into existing array elements.
get_IsFixedSize() constChecks if collection size is fixed.
get_IsSynchronized() constChecks if container is thread-safe.
virtual get_Keys() constAccesses key collection.
virtual get_Values() constAccesses value collection.
virtual GetValueOrDefault(const TKey&) constReturns value if found; or Value() otherwise.
virtual GetValueOrDefault(const TKey&, const TValue&) constReturns value if found; or defaultValue otherwise.
virtual GetValueOrNull(const TKey&) constReturns value if found; or null otherwise, make sense only for reference types.
virtual idx_get(const TKey&) constGetter function.
virtual idx_set(const TKey&, TValue)Setter function.
virtual Remove(const TKey&)Removes key from container.
virtual TryGetValue(const TKey&, TValue&) constLooks for value and retreives it if found.

Typedefs

TypedefDescription
BaseTypeRTTI information.
KeyValuePairTypeKey value pair type.

See Also