xtd 1.0.0
Loading...
Searching...
No Matches
ilist.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "icollection.hpp"
6#include "../../bpos.hpp"
7#include "../../epos.hpp"
8#include "../../npos.hpp"
9#include "../../usize.hpp"
10
12namespace xtd {
14 namespace collections {
16 namespace generic {
42 template<typename type_t>
43 class ilist : public icollection<type_t> {
44 public:
46
56 inline static constexpr xtd::usize npos = xtd::npos;
57
66 static inline constexpr xtd::usize bpos = 0;
67
84 static inline constexpr xtd::usize epos = npos - 1;
86
88
92 [[nodiscard]] virtual auto count() const noexcept -> xtd::usize = 0;
93
97 virtual auto is_fixed_size() const noexcept -> bool = 0;
98
102 [[nodiscard]] virtual auto is_read_only() const noexcept -> bool = 0;
103
118 [[nodiscard]] virtual auto is_synchronized() const noexcept -> bool = 0;
119
141 [[nodiscard]] virtual auto sync_root() const noexcept -> const xtd::object& = 0;
143
145
150 virtual auto add(const type_t& item) -> void = 0;
151
155 virtual auto clear() -> void = 0;
156
161 [[nodiscard]] virtual auto contains(const type_t& item) const noexcept -> bool = 0;
162
167 virtual auto copy_to(xtd::array<type_t>& array, xtd::usize array_index) const -> void = 0;
168
171 [[nodiscard]] virtual auto get_enumerator() const -> xtd::collections::generic::enumerator<type_t> = 0;
172
177 [[nodiscard]] virtual auto index_of(const type_t& item) const noexcept -> xtd::usize = 0;
178
186 virtual auto insert(xtd::usize index, const type_t& item) -> void = 0;
187
194 virtual auto remove(const type_t& item) -> bool = 0;
195
201 virtual auto remove_at(xtd::usize index) -> void = 0;
203
205
210 virtual auto operator [](xtd::usize index) const -> const type_t& = 0;
214 virtual auto operator [](xtd::usize index) -> type_t& = 0;
216 };
217 }
218 }
219}
Contains xtd::epos constant.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
Contains xtd::epos constant.
Contains xtd::collections::generic::icollection <type_t> interface.
constexpr auto npos
Represents a value that is not a valid position in a collection.
Definition npos.hpp:26
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
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 is_synchronized() const noexcept -> bool=0
Gets a value indicating whether access to the xtd::collections::generic::icollection <type_t> is sync...
virtual auto insert(xtd::usize index, const type_t &item) -> void=0
Inserts an item to the xtd::collections::generic::ilist <type_t> at the specified index.
virtual auto remove_at(xtd::usize index) -> void=0
Removes the xtd::collections::generic::ilist <type_t> item at the specified index.
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 clear() -> void=0
Removes all items from the xtd::collections::generic::icollection <type_t>.
virtual auto copy_to(xtd::array< type_t > &array, xtd::usize array_index) const -> void=0
Copies the elements of the xtd::collections::generic::icollection <type_t> to an xtd::array,...
static constexpr xtd::usize epos
Represents the index of the last valid element in a collection.
Definition ilist.hpp:84
virtual auto index_of(const type_t &item) const noexcept -> xtd::usize=0
Determines the index of a specific item in the xtd::collections::generic::ilist <type_t>.
virtual auto get_enumerator() const -> xtd::collections::generic::enumerator< type_t >=0
Returns an enumerator that iterates through a collection.
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 add(const type_t &item) -> void=0
Adds an item to the xtd::collections::generic::icollection <type_t>.
static constexpr xtd::usize bpos
Represents the index of the first valid element in a collection.
Definition ilist.hpp:66
virtual auto count() const noexcept -> xtd::usize=0
Gets the number of elements contained in the xtd::collections::generic::icollection <type_t>.
virtual auto is_fixed_size() const noexcept -> bool=0
Gets a value indicating whether the xtd::collections::generic::ilist <type_t> has a fixed size.
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::npos constant.
Supports a simple iteration over a generic collection.
Definition enumerator.hpp:39
Contains xtd::usize type.