Base object that represent array.
Public Aliases | |
| using | value_type |
| Represents the array value type. | |
| using | allocator_type |
| Represents the array allocator type. | |
| using | base_type |
| Represents the array base type. | |
| using | size_type |
| Represents the array size type (usually xtd::size). | |
| using | difference_type |
| Represents the array difference type (usually xtd::ptrdiff). | |
| using | reference |
| Represents the reference of array value type. | |
| using | const_reference |
| Represents the const reference of array value type. | |
| using | pointer |
| Represents the pointer of array value type. | |
| using | const_pointer |
| Represents the const pointer of array value type. | |
| using | iterator |
| Represents the iterator of array value type. | |
| using | const_iterator |
| Represents the const iterator of array value type. | |
| using | reverse_iterator |
| Represents the reverse iterator of array value type. | |
| using | const_reverse_iterator |
| Represents the const reverse iterator of array value type. | |
Public Properties | |
| size_type | count () const noexcept override |
| Gets the number of elements contained in the xtd::array <type_t>. | |
| virtual pointer | data () noexcept |
| Returns pointer to the underlying array serving as element storage. | |
| virtual const_pointer | data () const noexcept |
| Returns pointer to the underlying array serving as element storage. | |
| bool | is_fixed_size () const noexcept override |
| Gets a value indicating whether the xtd::collections::generic::ilist <type_t> has a fixed size. | |
| bool | is_read_only () const noexcept override |
| Gets a value indicating whether the xtd::collections::generic::icollection <type_t> is read-only. | |
| bool | is_synchronized () const noexcept override |
| Gets a value indicating whether access to the xtd::collections::generic::icollection <type_t> is synchronized (thread safe). | |
| virtual const base_type & | items () const noexcept |
| Returns the underlying base type items. | |
| virtual base_type & | items () noexcept |
| Returns the underlying base type items. | |
| virtual size_type | length () const noexcept |
| Gets a size that represents the total number of elements in all the dimensions of the array. | |
| virtual xtd::int64 | long_length () |
| Gets a 64-bit integer that represents the total number of elements in all the dimensions of the array. | |
| virtual size_type | max_length () const noexcept |
| Returns the maximum number of elements the container is able to hold due to system or library implementation limitations, i.e. std::distance(xtd::array::begin(), xtd::array::end()) for the largest container. | |
| virtual size_type | rank () const noexcept |
| Gets the rank (number of dimensions) of the array. | |
| const xtd::object & | sync_root () const noexcept override |
| Gets an object that can be used to synchronize access to the the xtd::collections::generic::icollection <type_t>. | |
Public Methods | |
| bool | contains (const type_t &value) const noexcept override |
| Determines whether an element is in the array. | |
| void | copy_to (xtd::array< type_t > &array) const |
| void | copy_to (xtd::array< type_t > &array, size_type array_index) const override |
| Copies the elements of the xtd::array <type_t> to an xtd::array, starting at a particular xtd::array index. | |
| void | copy_to (const xtd::array< size_type > &indexes, xtd::array< type_t > &array, size_type array_index) const |
| void | copy_to (const xtd::array< size_type > &indexes, xtd::array< type_t > &array, size_type array_index, size_type count) const |
| void | copy_to (const size_type index, xtd::array< type_t > &array, size_type array_index) const |
| void | copy_to (const size_type index, xtd::array< type_t > &array, size_type array_index, size_type count) const |
| bool | equals (const object &obj) const noexcept override |
| Determines whether the specified object is equal to the current object. | |
| bool | equals (const basic_array &rhs) const noexcept override |
| virtual void | fill (const value_type &value) noexcept |
| Assigns the value to all elements in the container. | |
| xtd::collections::generic::enumerator< value_type > | get_enumerator () const noexcept override |
| constexpr size_type | get_length (size_type dimension) const |
| Gets the total number of elements in all the dimensions of the array. | |
| xtd::array< size_type, 1 > | get_lengths () const |
| Gets an array of the number of elements of all the dimensions of the array. | |
| constexpr xtd::int64 | get_long_length (size_type dimension) const |
| Gets a 64-bit integer that represents the total number of elements in all the dimensions of the array. | |
| constexpr size_type | get_lower_bound (size_type dimension) const |
| Gets the lower bound of the specified dimension in the array. | |
| constexpr size_type | get_upper_bound (size_type dimension) const |
| Gets the upper bound of the specified dimension in the array. | |
| const value_type & | get_value (const xtd::array< size_type > &indexes) const |
| Gets the value at the specified position in the multidimensional array. The indexes are specified as 32-bit integers array. | |
| size_type | index_of (const type_t &value) const noexcept override |
| Determines the index of a specific item in the xtd::array <type_t>. | |
| size_type | index_of (const type_t &value, size_type index) const |
| size_type | index_of (const type_t &value, size_type index, size_type count) const |
| void | resize (size_type new_size, value_type value) |
Resizes the container to contain count elements, does nothing if count == length(). / @param new_size The new size of the container. / @exception xtd::argument_out_of_range_exception xtd::collections::generic::list::capacity is set to a value that is less than xtd::collections::generic::list::count. / @remarks If the current size is greater thancount, the container is reduced to its firstcountelements. / @remarks If the current size is less thancount`, additional default-inserted elements are appended. void resize(size_type new_size) {resize(new_size, value_type {});}. | |
| void | set_value (const type_t &value, const xtd::array< size_type > &indexes) |
| Sets a value to the element at the specified position in the multidimensional array. | |
| basic_array< type_t > & | sort () |
| Sorts the elements in the entire xtd::collections::generic::list <type_t> using the default comparer. | |
| template<class comparison_t> | |
| basic_array< type_t > & | sort (comparison_t &&comparison) |
| Sorts the elements in the entire xtd::collections::generic::list <type_t> using the specified xtd::comparison <type_t>. | |
| basic_array< type_t > & | sort (const xtd::collections::generic::icomparer< type_t > &comparer) |
| Sorts the elements in the entire xtd::collections::generic::list <type_t> using the specified comparer. | |
| basic_array< type_t > & | sort (xtd::size index, xtd::size count, const xtd::collections::generic::icomparer< type_t > &comparer) |
| Sorts the elements in a range of elements in xtd::collections::generic::list <type_t> using the specified comparer. | |
| xtd::string | to_string () const noexcept override |
| Returns a xtd::string that represents the current object. | |
Public Operators | |
| basic_array & | operator= (const basic_array &other) |
| Copy assignment operator. Replaces the contents with a copy of the contents of other. | |
| basic_array & | operator= (basic_array &&other) noexcept=default |
| Move assignment operator. Replaces the contents with those of other using move semantics (i.e. the data in other is moved from other into this container). other is in a valid but unspecified state afterwards. | |
| basic_array & | operator= (std::initializer_list< type_t > &items) |
| Replaces the contents with those identified by initializer list ilist. | |
| const_reference | operator[] (size_type index) const override |
| Returns a reference to the element at specified location index. | |
| reference | operator[] (size_type index) override |
| Returns a reference to the element at specified location index. | |
| operator const base_type & () const noexcept | |
| Returns a reference to the underlying base type. | |
| operator base_type & () noexcept | |
| Returns a reference to the underlying base type. | |
| type_t & | operator() (const xtd::array< size_type > &indexes) |
| Gets the value at the specified position in the multidimensional array. The indexes are specified as a 32-bit integer array. | |
| const type_t & | operator() (const xtd::array< size_type > &indexes) const |
| Gets the value at the specified position in the multidimensional array. The indexes are specified as a 32-bit integer array. | |
Additional Inherited Members | |
| object ()=default | |
| Create a new instance of the ultimate base class object. | |
| virtual xtd::size | get_hash_code () const noexcept |
| Serves as a hash function for a particular type. | |
| virtual type_object | get_type () const noexcept |
| Gets the type of the current instance. | |
| template<class object_t> | |
| xtd::unique_ptr_object< object_t > | memberwise_clone () const |
| Creates a shallow copy of the current object. | |
| virtual bool | equals (const type_t &) const noexcept=0 |
| Indicates whether the current object is equal to another object of the same type. | |
| template<class object_a_t, class object_b_t> | |
| static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are considered equal. | |
| template<class object_a_t, class object_b_t> | |
| static bool | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are the same instance. | |
| abstract_object ()=default | |
| Initializes a new instance of the xtd::abstract_object class. | |
| using xtd::basic_array< type_t, allocator_t >::value_type |
Represents the array value type.
| using xtd::basic_array< type_t, allocator_t >::allocator_type |
Represents the array allocator type.
| using xtd::basic_array< type_t, allocator_t >::base_type |
Represents the array base type.
| using xtd::basic_array< type_t, allocator_t >::size_type |
Represents the array size type (usually xtd::size).
| using xtd::basic_array< type_t, allocator_t >::difference_type |
Represents the array difference type (usually xtd::ptrdiff).
| using xtd::basic_array< type_t, allocator_t >::reference |
Represents the reference of array value type.
| using xtd::basic_array< type_t, allocator_t >::const_reference |
Represents the const reference of array value type.
| using xtd::basic_array< type_t, allocator_t >::pointer |
Represents the pointer of array value type.
| using xtd::basic_array< type_t, allocator_t >::const_pointer |
Represents the const pointer of array value type.
| using xtd::basic_array< type_t, allocator_t >::iterator |
Represents the iterator of array value type.
| using xtd::basic_array< type_t, allocator_t >::const_iterator |
Represents the const iterator of array value type.
| using xtd::basic_array< type_t, allocator_t >::reverse_iterator |
Represents the reverse iterator of array value type.
| using xtd::basic_array< type_t, allocator_t >::const_reverse_iterator |
Represents the const reverse iterator of array value type.
|
inlineoverridenoexcept |
Gets the number of elements contained in the xtd::array <type_t>.
|
inlinevirtualnoexcept |
Returns pointer to the underlying array serving as element storage.
|
inlinevirtualnoexcept |
Returns pointer to the underlying array serving as element storage.
|
inlineoverridenoexcept |
Gets a value indicating whether the xtd::collections::generic::ilist <type_t> has a fixed size.
true if the xtd::collections::generic::ilist <type_t> has a fixed size; otherwise, false.
|
inlineoverridenoexcept |
Gets a value indicating whether the xtd::collections::generic::icollection <type_t> is read-only.
true if the xtd::collections::generic::icollection <type_t> is read-only; otherwise, false. true, even though individual array elements can be modified.
|
inlineoverridenoexcept |
Gets a value indicating whether access to the xtd::collections::generic::icollection <type_t> is synchronized (thread safe).
true if access to the xtd::collections::generic::icollection <type_t> is synchronized (thread safe); otherwise, false. synchronized method, which provides a synchronized wrapper around the underlying collection.
|
inlinevirtualnoexcept |
Returns the underlying base type items.
|
inlinevirtualnoexcept |
Returns the underlying base type items.
|
inlinevirtualnoexcept |
Gets a size that represents the total number of elements in all the dimensions of the array.
|
inlinevirtual |
Gets a 64-bit integer that represents the total number of elements in all the dimensions of the array.
|
inlinevirtualnoexcept |
Returns the maximum number of elements the container is able to hold due to system or library implementation limitations, i.e. std::distance(xtd::array::begin(), xtd::array::end()) for the largest container.
|
inlinevirtualnoexcept |
Gets the rank (number of dimensions) of the array.
Reimplemented in xtd::array< type_t, rank_, allocator_t >, xtd::array< byte >, xtd::array< item >, xtd::array< item >, xtd::array< item_t >, xtd::array< type_t, 1, allocator_t >, xtd::array< type_t, 1, allocator_t >, xtd::array< type_t, 2, allocator_t >, xtd::array< type_t, 2, allocator_t >, xtd::array< type_t, 3, allocator_t >, xtd::array< type_t, 3, allocator_t >, xtd::array< value_type >, xtd::array< xtd::array< bool > >, xtd::array< xtd::array< bool > >, xtd::array< xtd::array< xtd::byte > >, xtd::array< xtd::basic_string< char > >, xtd::array< xtd::byte >, xtd::array< xtd::diagnostics::stack_frame >, xtd::array< xtd::diagnostics::stack_frame >, xtd::array< xtd::drawing::color >, xtd::array< xtd::drawing::color >, xtd::array< xtd::drawing::imaging::encoder_parameter >, xtd::array< xtd::drawing::point >, xtd::array< xtd::drawing::point >, xtd::array< xtd::forms::shadow >, xtd::array< xtd::forms::shadow >, xtd::array< xtd::net::ip_address >, xtd::array< xtd::size >, xtd::array< xtd::size >, xtd::array< xtd::string >, xtd::array< xtd::string >, xtd::array< xtd::uint16 >, and xtd::array<>.
|
inlineoverridenoexcept |
Gets an object that can be used to synchronize access to the the xtd::collections::generic::icollection <type_t>.
sync_root property. synchronized method, which provides a synchronized wrapper around the underlying collection. However, derived classes can provide their own synchronized version of the collection using the xtd::collections::generic::icollection::sync_root property. The synchronizing code must perform operations on the xtd::collections::generic::icollection::sync_root property of the collection, not directly on the collection. This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the collection instance. synchronized method on a collection, the expected usage for the xtd::collections::generic::icollection::sync_root looks as follows:
|
inlineoverridenoexcept |
Determines whether an element is in the array.
| value | The object to be added to the end of the array. |
|
inlineoverride |
Copies the elements of the xtd::array <type_t> to an xtd::array, starting at a particular xtd::array index.
| array | The one-dimensional xtd::array that is the destination of the elements copied from xtd::collections::generic::icollection <type_t>. The xtd::array must have zero-based indexing. |
| array_index | The zero-based index in array at which copying begins. |
| xtd::argument_exception | The number of elements in the source xtd::collections::generic::icollection <type_t> is greater than the available space from `array_index` to the end of the destination `array`. |
|
inlineoverridevirtualnoexcept |
Determines whether the specified object is equal to the current object.
| obj | The object to compare with the current object. |
true if the specified object is equal to the current object. otherwise, false. Reimplemented from xtd::object.
|
inlinevirtualnoexcept |
Assigns the value to all elements in the container.
| value | The value to assign to the elements. |
|
inlineconstexpr |
Gets the total number of elements in all the dimensions of the array.
| dimension | A zero-based dimension of the array whose length needs to be determined. |
| xtd::argument_out_of_range_exception | `dimension` is equal to or greater than xtd::basic_array::rank. |
| xtd::array< size_type, 1 > xtd::basic_array< type_t, allocator_t >::get_lengths | ( | ) | const |
Gets an array of the number of elements of all the dimensions of the array.
|
inlineconstexpr |
Gets a 64-bit integer that represents the total number of elements in all the dimensions of the array.
| dimension | A zero-based dimension of the array whose length needs to be determined. |
| xtd::argument_out_of_range_exception | `dimension` is equal to or greater than xtd::basic_array::rank. |
|
inlineconstexpr |
Gets the lower bound of the specified dimension in the array.
| dimension | A zero-based dimension of the array whose lower bound needs to be determined. |
| xtd::argument_out_of_range_exception | `dimension` is equal to or greater than xtd::basic_array::rank. |
|
inlineconstexpr |
Gets the upper bound of the specified dimension in the array.
| dimension | A zero-based dimension of the array whose upper bound needs to be determined. |
| xtd::argument_out_of_range_exception | `dimension` is equal to or greater than xtd::basic_array::rank. |
| const value_type & xtd::basic_array< type_t, allocator_t >::get_value | ( | const xtd::array< size_type > & | indexes | ) | const |
Gets the value at the specified position in the multidimensional array. The indexes are specified as 32-bit integers array.
| indexes | An array that represents the position of the element to get. |
| xtd::index_out_of_range_exception | If `indexes` is outside the range of valid indexes for the corresponding dimension of the current array. |
|
inlineoverridenoexcept |
Determines the index of a specific item in the xtd::array <type_t>.
| value | The object to locate in the xtd::array. |
|
inline |
Resizes the container to contain count elements, does nothing if count == length(). / @param new_size The new size of the container. / @exception xtd::argument_out_of_range_exception xtd::collections::generic::list::capacity is set to a value that is less than xtd::collections::generic::list::count. / @remarks If the current size is greater thancount, the container is reduced to its firstcountelements. / @remarks If the current size is less thancount`, additional default-inserted elements are appended. void resize(size_type new_size) {resize(new_size, value_type {});}.
/ Resizes the container to contain count elements, does nothing if count == length(). @param new_size The new size of the container. @param value The value to initialize the new elements with. @exception xtd::argument_out_of_range_exception xtd::collections::generic::list::capacity is set to a value that is less than xtd::collections::generic::list::count. @remarks If the current size is greater thancount, the container is reduced to its firstcountelements. @remarks If the current size is less thancount`, additional default-inserted elements are appended.
|
inline |
Sets a value to the element at the specified position in the multidimensional array.
| value | The new value for the specified element. |
| indexes | An array that represents the position of the element to set. |
| xtd::index_out_of_range_exception | Either `indexes` is outside the range of valid indexes for the current array. |
|
inline |
Sorts the elements in the entire xtd::collections::generic::list <type_t> using the default comparer.
| xtd::invalid_operation_exception | The default comparer xtd::collections::generic::comparer::default_comparer cannot find an implementation of the xtd::icomparable <type_t> generic interface. |
type_t to determine the order of list elements. The xtd::collections::generic::comparer::default_comparer property checks whether type type_t implements the xtd::icomparable <type_t> generic interface and uses that implementation, if available. If not, xtd::collections::generic::comparer::default_comparer checks whether type T implements the xtd::icomparable interface. If type type_t does not implement either interface, xtd::collections::generic::comparer::default_comparer throws an xtd::invalid_operation_exception.
|
inline |
Sorts the elements in the entire xtd::collections::generic::list <type_t> using the specified xtd::comparison <type_t>.
| xtd::argument_exception | The implementation of comparison caused an error during the sort. For example, comparison might not return 0 when comparing an item with itself. |
|
inline |
Sorts the elements in the entire xtd::collections::generic::list <type_t> using the specified comparer.
| comparer | The xtd::collections::generic::icomparer <type_t> implementation to use when comparing elements, or null to use the default comparer xtd::collections::generic::comparer::default_comparer. |
| xtd::argument_exception | The implementation of comparison caused an error during the sort. For example, comparison might not return 0 when comparing an item with itself. |
|
inline |
Sorts the elements in a range of elements in xtd::collections::generic::list <type_t> using the specified comparer.
| index | The zero-based starting index of the range to sort. |
| count | The length of the range to sort. |
| comparer | The xtd::collections::generic::icomparer <type_t> implementation to use when comparing elements, or null to use the default comparer xtd::collections::generic::comparer::default_comparer. |
| xtd::argument_exception | The implementation of comparison caused an error during the sort. For example, comparison might not return 0 when comparing an item with itself. |
|
overridevirtualnoexcept |
Returns a xtd::string that represents the current object.
Reimplemented from xtd::object.
|
inline |
Copy assignment operator. Replaces the contents with a copy of the contents of other.
| other | Another container to use as data source. |
|
defaultnoexcept |
Move assignment operator. Replaces the contents with those of other using move semantics (i.e. the data in other is moved from other into this container). other is in a valid but unspecified state afterwards.
| other | Another base type container to use as data source. |
|
inline |
Replaces the contents with those identified by initializer list ilist.
| items | Initializer list to use as data source |
|
inlineoverride |
Returns a reference to the element at specified location index.
| index | The position of the element to return. |
| xtd::index_out_of_range_exception | If pos is not within the range of the container. |
|
inlineoverride |
Returns a reference to the element at specified location index.
| index | The position of the element to return. |
| xtd::index_out_of_range_exception | If `index` is not within the range of the container. |
|
inlinenoexcept |
Returns a reference to the underlying base type.
|
inlinenoexcept |
Returns a reference to the underlying base type.
| type_t & xtd::basic_array< type_t, allocator_t >::operator() | ( | const xtd::array< size_type > & | indexes | ) |
Gets the value at the specified position in the multidimensional array. The indexes are specified as a 32-bit integer array.
| indexes | An array that represents the multidimension index of the array element to get. |
| xtd::index_out_of_range_exception | Either each index is outside the range of valid indexes for the corresponding dimension of the current array. |
| const type_t & xtd::basic_array< type_t, allocator_t >::operator() | ( | const xtd::array< size_type > & | indexes | ) | const |
Gets the value at the specified position in the multidimensional array. The indexes are specified as a 32-bit integer array.
| indexes | An array that represents the multidimension index of the array element to get. |
| xtd::index_out_of_range_exception | Either each index is outside the range of valid indexes for the corresponding dimension of the current array. |