Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#include <flex_vector.hpp>
Public Types | |
using | memory_policy = MemoryPolicy |
using | value_type = T |
using | reference = const T & |
using | size_type = detail::rbts::size_t |
using | difference_type = std::ptrdiff_t |
using | const_reference = const T & |
using | iterator = detail::rbts::rrbtree_iterator< T, MemoryPolicy, B, BL > |
using | const_iterator = iterator |
using | reverse_iterator = std::reverse_iterator< iterator > |
using | persistent_type = flex_vector< T, MemoryPolicy, B, BL > |
Public Member Functions | |
flex_vector_transient ()=default | |
flex_vector_transient (vector_transient< T, MemoryPolicy, B, BL > v) | |
iterator | begin () const |
iterator | end () const |
reverse_iterator | rbegin () const |
reverse_iterator | rend () const |
size_type | size () const |
bool | empty () const |
reference | operator[] (size_type index) const |
reference | at (size_type index) const |
void | push_back (value_type value) |
void | set (size_type index, value_type value) |
template<typename FnT > | |
void | update (size_type index, FnT &&fn) |
void | take (size_type elems) |
void | drop (size_type elems) |
persistent_type | persistent () & |
persistent_type | persistent () && |
void | append (flex_vector_transient &r) |
void | append (flex_vector_transient &&r) |
void | prepend (flex_vector_transient &l) |
void | prepend (flex_vector_transient &&l) |
Static Public Attributes | |
static constexpr auto | bits = B |
static constexpr auto | bits_leaf = BL |
Private Types | |
using | impl_t = detail::rbts::rrbtree< T, MemoryPolicy, B, BL > |
using | base_t = typename MemoryPolicy::transience_t::owner |
using | owner_t = typename MemoryPolicy::transience_t::owner |
Private Member Functions | |
flex_vector_transient (impl_t impl) | |
Private Attributes | |
friend | persistent_type |
impl_t | impl_ = impl_t::empty() |
Detailed Description
template<typename T, typename MemoryPolicy = default_memory_policy, detail::rbts::bits_t B = default_bits, detail::rbts::bits_t BL = detail::rbts::derive_bits_leaf<T, MemoryPolicy, B>>
class immer::flex_vector_transient< T, MemoryPolicy, B, BL >
Mutable version of immer::flex_vector
.
Refer to :doc:transients
to learn more about when and how to use the mutable versions of immutable containers.
Definition at line 27 of file flex_vector.hpp.
Member Typedef Documentation
◆ base_t
|
private |
Definition at line 47 of file flex_vector_transient.hpp.
◆ const_iterator
using immer::flex_vector_transient< T, MemoryPolicy, B, BL >::const_iterator = iterator |
Definition at line 62 of file flex_vector_transient.hpp.
◆ const_reference
using immer::flex_vector_transient< T, MemoryPolicy, B, BL >::const_reference = const T& |
Definition at line 59 of file flex_vector_transient.hpp.
◆ difference_type
using immer::flex_vector_transient< T, MemoryPolicy, B, BL >::difference_type = std::ptrdiff_t |
Definition at line 58 of file flex_vector_transient.hpp.
◆ impl_t
|
private |
Definition at line 46 of file flex_vector_transient.hpp.
◆ iterator
using immer::flex_vector_transient< T, MemoryPolicy, B, BL >::iterator = detail::rbts::rrbtree_iterator<T, MemoryPolicy, B, BL> |
Definition at line 61 of file flex_vector_transient.hpp.
◆ memory_policy
using immer::flex_vector_transient< T, MemoryPolicy, B, BL >::memory_policy = MemoryPolicy |
Definition at line 53 of file flex_vector_transient.hpp.
◆ owner_t
|
private |
Definition at line 48 of file flex_vector_transient.hpp.
◆ persistent_type
using immer::flex_vector_transient< T, MemoryPolicy, B, BL >::persistent_type = flex_vector<T, MemoryPolicy, B, BL> |
Definition at line 65 of file flex_vector_transient.hpp.
◆ reference
using immer::flex_vector_transient< T, MemoryPolicy, B, BL >::reference = const T& |
Definition at line 56 of file flex_vector_transient.hpp.
◆ reverse_iterator
using immer::flex_vector_transient< T, MemoryPolicy, B, BL >::reverse_iterator = std::reverse_iterator<iterator> |
Definition at line 63 of file flex_vector_transient.hpp.
◆ size_type
using immer::flex_vector_transient< T, MemoryPolicy, B, BL >::size_type = detail::rbts::size_t |
Definition at line 57 of file flex_vector_transient.hpp.
◆ value_type
using immer::flex_vector_transient< T, MemoryPolicy, B, BL >::value_type = T |
Definition at line 55 of file flex_vector_transient.hpp.
Constructor & Destructor Documentation
◆ flex_vector_transient() [1/3]
|
default |
Default constructor. It creates a flex_vector of size() == 0
. It does not allocate memory and its complexity is .
◆ flex_vector_transient() [2/3]
|
inline |
Default constructor. It creates a flex_vector with the same contents as v
. It does not allocate memory and is .
Definition at line 78 of file flex_vector_transient.hpp.
◆ flex_vector_transient() [3/3]
|
inlineprivate |
Definition at line 225 of file flex_vector_transient.hpp.
Member Function Documentation
◆ append() [1/2]
|
inline |
Appends the contents of the r
at the end. It may allocate memory and its complexity is:
Definition at line 201 of file flex_vector_transient.hpp.
References immer::flex_vector_transient< T, MemoryPolicy, B, BL >::impl_.
◆ append() [2/2]
|
inline |
Definition at line 206 of file flex_vector_transient.hpp.
References immer::flex_vector_transient< T, MemoryPolicy, B, BL >::impl_.
◆ at()
|
inline |
Returns a const
reference to the element at position index
. It throws an std::out_of_range
exception when . It does not allocate memory and its complexity is effectively .
Definition at line 138 of file flex_vector_transient.hpp.
References immer::detail::rbts::rrbtree< T, MemoryPolicy, B, BL >::get_check(), and immer::flex_vector_transient< T, MemoryPolicy, B, BL >::impl_.
◆ begin()
|
inline |
Returns an iterator pointing at the first element of the collection. It does not allocate memory and its complexity is .
Definition at line 89 of file flex_vector_transient.hpp.
References immer::flex_vector_transient< T, MemoryPolicy, B, BL >::impl_.
Referenced by immer::flex_vector_transient< T, MemoryPolicy, B, BL >::rend().
◆ drop()
|
inline |
Removes the first the first min(elems, size())
elements. It may allocate memory and its complexity is effectively .
Definition at line 181 of file flex_vector_transient.hpp.
References immer::detail::rbts::rrbtree< T, MemoryPolicy, B, BL >::drop_mut(), and immer::flex_vector_transient< T, MemoryPolicy, B, BL >::impl_.
◆ empty()
|
inline |
Returns true
if there are no elements in the container. It does not allocate memory and its complexity is .
Definition at line 121 of file flex_vector_transient.hpp.
References immer::flex_vector_transient< T, MemoryPolicy, B, BL >::impl_, and immer::detail::rbts::rrbtree< T, MemoryPolicy, B, BL >::size.
◆ end()
|
inline |
Returns an iterator pointing just after the last element of the collection. It does not allocate and its complexity is .
Definition at line 95 of file flex_vector_transient.hpp.
References immer::flex_vector_transient< T, MemoryPolicy, B, BL >::impl_.
Referenced by immer::flex_vector_transient< T, MemoryPolicy, B, BL >::rbegin().
◆ operator[]()
|
inline |
Returns a const
reference to the element at position index
. It is undefined when . It does not allocate memory and its complexity is effectively .
Definition at line 129 of file flex_vector_transient.hpp.
References immer::detail::rbts::rrbtree< T, MemoryPolicy, B, BL >::get(), and immer::flex_vector_transient< T, MemoryPolicy, B, BL >::impl_.
◆ persistent() [1/2]
|
inline |
Returns an immutable form of this container, an immer::flex_vector
.
Definition at line 188 of file flex_vector_transient.hpp.
References immer::flex_vector_transient< T, MemoryPolicy, B, BL >::impl_.
◆ persistent() [2/2]
|
inline |
Definition at line 193 of file flex_vector_transient.hpp.
References immer::flex_vector_transient< T, MemoryPolicy, B, BL >::impl_.
◆ prepend() [1/2]
|
inline |
Prepends the contents of the l
at the beginning. It may allocate memory and its complexity is:
Definition at line 214 of file flex_vector_transient.hpp.
References immer::flex_vector_transient< T, MemoryPolicy, B, BL >::impl_.
◆ prepend() [2/2]
|
inline |
Definition at line 219 of file flex_vector_transient.hpp.
References immer::flex_vector_transient< T, MemoryPolicy, B, BL >::impl_.
◆ push_back()
|
inline |
Inserts value
at the end. It may allocate memory and its complexity is effectively .
Definition at line 145 of file flex_vector_transient.hpp.
References immer::flex_vector_transient< T, MemoryPolicy, B, BL >::impl_, and immer::detail::rbts::rrbtree< T, MemoryPolicy, B, BL >::push_back_mut().
◆ rbegin()
|
inline |
Returns an iterator that traverses the collection backwards, pointing at the first element of the reversed collection. It does not allocate memory and its complexity is .
Definition at line 102 of file flex_vector_transient.hpp.
References immer::flex_vector_transient< T, MemoryPolicy, B, BL >::end().
◆ rend()
|
inline |
Returns an iterator that traverses the collection backwards, pointing after the last element of the reversed collection. It does not allocate memory and its complexity is .
Definition at line 109 of file flex_vector_transient.hpp.
References immer::flex_vector_transient< T, MemoryPolicy, B, BL >::begin().
◆ set()
|
inline |
Sets to the value value
at position idx
. Undefined for index >= size()
. It may allocate memory and its complexity is effectively .
Definition at line 154 of file flex_vector_transient.hpp.
References immer::detail::rbts::rrbtree< T, MemoryPolicy, B, BL >::assoc_mut(), and immer::flex_vector_transient< T, MemoryPolicy, B, BL >::impl_.
◆ size()
|
inline |
Returns the number of elements in the container. It does not allocate memory and its complexity is .
Definition at line 115 of file flex_vector_transient.hpp.
References immer::flex_vector_transient< T, MemoryPolicy, B, BL >::impl_, and immer::detail::rbts::rrbtree< T, MemoryPolicy, B, BL >::size.
◆ take()
|
inline |
Resizes the vector to only contain the first min(elems, size())
elements. It may allocate memory and its complexity is effectively .
Definition at line 173 of file flex_vector_transient.hpp.
References immer::flex_vector_transient< T, MemoryPolicy, B, BL >::impl_, and immer::detail::rbts::rrbtree< T, MemoryPolicy, B, BL >::take_mut().
◆ update()
|
inline |
Updates the vector to contain the result of the expression fn((*this)[idx])
at position idx
. Undefined for 0 >= size()
. It may allocate memory and its complexity is effectively .
Definition at line 165 of file flex_vector_transient.hpp.
References immer::flex_vector_transient< T, MemoryPolicy, B, BL >::impl_, and immer::detail::rbts::rrbtree< T, MemoryPolicy, B, BL >::update_mut().
Member Data Documentation
◆ bits
|
static |
Definition at line 51 of file flex_vector_transient.hpp.
◆ bits_leaf
|
static |
Definition at line 52 of file flex_vector_transient.hpp.
◆ impl_
|
private |
Definition at line 229 of file flex_vector_transient.hpp.
Referenced by immer::flex_vector_transient< T, MemoryPolicy, B, BL >::append(), immer::flex_vector_transient< T, MemoryPolicy, B, BL >::at(), immer::flex_vector_transient< T, MemoryPolicy, B, BL >::begin(), immer::flex_vector_transient< T, MemoryPolicy, B, BL >::drop(), immer::flex_vector_transient< T, MemoryPolicy, B, BL >::empty(), immer::flex_vector_transient< T, MemoryPolicy, B, BL >::end(), immer::flex_vector_transient< T, MemoryPolicy, B, BL >::operator[](), immer::flex_vector_transient< T, MemoryPolicy, B, BL >::persistent(), immer::flex_vector_transient< T, MemoryPolicy, B, BL >::prepend(), immer::flex_vector_transient< T, MemoryPolicy, B, BL >::push_back(), immer::flex_vector_transient< T, MemoryPolicy, B, BL >::set(), immer::flex_vector_transient< T, MemoryPolicy, B, BL >::size(), immer::flex_vector_transient< T, MemoryPolicy, B, BL >::take(), and immer::flex_vector_transient< T, MemoryPolicy, B, BL >::update().
◆ persistent_type
|
private |
Definition at line 223 of file flex_vector_transient.hpp.
The documentation for this class was generated from the following files:
- src/immer/flex_vector.hpp
- src/immer/flex_vector_transient.hpp