xtd 0.2.0
Loading...
Searching...
No Matches
array_3.hpp
Go to the documentation of this file.
1
4
5#if !defined(__XTD_ARRAY_INTERNAL__)
6#error "Do not include this file: Internal use only. Include <xtd/array> or <xtd/array.hpp> instead."
7#endif
8
10namespace xtd {
39 template<class type_t, class allocator_t>
40 class array<type_t, 3, allocator_t> : public xtd::basic_array<type_t, allocator_t> {
41 public:
43
46 using value_type = type_t;
72
74
81 array() = default;
84 array(const array& array) : basic_array<type_t, allocator_t>(array) {}
87 array(array&& array) : basic_array<type_t, allocator_t>(std::move(array)) {}
90 array(const base_type& array) : basic_array<type_t, allocator_t>(array) {}
93 array(base_type&& array) : basic_array<type_t, allocator_t>(std::move(array)) {}
102 array(size_type length1, size_type length2, size_type length3) : basic_array<type_t, allocator_t>(array<xtd::size> {length1, length2, length3}) {}
112 array(size_type length1, size_type length2, size_type length3, const value_type& value) : basic_array<type_t, allocator_t>(array<xtd::size> {length1, length2, length3}, value) {}
119 explicit array(const array<xtd::size, 1>& lengths) : xtd::basic_array<type_t, allocator_t>(lengths) {}
126 array(const array<xtd::size, 1>& lengths, const value_type& value) : basic_array<type_t, allocator_t>(lengths, value) {}
133 explicit array(const xtd::collections::generic::ienumerable<type_t>& enumerable) : basic_array<type_t, allocator_t>(enumerable) {}
140 explicit array(const xtd::collections::generic::ilist<type_t>& list) : basic_array<type_t, allocator_t>(list) {}
144 template<class input_iterator_t>
145 array(input_iterator_t first, input_iterator_t last) : basic_array<type_t, allocator_t>(first, last) {}
148 array(std::vector<std::vector<std::vector<type_t>>> items) : basic_array<type_t, allocator_t>(items) {}
151 array(std::initializer_list<std::initializer_list<std::initializer_list<type_t>>> items) : basic_array<type_t, allocator_t>(items) {}
153
155
162 xtd::size rank() const noexcept override {return 3;}
164
166
168 using xtd::basic_array<type_t, allocator_t>::get_value;
175 const value_type& get_value(size_type index1, size_type index2, size_type index3) const {return operator()(index1, index2, index3);}
176
177 using xtd::basic_array<type_t, allocator_t>::set_value;
184 void set_value(const value_type& value, size_type index1, size_type index2, size_type index3) {operator()(index1, index2, index3) = value;}
185
188 xtd::string to_string() const noexcept override;
190
192
197 array& operator=(const array&) = default;
201 array& operator=(array&&) = default;
202
203 using xtd::basic_array<type_t, allocator_t>::operator();
214 value_type& operator()(size_type index1, size_type index2, size_type index3) {return xtd::basic_array<type_t, allocator_t>::operator()({index1, index2, index3});}
215
226 const value_type& operator()(size_type index1, size_type index2, size_type index3) const {return xtd::basic_array<type_t, allocator_t>::operator()({index1, index2, index3});}
228 };
229}
typename xtd::basic_array< type_t, allocator_t >::reference reference
Represents the reference of array value type.
Definition array_3.hpp:56
typename xtd::basic_array< type_t, allocator_t >::const_reference const_reference
Represents the const reference of array value type.
Definition array_3.hpp:58
typename xtd::basic_array< type_t, allocator_t >::const_reverse_iterator const_reverse_iterator
Represents the const reverse iterator of array value type.
Definition array_3.hpp:70
typename xtd::basic_array< type_t, allocator_t >::iterator iterator
Represents the iterator of array value type.
Definition array_3.hpp:64
array(const xtd::collections::generic::ienumerable< type_t > &enumerable)
Initializes a new instance of the array and copy array array specified.
Definition array_3.hpp:133
typename xtd::basic_array< type_t, allocator_t >::const_pointer const_pointer
Represents the const pointer of array value type.
Definition array_3.hpp:62
array()=default
Initializes a new instance of the Array class that is empty.
array(const base_type &array)
Copy constructor with specified base type array.
Definition array_3.hpp:90
typename xtd::basic_array< type_t, allocator_t >::difference_type difference_type
Represents the array difference type (usually xtd::ptrdiff).
Definition array_3.hpp:54
array(std::initializer_list< std::initializer_list< std::initializer_list< type_t > > > items)
Constructs the container with the contents of the specified initializer list.
Definition array_3.hpp:151
array(const array &array)
Copy constructor with specified array.
Definition array_3.hpp:84
xtd::size rank() const noexcept override
Gets the rank (number of dimensions) of the array.
Definition array_3.hpp:162
const value_type & operator()(size_type index1, size_type index2, size_type index3) const
Gets the value at the specified position in the one-dimensional Array. The index is specified as a 32...
Definition array_3.hpp:226
typename xtd::basic_array< type_t, allocator_t >::const_iterator const_iterator
Represents the const iterator of array value type.
Definition array_3.hpp:66
const value_type & get_value(size_type index1, size_type index2, size_type index3) const
Gets the value at the specified position in the one-dimensional Array. The index is specified as a 32...
Definition array_3.hpp:175
typename xtd::basic_array< type_t, allocator_t >::allocator_type allocator_type
Represents the array allocator type.
Definition array_3.hpp:48
array(size_type length1, size_type length2, size_type length3, const value_type &value)
Initializes a new instance of the array class with lengths for each rank specified and default value.
Definition array_3.hpp:112
array(base_type &&array)
Move constructor with specified base type array.
Definition array_3.hpp:93
array(std::vector< std::vector< std::vector< type_t > > > items)
Constructs the container with the contents of the specified initializer list.
Definition array_3.hpp:148
array(const array< xtd::size, 1 > &lengths)
Initializes a new instance of the array class with lengths for each rank specified.
Definition array_3.hpp:119
typename xtd::basic_array< type_t, allocator_t >::reverse_iterator reverse_iterator
Represents the reverse iterator of array value type.
Definition array_3.hpp:68
typename xtd::basic_array< type_t, allocator_t >::base_type base_type
Represents the array base type.
Definition array_3.hpp:50
xtd::string to_string() const noexcept override
Returns a xtd::string that represents the current object.
array(size_type length1, size_type length2, size_type length3)
Initializes a new instance of the array class with lengths for each rank specified.
Definition array_3.hpp:102
type_t value_type
Represents the array value type.
Definition array_3.hpp:46
array(const xtd::collections::generic::ilist< type_t > &list)
Initializes a new instance of the array and copy array array specified.
Definition array_3.hpp:140
void set_value(const value_type &value, size_type index1, size_type index2, size_type index3)
Sets a value to the element at the specified position in the one-dimensional Array....
Definition array_3.hpp:184
array(input_iterator_t first, input_iterator_t last)
Constructs the container with the contents of the range [first, last).
Definition array_3.hpp:145
typename xtd::basic_array< type_t, allocator_t >::size_type size_type
Represents the array size type (usually xtd::size).
Definition array_3.hpp:52
array(array &&array)
Move constructor with specified array.
Definition array_3.hpp:87
array(const array< xtd::size, 1 > &lengths, const value_type &value)
Initializes a new instance of the array class with lengths for each rank specified.
Definition array_3.hpp:126
typename xtd::basic_array< type_t, allocator_t >::pointer pointer
Represents the pointer of array value type.
Definition array_3.hpp:60
Base object that represent array.
Definition basic_array.hpp:27
const value_type & const_reference
Represents the const reference of array value type.
Definition basic_array.hpp:45
xtd::collections::generic::helpers::allocator< value_type > allocator_type
Represents the array allocator type.
Definition basic_array.hpp:35
void set_value(const type_t &value, const xtd::array< size_type > &indexes)
Definition basic_array.hpp:342
const value_type & get_value(const xtd::array< size_type > &indexes) const
typename xtd::collections::generic::ienumerable< type_t >::const_iterator const_iterator
Represents the const iterator of array value type.
Definition basic_array.hpp:53
xtd::ptrdiff difference_type
Represents the array difference type (usually xtd::ptrdiff).
Definition basic_array.hpp:41
const value_type * const_pointer
Represents the const pointer of array value type.
Definition basic_array.hpp:49
typename xtd::collections::generic::helpers::raw_array< value_type >::reverse_iterator reverse_iterator
Represents the reverse iterator of array value type.
Definition basic_array.hpp:55
value_type * pointer
Represents the pointer of array value type.
Definition basic_array.hpp:47
value_type & reference
Represents the reference of array value type.
Definition basic_array.hpp:43
typename xtd::collections::generic::helpers::raw_array< value_type, allocator_type >::base_type base_type
Represents the array base type.
Definition basic_array.hpp:37
virtual const base_type & items() const noexcept
Definition basic_array.hpp:113
typename xtd::collections::generic::helpers::raw_array< value_type >::const_reverse_iterator const_reverse_iterator
Represents the const reverse iterator of array value type.
Definition basic_array.hpp:57
typename xtd::collections::generic::ienumerable< type_t >::iterator iterator
Represents the iterator of array value type.
Definition basic_array.hpp:51
type_t & operator()(const xtd::array< size_type > &indexes)
xtd::size size_type
Represents the array size type (usually xtd::size).
Definition basic_array.hpp:39
Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
Definition ienumerable.hpp:40
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
read_only_span< type_t, count > first() const
Obtains a subspan consisting of the first count elements of the sequence.
Definition read_only_span.hpp:282
read_only_span< type_t, count > last() const
Obtains a subspan consisting of the last N elements of the sequence.
Definition read_only_span.hpp:307