xtd 0.2.0
Loading...
Searching...
No Matches
idictionary.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "icollection.hpp"
6#include "key_value_pair.hpp"
7#include "list.hpp"
8
10namespace xtd {
12 namespace collections {
14 namespace generic {
34 template<typename key_t, typename value_t>
35 class idictionary : public xtd::collections::generic::ienumerable<xtd::collections::generic::key_value_pair<key_t, value_t>> /* xtd::collections::generic::icollection<xtd::collections::generic::key_value_pair<key_t, value_t>> */ {
36 public:
38
41 using key_type = key_t;
43 using mapped_type = value_t;
55
57
62 virtual key_collection keys() const noexcept = 0;
63
67 virtual value_collection values() const noexcept = 0;
69
71
80 virtual void add(const key_t& key, const value_t value) = 0;
82
84
94 virtual const value_t& operator [](const key_t& key) const = 0;
103 virtual value_t& operator [](const key_t& key) = 0;
105 };
106 }
107 }
108}
typename ienumerable< type_t >::const_iterator const_iterator
Represents the const iterator of xtd::collections::generic::ienumerable value type.
Definition icollection.hpp:52
typename ienumerable< type_t >::iterator iterator
Represents the iterator of xtd::collections::generic::ienumerable value type.
Definition icollection.hpp:50
Represents a generic collection of key/value pairs.
Definition idictionary.hpp:35
typename xtd::collections::generic::icollection< value_type >::const_iterator const_iterator
Represents the const iterator of xtd::collections::generic::ienumerable value type.
Definition idictionary.hpp:49
virtual key_collection keys() const noexcept=0
Gets an xtd::collections::generic::icollection <type_t> containing the keys of the xtd::collections::...
key_t key_type
Represents the dictionary key type.
Definition idictionary.hpp:41
typename xtd::collections::generic::icollection< value_type >::iterator iterator
Represents the iterator of xtd::collections::generic::ienumerable value type.
Definition idictionary.hpp:47
virtual value_collection values() const noexcept=0
Gets an xtd::collections::generic::icollection <type_t> containing the values of the xtd::collections...
value_t mapped_type
Represents the dictionary mapped type.
Definition idictionary.hpp:43
Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
Definition ienumerable.hpp:36
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search...
Definition list.hpp:75
@ add
The Add key.
Contains xtd::collections::ienumerator alias.
Contains xtd::collections::key_value_pair <key_t, value_t> struct.
Contains xtd::collections::generic::list <value_t> class.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Defines a key/value pair that can be set or retrieved.
Definition key_value_pair.hpp:36