xtd 0.2.0
xtd::fixed_array< type_t, len > Class Template Reference
Inheritance diagram for xtd::fixed_array< type_t, len >:
xtd::object

Definition

template<class type_t, xtd::size len>
class xtd::fixed_array< type_t, len >

Represents a fixed array class.

Header
#include <xtd/fixed_array>
Namespace
xtd
Library
xtd.core

Public Aliases

using value_type = type_t
 Represents the array value type.
 
using base_type = value_type *
 Represents the array base type.
 
using const_base_type = const value_type *
 Represents the const array base type.
 
using reference = value_type &
 Represents the reference of array value type.
 
using const_reference = const value_type &
 Represents the const reference of array value type.
 
using iterator = value_type *
 Represents the iterator of array value type.
 
using const_iterator = const value_type *
 Represents the const iterator of array value type.
 
using pointer = value_type *
 Represents the pointer of array value type.
 
using const_pointer = const value_type *
 Represents the const pointer of array value type.
 
using size_type = xtd::size
 Represents the array size type (usually xtd::size).
 
using difference_type = xtd::ptrdiff
 Represents the array difference type (usually xtd::ptrdiff).
 
using reverse_iterator = std::reverse_iterator< iterator >
 Represents the reverse iterator of array value type.
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 Represents the const reverse iterator of array value type.
 

Public Constructors

 fixed_array (fixed_array &&)=default
 
fixed_arrayoperator= (fixed_array &&)=default
 
 fixed_array (const fixed_array &)=default
 
fixed_arrayoperator= (const fixed_array &)=default
 
 fixed_array (std::initializer_list< type_t > il)
 
virtual const_reference at (size_type index) const
 Returns a reference to the element at specified location pos, with bounds checking.
 
virtual reference at (size_type index)
 Returns a reference to the element at specified location pos, with bounds checking.
 
void clear () noexcept
 Clears the contents of this xtd::span <type> object.
 
void fill (const type_t &value)
 Fills the elements of this span with a specified value.
 
virtual xtd::array< value_typeto_array () const noexcept
 Copies the elements of the xtd::collections::generic::list <type_t> to a new array.
 
xtd::string to_string () const noexcept override
 Returns a xtd::string that represents the current object.
 

Public Properties

virtual reference back ()
 Returns a reference to the last element in the container.
 
virtual const_reference back () const
 Returns a reference to the last element in the container.
 
const_iterator begin () const noexcept
 Returns an iterator to the first element of the enumarable.
 
iterator begin () noexcept
 Returns an iterator to the first element of the enumarable.
 
const_iterator cbegin () const noexcept
 Returns an iterator to the first element of the enumarable.
 
const_iterator cend () const noexcept
 Returns an iterator to the element following the last element of the enumarable.
 
size_type count () const noexcept
 Gets the number of elements contained in the xtd::collections::generic::list <type_t>.
 
const_pointer data () const noexcept
 Returns pointer to the underlying array serving as element storage.
 
pointer data () noexcept
 Returns pointer to the underlying array serving as element storage.
 
virtual bool empty () const noexcept
 Checks if the container has no elements, i.e. whether xtd::array::begin() == xtd::array::end().
 
const_iterator end () const noexcept
 Returns an iterator to the element following the last element of the enumarable.
 
iterator end () noexcept
 Returns an iterator to the element following the last element of the enumarable.
 
virtual reference front ()
 Returns a reference to the first element in the container.
 
virtual const_reference front () const
 Returns a reference to the first element in the container.
 
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.
 
xtd::size size () const noexcept
 Returns the number of elements in the container, i.e. std::distance(xtd::array::begin(), xtd::array::end()).
 

Public Operators

const_reference operator[] (xtd::size index) const
 Returns a reference to the element at specified location index.
 
reference operator[] (xtd::size index)
 Returns a reference to the element at specified location index.
 

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object.
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current 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::uptr< object_t > memberwise_clone () const
 Creates a shallow copy of the current object.
 
- Static Public Member Functions inherited from xtd::object
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.
 

Member Typedef Documentation

◆ value_type

template<class type_t , xtd::size len>
using xtd::fixed_array< type_t, len >::value_type = type_t

Represents the array value type.

◆ base_type

template<class type_t , xtd::size len>
using xtd::fixed_array< type_t, len >::base_type = value_type*

Represents the array base type.

◆ const_base_type

template<class type_t , xtd::size len>
using xtd::fixed_array< type_t, len >::const_base_type = const value_type*

Represents the const array base type.

◆ reference

template<class type_t , xtd::size len>
using xtd::fixed_array< type_t, len >::reference = value_type&

Represents the reference of array value type.

◆ const_reference

template<class type_t , xtd::size len>
using xtd::fixed_array< type_t, len >::const_reference = const value_type&

Represents the const reference of array value type.

◆ iterator

template<class type_t , xtd::size len>
using xtd::fixed_array< type_t, len >::iterator = value_type*

Represents the iterator of array value type.

◆ const_iterator

template<class type_t , xtd::size len>
using xtd::fixed_array< type_t, len >::const_iterator = const value_type*

Represents the const iterator of array value type.

◆ pointer

template<class type_t , xtd::size len>
using xtd::fixed_array< type_t, len >::pointer = value_type*

Represents the pointer of array value type.

◆ const_pointer

template<class type_t , xtd::size len>
using xtd::fixed_array< type_t, len >::const_pointer = const value_type*

Represents the const pointer of array value type.

◆ size_type

template<class type_t , xtd::size len>
using xtd::fixed_array< type_t, len >::size_type = xtd::size

Represents the array size type (usually xtd::size).

◆ difference_type

template<class type_t , xtd::size len>
using xtd::fixed_array< type_t, len >::difference_type = xtd::ptrdiff

Represents the array difference type (usually xtd::ptrdiff).

◆ reverse_iterator

template<class type_t , xtd::size len>
using xtd::fixed_array< type_t, len >::reverse_iterator = std::reverse_iterator<iterator>

Represents the reverse iterator of array value type.

◆ const_reverse_iterator

template<class type_t , xtd::size len>
using xtd::fixed_array< type_t, len >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Represents the const reverse iterator of array value type.

Member Function Documentation

◆ back() [1/2]

template<class type_t , xtd::size len>
virtual reference xtd::fixed_array< type_t, len >::back ( )
inlinevirtual

Returns a reference to the last element in the container.

Returns
Reference to the first element.
Remarks
Calling front on an empty container causes undefined behavior.

◆ back() [2/2]

template<class type_t , xtd::size len>
virtual const_reference xtd::fixed_array< type_t, len >::back ( ) const
inlinevirtual

Returns a reference to the last element in the container.

Returns
Reference to the first element.
Remarks
Calling front on an empty container causes undefined behavior.

◆ begin() [1/2]

template<class type_t , xtd::size len>
const_iterator xtd::fixed_array< type_t, len >::begin ( ) const
inlinenoexcept

Returns an iterator to the first element of the enumarable.

Returns
Iterator to the first element.

◆ begin() [2/2]

template<class type_t , xtd::size len>
iterator xtd::fixed_array< type_t, len >::begin ( )
inlinenoexcept

Returns an iterator to the first element of the enumarable.

Returns
Iterator to the first element.

◆ cbegin()

template<class type_t , xtd::size len>
const_iterator xtd::fixed_array< type_t, len >::cbegin ( ) const
inlinenoexcept

Returns an iterator to the first element of the enumarable.

Returns
Iterator to the first element.

◆ cend()

template<class type_t , xtd::size len>
const_iterator xtd::fixed_array< type_t, len >::cend ( ) const
inlinenoexcept

Returns an iterator to the element following the last element of the enumarable.

Returns
Iterator to the element following the last element.

◆ count()

template<class type_t , xtd::size len>
size_type xtd::fixed_array< type_t, len >::count ( ) const
inlinenoexcept

Gets the number of elements contained in the xtd::collections::generic::list <type_t>.

Returns
The number of elements contained in the xtd::collections::generic::list <type_t>.

◆ data() [1/2]

template<class type_t , xtd::size len>
const_pointer xtd::fixed_array< type_t, len >::data ( ) const
inlinenoexcept

Returns pointer to the underlying array serving as element storage.

Returns
Pointer to the underlying element storage. For non-empty containers, the returned pointer compares equal to the address of the first element.
Remarks
The pointer is such that range [xtd::array::data(), xtd::array::data() + xtd::array::size()) is always a valid range, even if the container is empty (xtd::array::data() is not dereferenceable in that case).

◆ data() [2/2]

template<class type_t , xtd::size len>
pointer xtd::fixed_array< type_t, len >::data ( )
inlinenoexcept

Returns pointer to the underlying array serving as element storage.

Returns
Pointer to the underlying element storage. For non-empty containers, the returned pointer compares equal to the address of the first element.
Remarks
The pointer is such that range [xtd::array::data(), xtd::array::data() + xtd::array::size()) is always a valid range, even if the container is empty (xtd::array::data() is not dereferenceable in that case).

◆ empty()

template<class type_t , xtd::size len>
virtual bool xtd::fixed_array< type_t, len >::empty ( ) const
inlinevirtualnoexcept

Checks if the container has no elements, i.e. whether xtd::array::begin() == xtd::array::end().

Returns
true if the container is empty, false otherwise.

◆ end() [1/2]

template<class type_t , xtd::size len>
const_iterator xtd::fixed_array< type_t, len >::end ( ) const
inlinenoexcept

Returns an iterator to the element following the last element of the enumarable.

Returns
Iterator to the element following the last element.

◆ end() [2/2]

template<class type_t , xtd::size len>
iterator xtd::fixed_array< type_t, len >::end ( )
inlinenoexcept

Returns an iterator to the element following the last element of the enumarable.

Returns
Iterator to the element following the last element.

◆ front() [1/2]

template<class type_t , xtd::size len>
virtual reference xtd::fixed_array< type_t, len >::front ( )
inlinevirtual

Returns a reference to the first element in the container.

Returns
Reference to the first element.
Remarks
Calling front on an empty container causes undefined behavior.

◆ front() [2/2]

template<class type_t , xtd::size len>
virtual const_reference xtd::fixed_array< type_t, len >::front ( ) const
inlinevirtual

Returns a reference to the first element in the container.

Returns
Reference to the first element.
Remarks
Calling front on an empty container causes undefined behavior.

◆ items() [1/2]

template<class type_t , xtd::size len>
virtual const_base_type xtd::fixed_array< type_t, len >::items ( ) const
inlinevirtualnoexcept

Returns the underlying base type items.

Returns
The underlying base type items.

◆ items() [2/2]

template<class type_t , xtd::size len>
virtual base_type xtd::fixed_array< type_t, len >::items ( )
inlinevirtualnoexcept

Returns the underlying base type items.

Returns
The underlying base type items.

◆ length()

template<class type_t , xtd::size len>
virtual size_type xtd::fixed_array< type_t, len >::length ( ) const
inlinevirtualnoexcept

Gets a size that represents the total number of elements in all the dimensions of the array.

Returns
A size that represents the total number of elements in all the dimensions of the array; zero if there are no elements in the array.
Remarks
Retrieving the value of this property is an O(1) operation.

◆ size()

template<class type_t , xtd::size len>
xtd::size xtd::fixed_array< type_t, len >::size ( ) const
inlinenoexcept

Returns the number of elements in the container, i.e. std::distance(xtd::array::begin(), xtd::array::end()).

Returns
The number of elements in the container.

◆ at() [1/2]

template<class type_t , xtd::size len>
virtual const_reference xtd::fixed_array< type_t, len >::at ( size_type  index) const
inlinevirtual

Returns a reference to the element at specified location pos, with bounds checking.

Parameters
indexThe position of the element to return.
Returns
Reference to the requested element.
Exceptions
std::out_of_rangeIf pos is not within the range of the container.

◆ at() [2/2]

template<class type_t , xtd::size len>
virtual reference xtd::fixed_array< type_t, len >::at ( size_type  index)
inlinevirtual

Returns a reference to the element at specified location pos, with bounds checking.

Parameters
indexThe position of the element to return.
Returns
Reference to the requested element.
Exceptions
std::out_of_rangeIf pos is not within the range of the container.

◆ clear()

template<class type_t , xtd::size len>
void xtd::fixed_array< type_t, len >::clear ( )
inlinenoexcept

Clears the contents of this xtd::span <type> object.

Remarks
The xtd::span::clear method sets the items in the xtd::span <type_t> object to their default values. It does not remove items from the xtd::span <type_t>.

◆ fill()

template<class type_t , xtd::size len>
void xtd::fixed_array< type_t, len >::fill ( const type_t &  value)
inline

Fills the elements of this span with a specified value.

Parameters
valueThe value to assign to each element of the span.

◆ to_array()

template<class type_t , xtd::size len>
virtual xtd::array< value_type > xtd::fixed_array< type_t, len >::to_array ( ) const
inlinevirtualnoexcept

Copies the elements of the xtd::collections::generic::list <type_t> to a new array.

Returns
An array containing copies of the elements of the xtd::fixed_array <type_t, xtd::size>.

◆ to_string()

template<class type_t , xtd::size len>
xtd::string xtd::fixed_array< type_t, len >::to_string ( ) const
inlineoverridevirtualnoexcept

Returns a xtd::string that represents the current object.

Returns
A string that represents the current object.

Reimplemented from xtd::object.

◆ operator[]() [1/2]

template<class type_t , xtd::size len>
const_reference xtd::fixed_array< type_t, len >::operator[] ( xtd::size  index) const
inline

Returns a reference to the element at specified location index.

Parameters
indexThe position of the element to return.
Returns
Reference to the requested element.
Exceptions
std::out_of_rangeIf `index` is not within the range of the container.

◆ operator[]() [2/2]

template<class type_t , xtd::size len>
reference xtd::fixed_array< type_t, len >::operator[] ( xtd::size  index)
inline

Returns a reference to the element at specified location index.

Parameters
indexThe position of the element to return.
Returns
Reference to the requested element.

The documentation for this class was generated from the following file: