System::Collections::Generic::Dictionary क्लास

Dictionary class

फॉरवर्ड डिक्लेरेशन ऑफ Dictionary क्लास।

template<typename TKey,typename TValue>class Dictionary : public System::Collections::Generic::BaseDictionary<std::unordered_map<TKey, TValue, EqualityComparerHashAdapter<TKey>, EqualityComparerAdapter<TKey>, ASPOSE_MAP_ALLOCATOR_TYPE(TKey, TValue)>>
पैरामीटरविवरण
TKeyकुंजी प्रकार।
TValueवैल्यू टाइप।

Nested classes

विधियाँ

विधिविवरण
Dictionary()खाली डिक्शनरी बनाता है।
Dictionary(const map_t&)मैप से डेटा कॉपी करता है।
Dictionary(int)ओवरलोड जो प्री-एलोकेटेड डिक्शनरी बनाने से मेल खाता है; वास्तव में कोई एलोकेशन नहीं करता।
Dictionary(const SharedPtr<IDictionary<TKey, TValue>>&)कॉपी कंस्ट्रक्टर।
Dictionary(const SharedPtr<IDictionary<TKey, TValue>>&, const SharedPtr<IEqualityComparer<TKey>>&)कॉपी कंस्ट्रक्टर।
Dictionary(const SharedPtr<IEqualityComparer<TKey>>&)खाली डिक्शनरी बनाता है।
Dictionary(int, const SharedPtr<IEqualityComparer<TKey>>&)खाली डिक्शनरी बनाता है।
GetEnumerator() overrideएन्यूमरेटर ऑब्जेक्ट बनाता है।

Typedefs

टाइपडिफ़विवरण
IEnumerablePtrएन्यूमेरेबल इंटरफ़ेस का पॉइंटर।
IEnumeratorPtrएन्यूमेरेटर का पॉइंटर।
KeyCollectionRTTI जानकारी।
KVPairकी-वैल्यू जोड़ी प्रकार।
map_tअधोस्थ डेटा प्रकार।
Ptrपॉइंटर प्रकार।
ValueCollectionनिकालने के लिए मानों का संग्रह।

टिप्पणियाँ

Dictionary that maps values to keys. 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.

#include <system/collections/dictionary.h>
#include <system/smart_ptr.h>

using namespace System;
using namespace System::Collections::Generic;

int main()
{
  // Dictionary-क्लास का इंस्टेंस बनाएं।
  auto dictionary = MakeObject<Dictionary<int, String>>();

  // डिक्शनरी को भरें।
  dictionary->Add(0, u"Foo");
  dictionary->Add(1, u"Bar");
  dictionary->Add(2, u"Baz");

  // डिक्शनरी आइटम्स को प्रिंट करें।
  for (const auto &pair: dictionary)
  {
    std::cout << pair.get_Key() << " - " << pair.get_Value() << std::endl;
  }

  return 0;
}
/*
This code example produces the following output:
0 - Foo
1 - Bar
2 - Baz
*/

संबंधित देखें