xtd 0.2.0
Loading...
Searching...
No Matches
icollection.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "ienumerable.hpp"
7#define __XTD_CORE_INTERNAL__
9#undef __XTD_CORE_INTERNAL__
10#include "../../object.hpp"
11#include "../../size.hpp"
12
14namespace xtd {
16 namespace collections {
18 namespace generic {
44 template<class type_t>
45 class icollection : public xtd::collections::generic::ienumerable<type_t>, public xtd::collections::generic::extensions::collection_common<type_t, icollection<type_t >> {
46 public:
48
53
55
59 [[nodiscard]] virtual auto count() const noexcept -> xtd::size = 0;
60
64 [[nodiscard]] virtual auto is_read_only() const noexcept -> bool = 0;
65
80 [[nodiscard]] virtual auto is_synchronized() const noexcept -> bool = 0;
81
103 [[nodiscard]] virtual auto sync_root() const noexcept -> const xtd::object& = 0;
105
107
112 virtual auto add(const type_t& item) -> void = 0;
113
117 virtual auto clear() -> void = 0;
118
123 [[nodiscard]] virtual auto contains(const type_t& item) const noexcept -> bool = 0;
124
129 virtual auto copy_to(xtd::array<type_t>& array, xtd::size array_index) const -> void = 0;
130
137 virtual auto remove(const type_t& item) -> bool = 0;
139 };
140 }
141 }
142}
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
xtd::any_object value_type
Definition ienumerable.hpp:46
Contains xtd::collections::generic::extensions::collection_common class.
Contains xtd::collections::generic::ienumerable <type_t> interface.
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
The xtd::collections::generic namespace contains interfaces and classes that define generic collectio...
Definition comparer.hpp:16
virtual auto remove(const type_t &item) -> bool=0
Removes the first occurrence of a specific object from the xtd::collections::generic::icollection <ty...
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 contains(const type_t &item) const noexcept -> bool=0
Determines whether the xtd::collections::generic::icollection <type_t> contains a specific value.
virtual auto copy_to(xtd::array< type_t > &array, xtd::size array_index) const -> void=0
Copies the elements of the xtd::collections::generic::icollection <type_t> to an xtd::array,...
virtual auto add(const type_t &item) -> void=0
Adds an item to the xtd::collections::generic::icollection <type_t>.
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 clear() -> void=0
Removes all items from the xtd::collections::generic::icollection <type_t>.
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 count() const noexcept -> xtd::size=0
Gets the number of elements contained in the xtd::collections::generic::icollection <type_t>.
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
std::add_cv_t< type_t > value_type
Represents the read_only_span value type.
Definition read_only_span.hpp:60
Contains xtd::object class.
Contains xtd::size type.