Asposecpplib
System::Collections::Generic::SortedDictionary< TKey, TValue > Class Template Reference

Sorted dictionary type forward declaration. More...

Classes

class  Enumerator
 Enumerator type to iterate through dictionary. 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. More...
 

Public Types

typedef ICollection< TKey > KeyCollection
 Key collection type. More...
 
typedef ICollection< TValue > ValueCollection
 Value collection type. More...
 
typedef std::map< TKey, TValue, ComparerAdapter< typename BasePointerType< TKey >::type >, ASPOSE_MAP_ALLOCATOR_TYPE(TKey, TValue)> map_t
 Underlying data type. More...
 
typedef SortedDictionary< TKey, TValue > this_t
 Self type. More...
 
typedef SharedPtr< this_tPtr
 Pointer type. More...
 
typedef KeyValuePair< TKey, TValue > KVPair
 Key-value pair type. More...
 
typedef SharedPtr< IEnumerable< KVPair > > IEnumerablePtr
 Collection of same elements. More...
 
typedef SharedPtr< IEnumerator< KVPair > > IEnumeratorPtr
 Enumerator type. More...
 

Public Member Functions

 SortedDictionary ()
 Constructs empty dictionary. More...
 
 SortedDictionary (const SharedPtr< IComparer< typename BasePointerType< TKey >::type > > &comparer)
 Constructs empty dictionary. More...
 
 SortedDictionary (const SharedPtr< IDictionary< TKey, TValue >> &src)
 Copy constructor. More...
 
 SortedDictionary (const SharedPtr< IDictionary< TKey, TValue >> &src, const SharedPtr< IComparer< typename BasePointerType< TKey >::type >> &comparer)
 Copy constructor. More...
 
SharedPtr< System::Collections::Generic::IComparer< TKey > > get_Comparer () const
 Gets the IComparer<TKey> used to order the elements of the SortedDictionary<TKey,TValue>. More...
 
IEnumeratorPtr GetEnumerator () override
 Gets enumerator to iterate through current dictionary. More...
 

Static Public Member Functions

static SharedPtr< IComparer< typename BasePointerType< TKey >::type > > GetDefaultKeyComparer ()
 Singleton accessor function. More...
 

Detailed Description

template<typename TKey, typename TValue>
class System::Collections::Generic::SortedDictionary< TKey, TValue >

Sorted dictionary type forward declaration.

Sorted dictionary class wrapping STL map. 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 Parameters
TKeyKey type.
TValueValue type.

Member Typedef Documentation

◆ IEnumerablePtr

template<typename TKey , typename TValue >
typedef SharedPtr< IEnumerable<KVPair> > System::Collections::Generic::SortedDictionary< TKey, TValue >::IEnumerablePtr

Collection of same elements.

◆ IEnumeratorPtr

template<typename TKey , typename TValue >
typedef SharedPtr< IEnumerator<KVPair> > System::Collections::Generic::SortedDictionary< TKey, TValue >::IEnumeratorPtr

Enumerator type.

◆ KeyCollection

template<typename TKey , typename TValue >
typedef ICollection<TKey> System::Collections::Generic::SortedDictionary< TKey, TValue >::KeyCollection

Key collection type.

◆ KVPair

template<typename TKey , typename TValue >
typedef KeyValuePair<TKey, TValue> System::Collections::Generic::SortedDictionary< TKey, TValue >::KVPair

Key-value pair type.

◆ map_t

template<typename TKey , typename TValue >
typedef std::map<TKey, TValue, ComparerAdapter<typename BasePointerType<TKey>::type>, ASPOSE_MAP_ALLOCATOR_TYPE(TKey, TValue)> System::Collections::Generic::SortedDictionary< TKey, TValue >::map_t

Underlying data type.

◆ Ptr

template<typename TKey , typename TValue >
typedef SharedPtr<this_t> System::Collections::Generic::SortedDictionary< TKey, TValue >::Ptr

Pointer type.

◆ this_t

template<typename TKey , typename TValue >
typedef SortedDictionary<TKey, TValue> System::Collections::Generic::SortedDictionary< TKey, TValue >::this_t

Self type.

◆ ValueCollection

template<typename TKey , typename TValue >
typedef ICollection<TValue> System::Collections::Generic::SortedDictionary< TKey, TValue >::ValueCollection

Value collection type.

Constructor & Destructor Documentation

◆ SortedDictionary() [1/4]

template<typename TKey , typename TValue >
System::Collections::Generic::SortedDictionary< TKey, TValue >::SortedDictionary ( )
inline

Constructs empty dictionary.

◆ SortedDictionary() [2/4]

template<typename TKey , typename TValue >
System::Collections::Generic::SortedDictionary< TKey, TValue >::SortedDictionary ( const SharedPtr< IComparer< typename BasePointerType< TKey >::type > > &  comparer)
inline

Constructs empty dictionary.

Parameters
comparerComparer to use.

◆ SortedDictionary() [3/4]

template<typename TKey , typename TValue >
System::Collections::Generic::SortedDictionary< TKey, TValue >::SortedDictionary ( const SharedPtr< IDictionary< TKey, TValue >> &  src)
inline

Copy constructor.

Parameters
srcSource dictionary to copy data from.

◆ SortedDictionary() [4/4]

template<typename TKey , typename TValue >
System::Collections::Generic::SortedDictionary< TKey, TValue >::SortedDictionary ( const SharedPtr< IDictionary< TKey, TValue >> &  src,
const SharedPtr< IComparer< typename BasePointerType< TKey >::type >> &  comparer 
)
inline

Copy constructor.

Parameters
srcSource dictionary to copy data from.
comparerComparer to use.

Member Function Documentation

◆ get_Comparer()

template<typename TKey , typename TValue >
SharedPtr<System::Collections::Generic::IComparer<TKey> > System::Collections::Generic::SortedDictionary< TKey, TValue >::get_Comparer ( ) const
inline

Gets the IComparer<TKey> used to order the elements of the SortedDictionary<TKey,TValue>.

◆ GetDefaultKeyComparer()

template<typename TKey , typename TValue >
static SharedPtr<IComparer<typename BasePointerType<TKey>::type> > System::Collections::Generic::SortedDictionary< TKey, TValue >::GetDefaultKeyComparer ( )
inlinestatic

Singleton accessor function.

Returns
key default comparer.

◆ GetEnumerator()

template<typename TKey , typename TValue >
IEnumeratorPtr System::Collections::Generic::SortedDictionary< TKey, TValue >::GetEnumerator ( )
inlineoverride

Gets enumerator to iterate through current dictionary.

Returns
Pointer to newly created enumerator.