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"
6#define __XTD_CORE_INTERNAL__
7#include "../../internal/__array_definition.hpp"
8#undef __XTD_CORE_INTERNAL__
9#include "../../object.hpp"
10#include "../../size.hpp"
11
13namespace xtd {
15 namespace collections {
17 namespace generic {
43 template<typename type_t>
44 class icollection : public ienumerable<type_t> {
45 public:
47
54
56
60 virtual xtd::size count() const noexcept = 0;
61
65 virtual bool is_read_only() const noexcept = 0;
66
81 virtual bool is_synchronized() const noexcept = 0;
82
104 virtual const xtd::object& sync_root() const noexcept = 0;
106
108
113 virtual void add(const type_t& item) = 0;
114
118 virtual void clear() = 0;
119
124 virtual bool contains(const type_t& item) const noexcept = 0;
125
130 virtual void copy_to(xtd::array<type_t>& array, xtd::size array_index) const = 0;
131
138 virtual bool remove(const type_t& item) = 0;
140 };
141 }
142 }
143}
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:58
Defines methods to manipulate generic collections.
Definition icollection.hpp:44
virtual bool is_synchronized() const noexcept=0
Gets a value indicating whether access to the xtd::collections::generic::icollection <type_t> is sync...
virtual const xtd::object & sync_root() const noexcept=0
Gets an object that can be used to synchronize access to the the xtd::collections::generic::icollecti...
virtual void copy_to(xtd::array< type_t > &array, xtd::size array_index) const =0
Copies the elements of the xtd::collections::generic::icollection <type_t> to an xtd::array,...
virtual bool contains(const type_t &item) const noexcept=0
Determines whether the xtd::collections::generic::icollection <type_t> contains a specific value.
virtual bool is_read_only() const noexcept=0
Gets a value indicating whether the xtd::collections::generic::icollection <type_t> is read-only.
virtual bool remove(const type_t &item)=0
Removes the first occurrence of a specific object from the xtd::collections::generic::icollection <ty...
virtual xtd::size count() const noexcept=0
Gets the number of elements contained in the xtd::collections::generic::icollection <type_t>.
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
virtual void clear()=0
Removes all items from the xtd::collections::generic::icollection <type_t>.
Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
Definition ienumerable.hpp:35
typename enumerable_iterators< type_t, ienumerable< type_t > >::const_iterator const_iterator
Represents the const iterator of xtd::collections::generic::ienumerable value type.
Definition ienumerable.hpp:43
typename enumerable_iterators< type_t, ienumerable< type_t > >::iterator iterator
Represents the iterator of xtd::collections::generic::ienumerable value type.
Definition ienumerable.hpp:41
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
@ add
The Add key.
Contains xtd::collections::ienumerable alias.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10