37 template<
class type_t>
39 template<
class list_type_t>
40 class empty_list :
public generic::ilist<list_type_t> {
42 using iterator =
typename generic::ilist<list_type_t>::iterator;
43 using const_iterator =
typename generic::ilist<list_type_t>::const_iterator;
45 auto contains(
const list_type_t& item)
const noexcept ->
bool override {
return false;}
50 bool move_next()
override {
return false;}
51 void reset()
override {}
61 auto is_fixed_size()
const noexcept ->
bool override {
return false;}
62 auto is_synchronized()
const noexcept ->
bool override {
return false;}
63 auto add(
const list_type_t& item) ->
void override {}
64 auto clear() ->
void override {}
65 auto insert(
xtd::size index,
const list_type_t& item) ->
void override {}
66 auto remove(
const list_type_t& item) ->
bool override {
return false;}
67 auto remove_at(
xtd::size index) ->
void override {}
77 using base_type =
const xtd::collections::generic::ilist<value_type>& ;
91 using iterator =
typename generic::icollection<type_t>::iterator;
93 using const_iterator =
typename generic::icollection<type_t>::const_iterator;
126 auto count() const noexcept ->
xtd::
size override {
return items_.count();}
132 static auto el = empty_list<value_type> {};
137 const xtd::object& sync_root() const noexcept
override {
return items_.sync_root();}
155 auto contains(
const type_t& item)
const noexcept ->
bool override {
return items_.contains(item);}
206 auto index_of(
const type_t& item)
const noexcept ->
xtd::size override {
return items_.index_of(item);}
251 auto is_fixed_size() const noexcept ->
bool override {
return false;}
252 auto is_read_only() const noexcept ->
bool override {
return true;}
253 auto is_synchronized() const noexcept ->
bool override {
return false;}
255 auto clear() ->
void override {}
257 auto remove(
const value_type& item) ->
bool override {
return false;}
258 auto remove_at(
xtd::size index) ->
void override {}
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
Supports a simple iteration over a generic collection.
Definition ienumerator.hpp:58
value_type & reference
Definition read_only_collection.hpp:83
const xtd::collections::generic::ilist< value_type > & base_type
Definition read_only_collection.hpp:77
auto index_of(const type_t &item) const noexcept -> xtd::size override
Searches for the specified object and returns the zero-based index of the first occurrence within the...
Definition read_only_collection.hpp:206
typename generic::icollection< type_t >::iterator iterator
Represents the iterator of list value type.
Definition read_only_collection.hpp:91
read_only_collection(const generic::ilist< value_type > &list)
Initializes a new instance of the xtd::collections::object_model::read_only_collection <type_t> class...
Definition read_only_collection.hpp:110
generic::enumerator< value_type > get_enumerator() const noexcept override
Returns an enumerator that iterates through the xtd::collections::object_model::read_only_collection ...
Definition read_only_collection.hpp:191
auto copy_to(xtd::array< type_t > &array, xtd::size array_index) const -> void override
Copies the entire xtd::collections::object_model::read_only_collection <type_t> to a compatible one-d...
Definition read_only_collection.hpp:171
const value_type * const_pointer
Definition read_only_collection.hpp:89
xtd::ptrdiff difference_type
Definition read_only_collection.hpp:81
xtd::size size_type
Definition read_only_collection.hpp:79
value_type value_type
Definition read_only_collection.hpp:75
typename generic::icollection< type_t >::const_iterator const_iterator
Represents the const iterator of list value type.
Definition read_only_collection.hpp:93
auto operator[](size_type index) const -> const_reference override
Returns a reference to the element at specified location pos.
Definition read_only_collection.hpp:225
auto contains(const type_t &item) const noexcept -> bool override
Determines whether an element is in the xtd::collections::object_model::read_only_collection <type_t>...
Definition read_only_collection.hpp:155
auto items() noexcept -> base_type
Returns the xtd::collections::generic::ilist <type_t> that the xtd::collections::object_model::read_o...
Definition read_only_collection.hpp:247
auto count() const noexcept -> xtd::size override
Gets the number of elements contained in the xtd::collections::object_model::read_only_collection <ty...
Definition read_only_collection.hpp:126
const value_type & const_reference
Definition read_only_collection.hpp:85
static auto empty_collection() -> const read_only_collection< value_type > &
Gets an empty xtd::collections::object_model::read_only_collection <type_t>.
Definition read_only_collection.hpp:131
value_type * pointer
Definition read_only_collection.hpp:87
static void throws(xtd::helpers::exception_case exception_case, const source_location &location=source_location::current())
Throws an exption with specified exception case.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:44
Contains xtd::collections::generic::ilist <type_t> interface.
@ not_supported
The method or operation is not supported.
Definition exception_case.hpp:77
@ argument_out_of_range
The argument is out of range.
Definition exception_case.hpp:35
constexpr xtd::size npos
Represents a value that is not a valid position in a collection.
Definition npos.hpp:26
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
std::ptrdiff_t ptrdiff
Represent the signed integer type of the result of subtracting two pointers.
Definition ptrdiff.hpp:23
ptr< type_t > new_ptr(args_t &&... args)
The xtd::new_ptr operator creates a xtd::ptr object.
Definition new_ptr.hpp:24
@ add
The Add key.
Definition console_key.hpp:170
@ insert
The INS (INSERT) key.
Definition console_key.hpp:62
Contains classes that can be used as collections in the object model of a reusable library....
Definition read_only_collection.hpp:15
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
Supports a simple iteration over a generic collection.
Definition enumerator.hpp:38
Contains xtd::helpers::throw_helper class.