xtd 0.2.0
Loading...
Searching...
No Matches
xtd::collections::generic::helpers::raw_array< type_t, allocator_t > Class Template Reference

Definition

template<class type_t, class allocator_t = std::allocator<type_t>>
class xtd::collections::generic::helpers::raw_array< type_t, allocator_t >

Internal vector-like container used as a storage backend for xtd collections.

Header
#include <xtd/collections/generic/helpers/raw_array>
Namespace
xtd::collections::generic::helpers
Library
xtd.core

Public Aliases

using value_type
 Type of the elements.
 
using base_type
 Underlying vector type.
 
using const_base_type
 Const version of base_type.
 
using allocator_type
 Allocator type.
 
using size_type
 Type used for sizes.
 
using difference_type
 Type used for differences between iterators.
 
using reference
 Reference to element.
 
using const_reference
 Const reference to element.
 
using pointer
 Pointer to element.
 
using const_pointer
 Const pointer to element.
 
using iterator
 Forward iterator for raw_array.
 
using const_iterator
 Const forward iterator for raw_array.
 
using reverse_iterator
 Reverse iterator.
 
using const_reverse_iterator
 Const reverse iterator.
 

Public Fields

static constexpr size_type npos
 Represents an invalid index.
 
static constexpr size_type bpos
 Beginning position.
 
static constexpr size_type epos
 End position.
 

Public Constructors

 raw_array () noexcept=default
 Create a new raw_array instance.
 
 raw_array (const allocator_type &alloc) noexcept
 Create a new raw_array instance with specified allocator.
 
 raw_array (size_type count, const type_t &value, const allocator_type &alloc=allocator_type())
 Create a new raw_array instance with specified count, value, and allocator.
 
 raw_array (size_type count, const allocator_type &alloc=allocator_type())
 Create a new raw_array instance with specified count, and allocator.
 
template<class input_iterator_t>
 raw_array (input_iterator_t first, input_iterator_t last, const allocator_type &alloc=allocator_type())
 Create a new raw_array instance with specified first iterator, last iterator, and allocator.
 
 raw_array (const raw_array &vector)
 
 raw_array (const base_type &vector)
 
 raw_array (const raw_array &vector, const allocator_type &alloc)
 
 raw_array (const base_type &vector, const allocator_type &alloc)
 
 raw_array (std::initializer_list< type_t > items, const allocator_type &alloc=allocator_type())
 
 raw_array (std::initializer_list< bool > items, const allocator_type &alloc=allocator_type())
 
 raw_array (raw_array &&other)
 
 raw_array (base_type &&other)
 
 raw_array (raw_array &&other, const allocator_type &alloc)
 
 raw_array (base_type &&other, const allocator_type &alloc)
 

Public Properties

auto back () -> reference
 
auto back () const -> const_reference
 
auto begin () noexcept -> iterator
 
auto begin () const noexcept -> const_iterator
 
auto capacity () const noexcept -> size_type
 
auto cbegin () const noexcept -> const_iterator
 
auto cend () const noexcept -> const_iterator
 
auto crbegin () const noexcept -> const_reverse_iterator
 
auto crend () const noexcept -> const_reverse_iterator
 
auto data () noexcept -> pointer
 
auto data () const noexcept -> const_pointer
 
auto empty () const noexcept -> bool
 
auto end () noexcept -> iterator
 
auto end () const noexcept -> const_iterator
 
auto front () -> reference
 
auto front () const -> const_reference
 
auto items () const noexcept -> const_base_type &
 
auto items () noexcept -> base_type &
 
auto max_size () const noexcept -> size_type
 
auto rbegin () noexcept -> reverse_iterator
 
auto rbegin () const noexcept -> const_reverse_iterator
 
auto rend () noexcept -> reverse_iterator
 
auto rend () const noexcept -> const_reverse_iterator
 
auto size () const noexcept -> size_type
 
auto version () const noexcept -> size_type
 

Public Methods

auto assign (size_type count, const type_t &value) -> void
 
template<class input_iterator_t>
auto assign (input_iterator_t first, input_iterator_t last) -> void
 
auto assign (std::initializer_list< type_t > items) -> void
 
auto at (size_type index) -> reference
 
auto at (size_type index) const -> const_reference
 
auto clear () -> void
 
template<class ... args_t>
auto emplace (const_iterator pos, args_t &&... args) -> iterator
 
template<class ... args_t>
auto emplace_back (args_t &&... args) -> reference
 
auto erase (const_iterator pos) -> iterator
 
auto erase (const_iterator first, const_iterator last) -> iterator
 
auto get_allocator () const -> allocator_type
 
auto increment_version () noexcept -> size_type
 
auto insert (const_iterator pos, const type_t &value) -> iterator
 
auto insert (const_iterator pos, type_t &&value) -> iterator
 
auto insert (const_iterator pos, size_type count, const type_t &value) -> iterator
 
auto insert (const_iterator pos, size_type count, type_t &&value) -> iterator
 
template<class input_iterator_t>
auto insert (const_iterator pos, input_iterator_t first, input_iterator_t last) -> iterator
 
auto insert (const_iterator pos, const std::initializer_list< type_t > &items) -> iterator
 
auto pop_back () -> void
 
auto push_back (const type_t &value) -> void
 
auto push_back (type_t &&value) -> void
 
auto reserve (size_type new_cap) -> void
 
auto resize (size_type count) -> void
 
auto resize (size_type count, const value_type &value) -> void
 
auto shrink_to_fit () -> void
 
auto swap (raw_array &other) noexcept -> void
 

Public Operators

auto operator= (const raw_array &other) -> raw_array &=default
 
auto operator= (raw_array &&other) noexcept -> raw_array &=default
 
auto operator= (std::initializer_list< type_t > &items) -> raw_array &requires(!std::is_same_v< type_t, bool >)
 
auto operator= (std::initializer_list< bool > &items) -> raw_array &requires(std::is_same_v< type_t, bool >)
 
auto operator[] (size_type index) const -> const_reference
 
auto operator[] (size_type index) -> reference
 
 operator const base_type & () const noexcept
 
 operator base_type & () noexcept
 

Member Typedef Documentation

◆ value_type

template<class type_t, class allocator_t = std::allocator<type_t>>
using xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::value_type

Type of the elements.

◆ base_type

template<class type_t, class allocator_t = std::allocator<type_t>>
using xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::base_type

Underlying vector type.

◆ const_base_type

template<class type_t, class allocator_t = std::allocator<type_t>>
using xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::const_base_type

Const version of base_type.

◆ allocator_type

template<class type_t, class allocator_t = std::allocator<type_t>>
using xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::allocator_type

Allocator type.

◆ size_type

template<class type_t, class allocator_t = std::allocator<type_t>>
using xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::size_type

Type used for sizes.

◆ difference_type

template<class type_t, class allocator_t = std::allocator<type_t>>
using xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::difference_type

Type used for differences between iterators.

◆ reference

template<class type_t, class allocator_t = std::allocator<type_t>>
using xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::reference

Reference to element.

◆ const_reference

template<class type_t, class allocator_t = std::allocator<type_t>>
using xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::const_reference

Const reference to element.

◆ pointer

template<class type_t, class allocator_t = std::allocator<type_t>>
using xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::pointer

Pointer to element.

◆ const_pointer

template<class type_t, class allocator_t = std::allocator<type_t>>
using xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::const_pointer

Const pointer to element.

◆ iterator

template<class type_t, class allocator_t = std::allocator<type_t>>
using xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::iterator

Forward iterator for raw_array.

◆ const_iterator

template<class type_t, class allocator_t = std::allocator<type_t>>
using xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::const_iterator

Const forward iterator for raw_array.

◆ reverse_iterator

template<class type_t, class allocator_t = std::allocator<type_t>>
using xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::reverse_iterator

Reverse iterator.

◆ const_reverse_iterator

template<class type_t, class allocator_t = std::allocator<type_t>>
using xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::const_reverse_iterator

Const reverse iterator.

Constructor & Destructor Documentation

◆ raw_array() [1/5]

template<class type_t, class allocator_t = std::allocator<type_t>>
xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::raw_array ( )
defaultnoexcept

Create a new raw_array instance.

◆ raw_array() [2/5]

template<class type_t, class allocator_t = std::allocator<type_t>>
xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::raw_array ( const allocator_type & alloc)
inlineexplicitnoexcept

Create a new raw_array instance with specified allocator.

Parameters
allocThe allocator associate to this instance.

◆ raw_array() [3/5]

template<class type_t, class allocator_t = std::allocator<type_t>>
xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::raw_array ( size_type count,
const type_t & value,
const allocator_type & alloc = allocator_type() )
inline

Create a new raw_array instance with specified count, value, and allocator.

Parameters
countRepresents the number of value to fill this instance.
valueThe value to fill this instance.
allocThe allocator associate to this instance.

◆ raw_array() [4/5]

template<class type_t, class allocator_t = std::allocator<type_t>>
xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::raw_array ( size_type count,
const allocator_type & alloc = allocator_type() )
inlineexplicit

Create a new raw_array instance with specified count, and allocator.

Parameters
countRepresents the number of items of this instance.
allocThe allocator associate to this instance.

◆ raw_array() [5/5]

template<class type_t, class allocator_t = std::allocator<type_t>>
template<class input_iterator_t>
xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::raw_array ( input_iterator_t first,
input_iterator_t last,
const allocator_type & alloc = allocator_type() )
inline

Create a new raw_array instance with specified first iterator, last iterator, and allocator.

Parameters
firstThe first iteraror of the range to copy in this instances.
lastThe last iteraror of the range to copy in this instances.
allocThe allocator associate to this instance.

Member Data Documentation

◆ npos

template<class type_t, class allocator_t = std::allocator<type_t>>
size_type xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::npos
inlinestaticconstexpr

Represents an invalid index.

◆ bpos

template<class type_t, class allocator_t = std::allocator<type_t>>
size_type xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::bpos
inlinestaticconstexpr

Beginning position.

◆ epos

template<class type_t, class allocator_t = std::allocator<type_t>>
size_type xtd::collections::generic::helpers::raw_array< type_t, allocator_t >::epos
inlinestaticconstexpr

End position.


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