CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
keyvalue_list.h
1
2#ifndef _aspose_system_collections_key_value_list_h_
3#define _aspose_system_collections_key_value_list_h_
4
5#include <system/collections/keyvalue_collection.h>
6
7namespace System { namespace Collections { namespace Generic {
8
14template <typename Dict>
15class ASPOSECPP_SHARED_CLASS _KeyList : public _KeyCollection<Dict>
16{
17public:
19 typedef typename Dict::map_t::key_type TKey;
20
23 _KeyList(const typename Dict::Ptr& dict) : _KeyCollection<Dict>(dict) {}
24
25 // IList
29 virtual TKey idx_get(int index) const override { return (this->m_dict->data().begin() + index)->first; }
30
34 bool Contains(const TKey& item) const override
35 {
36 return this->m_dict->data().find(item) != this->m_dict->data().end();
37 }
38
39protected:
40 ~_KeyList() override = default;
41};
42
48template <typename Dict>
49class ASPOSECPP_SHARED_CLASS _ValueList : public _ValueCollection<Dict>
50{
51public:
53 typedef typename Dict::map_t::mapped_type TValue;
54
57 _ValueList(const typename Dict::Ptr& dict) : _ValueCollection<Dict>(dict) {}
58
59 // IList
63 virtual TValue idx_get(int index) const { return (this->m_dict->data().begin() + index)->second; }
64};
65
66}}}
67
68#endif // _aspose_system_collections_key_value_list_h_
Collection of Dictionary's keys. References collection, doesn't copy anything. Objects of this class ...
Definition: keyvalue_collection.h:94
Dict::map_t::key_type TKey
Key type.
Definition: keyvalue_collection.h:97
Implements list of dictionary's keys. Objects of this class should only be allocated using System::Ma...
Definition: keyvalue_list.h:16
bool Contains(const TKey &item) const override
Checks if specified key is present in collection.
Definition: keyvalue_list.h:34
_KeyList(const typename Dict::Ptr &dict)
Initializes collection referencing specified dictionary.
Definition: keyvalue_list.h:23
virtual TKey idx_get(int index) const override
Gets key at specified position.
Definition: keyvalue_list.h:29
Dict::map_t::key_type TKey
Key type.
Definition: keyvalue_list.h:19
Collection of Dictionary's values. References collection, doesn't copy anything. Objects of this clas...
Definition: keyvalue_collection.h:248
Dict::map_t::mapped_type TValue
Value type.
Definition: keyvalue_collection.h:251
Implements list of dictionary's values. Objects of this class should only be allocated using System::...
Definition: keyvalue_list.h:50
_ValueList(const typename Dict::Ptr &dict)
Initializes collection referencing specified dictionary.
Definition: keyvalue_list.h:57
virtual TValue idx_get(int index) const
Gets value at specified position.
Definition: keyvalue_list.h:63
Dict::map_t::mapped_type TValue
Value type.
Definition: keyvalue_list.h:53
Definition: db_command.h:9