xtd 0.2.0
Loading...
Searching...
No Matches
iset.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "ienumerable.hpp"
6#include "../../size.hpp"
7#include <limits>
8
10namespace xtd {
12 namespace collections {
14 namespace generic {
32 template<class type_t>
33 class iset : public ienumerable<type_t> {
34 public:
36
39 using key_type = type_t;
41 using value_type = type_t;
43 using iterator = typename icollection<type_t>::iterator;
45 using const_iterator = typename icollection<type_t>::const_iterator;
47
49
53 virtual auto count() const noexcept -> xtd::size = 0;
54
58 virtual auto is_read_only() const noexcept -> bool = 0;
59
74 virtual auto is_synchronized() const noexcept -> bool = 0;
75
97 virtual auto sync_root() const noexcept -> const xtd::object& = 0;
99
100
102
107 virtual auto add(const type_t& item) noexcept -> bool = 0;
108
112 virtual auto clear() -> void = 0;
113
118 virtual auto contains(const type_t& item) const noexcept -> bool = 0;
119
124 virtual auto copy_to(xtd::array<type_t>& array, xtd::size array_index) const -> void = 0;
125
129 virtual auto except_with(const xtd::collections::generic::ienumerable<type_t>& other) noexcept -> void = 0;
130
134 virtual auto intersect_with(const xtd::collections::generic::ienumerable<type_t>& other) noexcept -> void = 0;
135
139 virtual auto is_proper_subset_of(const xtd::collections::generic::ienumerable<type_t>& other) const noexcept -> bool = 0;
140
144 virtual auto is_proper_superset_of(const xtd::collections::generic::ienumerable<type_t>& other) const noexcept -> bool = 0;
145
149 virtual auto is_subset_of(const xtd::collections::generic::ienumerable<type_t>& other) const noexcept -> bool = 0;
150
154 virtual auto is_superset_of(const xtd::collections::generic::ienumerable<type_t>& other) const noexcept -> bool = 0;
155
159 virtual auto overlaps(const xtd::collections::generic::ienumerable<type_t>& other) const noexcept -> bool = 0;
160
167 virtual auto remove(const type_t& item) -> bool = 0;
168
172 virtual auto set_equals(const xtd::collections::generic::ienumerable<type_t>& other) const noexcept -> bool = 0;
173
177 virtual auto symetric_excep_with(const xtd::collections::generic::ienumerable<type_t>& other) noexcept -> void = 0;
178
182 virtual auto union_with(const xtd::collections::generic::ienumerable<type_t>& other) noexcept -> void = 0;
184 };
185 }
186 }
187}
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
Definition ienumerable.hpp:40
Provides the base interface for the abstraction of sets.
Definition iset.hpp:33
virtual auto is_read_only() const noexcept -> bool=0
Gets a value indicating whether the xtd::collections::generic::icollection <type_t> is read-only.
virtual auto is_proper_superset_of(const xtd::collections::generic::ienumerable< type_t > &other) const noexcept -> bool=0
Determines whether the current set is a proper (strict) superset of a specified collection.
virtual auto copy_to(xtd::array< type_t > &array, xtd::size array_index) const -> void=0
Copies the elements of the xtd::collections::generic::iset <type_t> to an xtd::array,...
virtual auto is_synchronized() const noexcept -> bool=0
Gets a value indicating whether access to the xtd::collections::generic::icollection <type_t> is sync...
virtual auto overlaps(const xtd::collections::generic::ienumerable< type_t > &other) const noexcept -> bool=0
Determines whether the current set overlaps with the specified collection.
virtual auto contains(const type_t &item) const noexcept -> bool=0
Determines whether the xtd::collections::generic::iset <type_t> contains a specific value.
virtual auto set_equals(const xtd::collections::generic::ienumerable< type_t > &other) const noexcept -> bool=0
Determines whether the current set and the specified collection contain the same elements.
virtual auto is_subset_of(const xtd::collections::generic::ienumerable< type_t > &other) const noexcept -> bool=0
Determines whether a set is a subset of a specified collection.
virtual auto count() const noexcept -> xtd::size=0
Gets the number of elements contained in the xtd::collections::generic::icollection <type_t>.
virtual auto except_with(const xtd::collections::generic::ienumerable< type_t > &other) noexcept -> void=0
Removes all elements in the specified collection from the current set.
virtual auto intersect_with(const xtd::collections::generic::ienumerable< type_t > &other) noexcept -> void=0
Modifies the current set so that it contains only elements that are also in a specified collection.
virtual auto is_proper_subset_of(const xtd::collections::generic::ienumerable< type_t > &other) const noexcept -> bool=0
Determines whether the current set is a proper (strict) superset of a specified collection.
virtual auto remove(const type_t &item) -> bool=0
Removes the first occurrence of a specific object from the xtd::collections::generic::iset <type_t>.
virtual auto union_with(const xtd::collections::generic::ienumerable< type_t > &other) noexcept -> void=0
Modifies the current set so that it contains all elements that are present in the current set,...
type_t value_type
Represents the set value type.
Definition iset.hpp:41
typename icollection< type_t >::iterator iterator
Represents the iterator of xtd::collections::generic::ienumerable value type.
Definition iset.hpp:43
virtual auto sync_root() const noexcept -> const xtd::object &=0
Gets an object that can be used to synchronize access to the the xtd::collections::generic::icollecti...
virtual auto is_superset_of(const xtd::collections::generic::ienumerable< type_t > &other) const noexcept -> bool=0
Determines whether a set is a superset of a specified collection.
type_t key_type
Represents the set key type.
Definition iset.hpp:39
typename icollection< type_t >::const_iterator const_iterator
Represents the const iterator of xtd::collections::generic::ienumerable value type.
Definition iset.hpp:45
virtual auto clear() -> void=0
Removes all items from the xtd::collections::generic::iset <type_t>.
virtual auto add(const type_t &item) noexcept -> bool=0
Adds an element to the current set and returns a value to indicate if the element was successfully ad...
virtual auto symetric_excep_with(const xtd::collections::generic::ienumerable< type_t > &other) noexcept -> void=0
Modifies the current set so that it contains only elements that are present either in the current set...
Contains xtd::collections::generic::ienumerable <type_t> interface.
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
@ other
The operating system is other.
Definition platform_id.hpp:60
The xtd::collections::generic namespace contains interfaces and classes that define generic collectio...
Definition comparer.hpp:16
The xtd::collections namespace contains interfaces and classes that define various collections of obj...
Definition any_pair.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::size type.