xtd 1.0.0
Loading...
Searching...
No Matches
iproducer_consumer_collection.hpp
Go to the documentation of this file.
1
4#pragma once
6
8namespace xtd {
10 namespace collections {
13 namespace concurrent {
29 template<typename type_t>
30 class iproducer_consumer_collection : public xtd::collections::generic::icollection<type_t> {
31 public:
33
37 [[nodiscard]] virtual auto count() const noexcept -> xtd::usize = 0;
38
53 [[nodiscard]] virtual auto is_synchronized() const noexcept -> bool = 0;
54
76 [[nodiscard]] virtual auto sync_root() const noexcept -> const object& = 0;
78
80
82
87 virtual auto copy_to(xtd::array<type_t>& array, xtd::usize array_index) const -> void = 0;
88
91 [[nodiscard]] virtual auto get_enumerator() const -> xtd::collections::generic::enumerator<type_t> = 0;
92
96 [[nodiscard]] virtual auto to_array() const -> xtd::array<type_t> = 0;
97
102 virtual auto try_add(const type_t& item) -> bool = 0;
103
107 virtual auto try_take(type_t& item) -> bool = 0;
109 };
110 }
111 }
112}
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
Defines methods to manipulate thread-safe collections intended for producer/consumer usage....
Definition iproducer_consumer_collection.hpp:30
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,...
virtual auto sync_root() const noexcept -> const object &=0
Gets an object that can be used to synchronize access to the the xtd::collections::generic::icollecti...
virtual auto try_take(type_t &item) -> bool=0
Attempts to remove and return an object from the xtd::collections::concurrent::iproducer_consumer_col...
virtual auto get_enumerator() const -> xtd::collections::generic::enumerator< type_t >=0
Returns an enumerator that iterates through a collection.
virtual auto try_add(const type_t &item) -> bool=0
Attempts to add an object to the xtd::collections::concurrent::iproducer_consumer_collection <type_t>...
virtual auto is_synchronized() const noexcept -> bool=0
Gets a value indicating whether access to the xtd::collections::generic::icollection is synchronized ...
virtual auto count() const noexcept -> xtd::usize=0
Gets the number of elements contained in the xtd::collections::generic::icollection.
virtual auto to_array() const -> xtd::array< type_t >=0
Copies the elements contained in the xtd::collections::concurrent::iproducer_consumer_collection <typ...
Contains xtd::collections::generic::icollection <type_t> interface.
generic::enumerator< xtd::any_object > enumerator
Supports a simple iteration over a non-generic collection.
Definition enumerator.hpp:28
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
Provides several thread-safe collection classes that should be used in place of the corresponding typ...
Definition concurrent_bag.hpp:20
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