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

reference back ()
 
const_reference back () const
 
iterator begin () noexcept
 
const_iterator begin () const noexcept
 
size_type capacity () const noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
const_reverse_iterator crbegin () const noexcept
 
const_reverse_iterator crend () const noexcept
 
pointer data () noexcept
 
const_pointer data () const noexcept
 
bool empty () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 
reference front ()
 
const_reference front () const
 
const_base_typeitems () const noexcept
 
base_typeitems () noexcept
 
size_type max_size () const noexcept
 
reverse_iterator rbegin () noexcept
 
const_reverse_iterator rbegin () const noexcept
 
reverse_iterator rend () noexcept
 
const_reverse_iterator rend () const noexcept
 
size_type size () const noexcept
 
size_type version () const noexcept
 

Public Methods

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

Public Operators

raw_arrayoperator= (const raw_array &other)=default
 
raw_arrayoperator= (raw_array &&other) noexcept=default
 
raw_arrayoperator= (std::initializer_list< type_t > &items)
 
raw_arrayoperator= (std::initializer_list< bool > &items)
 
const_reference operator[] (size_type index) const
 
reference operator[] (size_type index)
 
 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: