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>>
| Parameter | Description |
|---|
| TKey | Key type. |
| TValue | Value type. |
Methods
| Method | Description |
|---|
| virtual Add(const TKey&, const TValue&) | Adds key-value pair into container. |
| virtual ContainsKey(const TKey&) const | Checks if container contains key. |
| CopyTo(ArrayPtr<KeyValuePair<TKey, TValue>>, int) override | Copies dictionary contents into existing array elements. |
| get_IsFixedSize() const | Checks if collection size is fixed. |
| get_IsSynchronized() const | Checks if container is thread-safe. |
| virtual get_Keys() const | Accesses key collection. |
| virtual get_Values() const | Accesses value collection. |
| virtual GetValueOrDefault(const TKey&) const | Returns value if found; or Value() otherwise. |
| virtual GetValueOrDefault(const TKey&, const TValue&) const | Returns value if found; or defaultValue otherwise. |
| virtual GetValueOrNull(const TKey&) const | Returns value if found; or null otherwise, make sense only for reference types. |
| virtual idx_get(const TKey&) const | Getter function. |
| virtual idx_set(const TKey&, TValue) | Setter function. |
| virtual Remove(const TKey&) | Removes key from container. |
| virtual TryGetValue(const TKey&, TValue&) const | Looks for value and retreives it if found. |
Typedefs
See Also