PMDK C++ bindings
1.13.0-git107.g7e59f08f
This is the C++ bindings documentation for PMDK's libpmemobj.
|
Persistent version of segment vector with std::vector compatible interface. More...
#include <libpmemobj++/container/segment_vector.hpp>
Public Types | |
using | policy_type = Policy |
using | segment_type = typename policy_type::template segment_type< T > |
using | segment_vector_type = typename policy_type::template segment_vector_type< T > |
using | policy = policy_type |
using | storage = policy_type |
using | value_type = T |
using | size_type = std::size_t |
using | difference_type = std::ptrdiff_t |
using | reference = value_type & |
using | const_reference = const value_type & |
using | pointer = value_type * |
using | const_pointer = const value_type * |
using | iterator = segment_vector_internal::segment_iterator< segment_vector, false > |
using | const_iterator = segment_vector_internal::segment_iterator< segment_vector, true > |
using | reverse_iterator = std::reverse_iterator< iterator > |
using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
Public Member Functions | |
segment_vector () | |
Default constructor. More... | |
segment_vector (size_type count, const value_type &value) | |
Constructs the container with count copies of elements with value value. More... | |
segment_vector (size_type count) | |
Constructs the container with count copies of T default constructed values. More... | |
template<typename InputIt , typename std::enable_if< detail::is_input_iterator< InputIt >::value, InputIt >::type * = nullptr> | |
segment_vector (InputIt first, InputIt last) | |
Constructs the container with the contents of the range [first, last). More... | |
segment_vector (const segment_vector &other) | |
Copy constructor. More... | |
segment_vector (segment_vector &&other) | |
Move constructor. More... | |
segment_vector (std::initializer_list< T > init) | |
Constructs the container with the contents of the initializer list init. More... | |
segment_vector (const std::vector< T > &other) | |
Copy constructor. More... | |
segment_vector & | operator= (const segment_vector &other) |
Copy assignment operator. More... | |
segment_vector & | operator= (segment_vector &&other) |
Move assignment operator. More... | |
segment_vector & | operator= (std::initializer_list< T > ilist) |
Replaces the contents with those identified by initializer list ilist transactionally. More... | |
segment_vector & | operator= (const std::vector< T > &other) |
Copy assignment operator. More... | |
void | assign (size_type count, const_reference value) |
Replaces the contents with count copies of value value transactionally. More... | |
template<typename InputIt , typename std::enable_if< detail::is_input_iterator< InputIt >::value, InputIt >::type * = nullptr> | |
void | assign (InputIt first, InputIt last) |
Replaces the contents with copies of those in the range [first, last) transactionally. More... | |
void | assign (std::initializer_list< T > ilist) |
Replaces the contents with the elements from the initializer list ilist transactionally. More... | |
void | assign (const segment_vector &other) |
Copy assignment method. More... | |
void | assign (segment_vector &&other) |
Move assignment method. More... | |
void | assign (const std::vector< T > &other) |
Copy assignment method. More... | |
~segment_vector () | |
Destructor. More... | |
reference | at (size_type n) |
Access element at specific index with bounds checking and add it to a transaction. More... | |
const_reference | at (size_type n) const |
Access element at specific index with bounds checking. More... | |
const_reference | const_at (size_type n) const |
Access element at specific index with bounds checking. More... | |
reference | operator[] (size_type n) |
Access element at specific index and add it to a transaction. More... | |
const_reference | operator[] (size_type n) const |
Access element at specific index. More... | |
reference | front () |
Access the first element and add this element to a transaction. More... | |
const_reference | front () const |
Access the first element. More... | |
const_reference | cfront () const |
Access the first element. More... | |
reference | back () |
Access the last element and add this element to a transaction. More... | |
const_reference | back () const |
Access the last element. More... | |
const_reference | cback () const |
Access the last element. More... | |
iterator | begin () |
Returns an iterator to the beginning. More... | |
const_iterator | begin () const noexcept |
Returns const iterator to the beginning. More... | |
const_iterator | cbegin () const noexcept |
Returns const iterator to the beginning. More... | |
iterator | end () |
Returns an iterator to past the end. More... | |
const_iterator | end () const noexcept |
Returns a const iterator to past the end. More... | |
const_iterator | cend () const noexcept |
Returns a const iterator to the end. More... | |
reverse_iterator | rbegin () |
Returns a reverse iterator to the beginning. More... | |
const_reverse_iterator | rbegin () const noexcept |
Returns a const reverse iterator to the beginning. More... | |
const_reverse_iterator | crbegin () const noexcept |
Returns a const reverse iterator to the beginning. More... | |
reverse_iterator | rend () |
Returns a reverse iterator to the end. More... | |
const_reverse_iterator | rend () const noexcept |
Returns a const reverse iterator to the end. More... | |
const_reverse_iterator | crend () const noexcept |
Returns a const reverse iterator to the beginning. More... | |
slice< iterator > | range (size_type start, size_type n) |
Returns slice and snapshots requested range. More... | |
slice< const_iterator > | range (size_type start, size_type n) const |
Returns const slice. More... | |
slice< const_iterator > | crange (size_type start, size_type n) const |
Returns const slice. More... | |
constexpr bool | empty () const noexcept |
Checks whether the container is empty. More... | |
size_type | size () const noexcept |
constexpr size_type | max_size () const noexcept |
void | reserve (size_type capacity_new) |
Increases the capacity of the segment_vector to capacity_new transactionally. More... | |
size_type | capacity () const noexcept |
void | shrink_to_fit () |
Requests transactional removal of unused capacity. More... | |
void | clear () |
Clears the content of a segment_vector transactionally. More... | |
void | free_data () |
Clears the content of a segment_vector and frees all allocated persistent memory for data transactionally. More... | |
iterator | insert (const_iterator pos, const T &value) |
Inserts value before pos in the container transactionally. More... | |
iterator | insert (const_iterator pos, T &&value) |
Moves value before pos in the container transactionally. More... | |
iterator | insert (const_iterator pos, size_type count, const T &value) |
Inserts count copies of the value before pos in the container transactionally. More... | |
template<typename InputIt , typename std::enable_if< detail::is_input_iterator< InputIt >::value, InputIt >::type * = nullptr> | |
iterator | insert (const_iterator pos, InputIt first, InputIt last) |
Inserts elements from range [first, last) before pos in the container transactionally. More... | |
iterator | insert (const_iterator pos, std::initializer_list< T > ilist) |
Inserts elements from initializer list ilist before pos in the container transactionally. More... | |
template<class... Args> | |
iterator | emplace (const_iterator pos, Args &&... args) |
Inserts a new element into the container directly before pos. More... | |
template<class... Args> | |
reference | emplace_back (Args &&... args) |
Appends a new element to the end of the container transactionally. More... | |
iterator | erase (const_iterator pos) |
Removes the element at pos. More... | |
iterator | erase (const_iterator first, const_iterator last) |
Removes the elements in the range [first, last). More... | |
void | push_back (const T &value) |
Appends the given element value to the end of the container transactionally. More... | |
void | push_back (T &&value) |
Appends the given element value to the end of the container transactionally. More... | |
void | pop_back () |
Removes the last element of the container transactionally. More... | |
void | resize (size_type count) |
Resizes the container to count elements transactionally. More... | |
void | resize (size_type count, const value_type &value) |
Resizes the container to contain count elements transactionally. More... | |
void | swap (segment_vector &other) |
Exchanges the contents of the container with other transactionally. | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename T , typename Policy > | |
void | swap (segment_vector< T, Policy > &lhs, segment_vector< T, Policy > &rhs) |
Swaps the contents of lhs and rhs. More... | |
template<typename T , typename Policy > | |
bool | operator== (const segment_vector< T, Policy > &lhs, const segment_vector< T, Policy > &rhs) |
Comparison operator. More... | |
template<typename T , typename Policy > | |
bool | operator!= (const segment_vector< T, Policy > &lhs, const segment_vector< T, Policy > &rhs) |
Comparison operator. More... | |
template<typename T , typename Policy > | |
bool | operator< (const segment_vector< T, Policy > &lhs, const segment_vector< T, Policy > &rhs) |
Comparison operator. More... | |
template<typename T , typename Policy > | |
bool | operator<= (const segment_vector< T, Policy > &lhs, const segment_vector< T, Policy > &rhs) |
Comparison operator. More... | |
template<typename T , typename Policy > | |
bool | operator> (const segment_vector< T, Policy > &lhs, const segment_vector< T, Policy > &rhs) |
Comparison operator. More... | |
template<typename T , typename Policy > | |
bool | operator>= (const segment_vector< T, Policy > &lhs, const segment_vector< T, Policy > &rhs) |
Comparison operator. More... | |
template<typename T , typename Policy > | |
bool | operator== (const segment_vector< T, Policy > &lhs, const std::vector< T > &rhs) |
Comparison operator. More... | |
template<typename T , typename Policy > | |
bool | operator!= (const segment_vector< T, Policy > &lhs, const std::vector< T > &rhs) |
Comparison operator. More... | |
template<typename T , typename Policy > | |
bool | operator< (const segment_vector< T, Policy > &lhs, const std::vector< T > &rhs) |
Comparison operator. More... | |
template<typename T , typename Policy > | |
bool | operator<= (const segment_vector< T, Policy > &lhs, const std::vector< T > &rhs) |
Comparison operator. More... | |
template<typename T , typename Policy > | |
bool | operator> (const segment_vector< T, Policy > &lhs, const std::vector< T > &rhs) |
Comparison operator. More... | |
template<typename T , typename Policy > | |
bool | operator>= (const segment_vector< T, Policy > &lhs, const std::vector< T > &rhs) |
Comparison operator. More... | |
template<typename T , typename Policy > | |
bool | operator== (const std::vector< T > &lhs, const segment_vector< T, Policy > &rhs) |
Comparison operator. More... | |
template<typename T , typename Policy > | |
bool | operator!= (const std::vector< T > &lhs, const segment_vector< T, Policy > &rhs) |
Comparison operator. More... | |
template<typename T , typename Policy > | |
bool | operator< (const std::vector< T > &lhs, const segment_vector< T, Policy > &rhs) |
Comparison operator. More... | |
template<typename T , typename Policy > | |
bool | operator<= (const std::vector< T > &lhs, const segment_vector< T, Policy > &rhs) |
Comparison operator. More... | |
template<typename T , typename Policy > | |
bool | operator> (const std::vector< T > &lhs, const segment_vector< T, Policy > &rhs) |
Comparison operator. More... | |
template<typename T , typename Policy > | |
bool | operator>= (const std::vector< T > &lhs, const segment_vector< T, Policy > &rhs) |
Comparison operator. More... | |
Persistent version of segment vector with std::vector compatible interface.
Segment table is a data type with a vector-like interface. Differences are: it does not do reallocations and iterators are not invalidated when adding new elements.
Policy template represents Segments storing type and managing methods.
Example usage:
pmem::obj::segment_vector< T, Policy >::segment_vector |
Default constructor.
Constructs an empty container.
pmem::pool_error | if an object is not in persistent memory. |
pmem::transaction_scope_error | if wasn't called in transaction. |
pmem::obj::segment_vector< T, Policy >::segment_vector | ( | size_type | count, |
const value_type & | value | ||
) |
Constructs the container with count copies of elements with value value.
[in] | count | number of elements to construct. |
[in] | value | value of all constructed elements. |
rethrows | constructor's exception. |
pmem::pool_error | if an object is not in persistent memory. |
pmem::transaction_scope_error | if wasn't called in transaction. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
pmem::transaction_out_of_memory | when not enough memory to allocate. |
|
explicit |
Constructs the container with count copies of T default constructed values.
[in] | count | number of elements to construct. |
rethrows | constructor's exception. |
pmem::pool_error | if an object is not in persistent memory. |
pmem::transaction_scope_error | if wasn't called in transaction. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
pmem::transaction_out_of_memory | when not enough memory to allocate. |
pmem::obj::segment_vector< T, Policy >::segment_vector | ( | InputIt | first, |
InputIt | last | ||
) |
Constructs the container with the contents of the range [first, last).
The first and last arguments must satisfy InputIterator requirements. This overload only participates in overload resolution if InputIt satisfies InputIterator, to avoid ambiguity with the overload of count-value constructor.
[in] | first | first iterator. |
[in] | last | last iterator. |
rethrows | constructor's exception. |
pmem::pool_error | if an object is not in persistent memory. |
pmem::transaction_scope_error | if wasn't called in transaction. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
pmem::transaction_out_of_memory | when not enough memory to allocate. |
pmem::obj::segment_vector< T, Policy >::segment_vector | ( | const segment_vector< T, Policy > & | other | ) |
Copy constructor.
Constructs the container with the copy of the contents of other.
[in] | other | reference to the segment_vector to be copied. |
rethrows | constructor's exception. |
pmem::pool_error | if an object is not in persistent memory. |
pmem::transaction_scope_error | if wasn't called in transaction. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
pmem::transaction_out_of_memory | when not enough memory to allocate. |
pmem::obj::segment_vector< T, Policy >::segment_vector | ( | segment_vector< T, Policy > && | other | ) |
Move constructor.
Constructs the container with the contents of other using move semantics. After the move, other is guaranteed to be empty().
[in] | other | rvalue reference to the segment_vector to be moved from. |
rethrows | destructor exception. |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_free_error | when freeing underlying segment failed. |
pmem::obj::segment_vector< T, Policy >::segment_vector | ( | std::initializer_list< T > | init | ) |
Constructs the container with the contents of the initializer list init.
[in] | init | initializer list with content to be constructed. |
rethrows | constructor's exception. |
pmem::pool_error | if an object is not in persistent memory. |
pmem::transaction_scope_error | if wasn't called in transaction. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
pmem::transaction_out_of_memory | when not enough memory to allocate. |
pmem::obj::segment_vector< T, Policy >::segment_vector | ( | const std::vector< T > & | other | ) |
Copy constructor.
Constructs the container with the copy of the contents of std::vector<T> other.
[in] | other | reference to the vector to be copied. |
rethrows | constructor's exception. |
pmem::pool_error | if an object is not in persistent memory. |
pmem::transaction_scope_error | if wasn't called in transaction. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
pmem::transaction_out_of_memory | when not enough memory to allocate. |
pmem::obj::segment_vector< T, Policy >::~segment_vector |
Destructor.
Note that free_data may throw a transaction_free_error when freeing underlying segments failed. It is recommended to call free_data manually before object destruction, otherwise application can be terminated on failure.
void pmem::obj::segment_vector< T, Policy >::assign | ( | const segment_vector< T, Policy > & | other | ) |
Copy assignment method.
Replaces the contents with a copy of the contents of other transactionally.
rethrows | constructor's exception. |
rethrows | destructor exception. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
pmem::transaction_free_error | when freeing underlying segment failed. |
void pmem::obj::segment_vector< T, Policy >::assign | ( | const std::vector< T > & | other | ) |
Copy assignment method.
Replaces the contents with a copy of the contents of std::vector<T> other transactionally.
rethrows | constructor's exception. |
rethrows | destructor exception. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
pmem::transaction_free_error | when freeing underlying segment failed. |
void pmem::obj::segment_vector< T, Policy >::assign | ( | InputIt | first, |
InputIt | last | ||
) |
Replaces the contents with copies of those in the range [first, last) transactionally.
This overload participates in overload resolution only if InputIt satisfies InputIterator. Only the iterators and references in [0, std::distance(first, last)) remain valid.
[in] | first | first iterator. |
[in] | last | last iterator. |
rethrows | constructor's exception. |
rethrows | destructor exception. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
pmem::transaction_free_error | when freeing underlying segment failed. |
using vector policy user may call assign with zero count and in that case we can't call assign of uninitialized vector
void pmem::obj::segment_vector< T, Policy >::assign | ( | segment_vector< T, Policy > && | other | ) |
Move assignment method.
Replaces the contents with those of other using move semantics (i.e. the data in other is moved from other into this container) transactionally. Other is in a valid but empty state afterwards.
rethrows | constructor's exception. |
rethrows | destructor exception. |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_free_error | when freeing underlying segment failed. |
void pmem::obj::segment_vector< T, Policy >::assign | ( | size_type | count, |
const_reference | value | ||
) |
Replaces the contents with count copies of value value transactionally.
Only the iterators and references in [0, std::distance(first, last)) remain valid.
[in] | count | number of elements to construct. |
[in] | value | value of all constructed elements. |
std::length_error | if count > max_size(). |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
rethrows | constructor's exception. |
rethrows | destructor exception. |
pmem::transaction_free_error | when freeing underlying segment failed. |
using vector policy user may call assign with zero count and in that case we can't call assign of uninitialized vector
void pmem::obj::segment_vector< T, Policy >::assign | ( | std::initializer_list< T > | ilist | ) |
Replaces the contents with the elements from the initializer list ilist transactionally.
Only the iterators and references in [0, std::distance(ilist.begin(), ilist.end())) remain valid.
[in] | ilist | initializer list with content to be constructed. |
rethrows | constructor's exception. |
rethrows | destructor exception. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
pmem::transaction_free_error | when freeing underlying segment failed. |
segment_vector< T, Policy >::reference pmem::obj::segment_vector< T, Policy >::at | ( | size_type | n | ) |
Access element at specific index with bounds checking and add it to a transaction.
[in] | n | index number. |
std::out_of_range | if n is not within the range of the container. |
pmem::transaction_error | when adding the object to the transaction failed. |
segment_vector< T, Policy >::const_reference pmem::obj::segment_vector< T, Policy >::at | ( | size_type | n | ) | const |
Access element at specific index with bounds checking.
[in] | n | index number. |
std::out_of_range | if n is not within the range of the container. |
segment_vector< T, Policy >::reference pmem::obj::segment_vector< T, Policy >::back |
Access the last element and add this element to a transaction.
pmem::transaction_error | when adding the object to the transaction failed. |
segment_vector< T, Policy >::const_reference pmem::obj::segment_vector< T, Policy >::back |
Access the last element.
segment_vector< T, Policy >::iterator pmem::obj::segment_vector< T, Policy >::begin |
Returns an iterator to the beginning.
|
noexcept |
Returns const iterator to the beginning.
|
noexcept |
segment_vector< T, Policy >::const_reference pmem::obj::segment_vector< T, Policy >::cback |
|
noexcept |
Returns const iterator to the beginning.
In contradiction to begin(), cbegin() will return const_iterator not depending on the const-qualification of the object it is called on.
|
noexcept |
Returns a const iterator to the end.
In contradiction to end(), cend() will return const_iterator not depending on the const-qualification of the object it is called on.
segment_vector< T, Policy >::const_reference pmem::obj::segment_vector< T, Policy >::cfront |
void pmem::obj::segment_vector< T, Policy >::clear |
Clears the content of a segment_vector transactionally.
rethrows | constructor's exception. |
rethrows | destructor exception. |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_free_error | when freeing underlying segment failed. |
segment_vector< T, Policy >::const_reference pmem::obj::segment_vector< T, Policy >::const_at | ( | size_type | n | ) | const |
Access element at specific index with bounds checking.
In contradiction to at(), const_at() will return const_reference not depending on the const-qualification of the object it is called on.
[in] | n | index number. |
std::out_of_range | if n is not within the range of the container. |
slice< typename segment_vector< T, Policy >::const_iterator > pmem::obj::segment_vector< T, Policy >::crange | ( | size_type | start, |
size_type | n | ||
) | const |
Returns const slice.
This method is not specified by STL standards.
[in] | start | start index of requested range. |
[in] | n | number of elements in range. |
std::out_of_range | if any element of the range would be outside of the segment_vector. |
|
noexcept |
Returns a const reverse iterator to the beginning.
In contradiction to rbegin(), crbegin() will return const_reverse_iterator not depending on the const-qualification of the object it is called on.
|
noexcept |
Returns a const reverse iterator to the beginning.
In contradiction to rend(), crend() will return const_reverse_iterator not depending on the const-qualification of the object it is called on.
segment_vector< T, Policy >::iterator pmem::obj::segment_vector< T, Policy >::emplace | ( | const_iterator | pos, |
Args &&... | args | ||
) |
Inserts a new element into the container directly before pos.
The element is constructed in-place. The arguments args... are forwarded to the constructor as std::forward<Args>(args).... Note that standard allows args to be a self reference and internal emplace implementation handles this case by creating temporary element_type object. This object is being stored either on stack or on pmem, see pmem::detail::temp_value for details.
[in] | pos | iterator before which the new element will be constructed. |
[in] | args | arguments to forward to the constructor of the element. |
rethrows | constructor's exception. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
segment_vector< T, Policy >::reference pmem::obj::segment_vector< T, Policy >::emplace_back | ( | Args &&... | args | ) |
Appends a new element to the end of the container transactionally.
The element is constructed in-place. The arguments args... are forwarded to the constructor as std::forward<Args>(args).... Past-the-end iterator is invalidated.
[in] | args | arguments to forward to the constructor of the element. |
rethrows | constructor's exception. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
|
constexprnoexcept |
Checks whether the container is empty.
segment_vector< T, Policy >::iterator pmem::obj::segment_vector< T, Policy >::end |
Returns an iterator to past the end.
|
noexcept |
Returns a const iterator to past the end.
segment_vector< T, Policy >::iterator pmem::obj::segment_vector< T, Policy >::erase | ( | const_iterator | first, |
const_iterator | last | ||
) |
Removes the elements in the range [first, last).
Invalidates iterators and references at or after the point of the erase, including the end() iterator. The iterator pos must be valid and dereferenceable. Thus the end() iterator (which is valid, but is not dereferenceable) cannot be used as a value for pos.
[in] | first | beginning of the range of elements to be removed. |
[in] | last | end of range of elements to be removed. |
rethrows | destructor exception. |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_free_error | when freeing underlying segment failed. |
segment_vector< T, Policy >::iterator pmem::obj::segment_vector< T, Policy >::erase | ( | const_iterator | pos | ) |
Removes the element at pos.
Invalidates iterators and references at or after the point of the erase, including the end() iterator. The iterator pos must be valid and dereferenceable. Thus the end() iterator (which is valid, but is not dereferenceable) cannot be used as a value for pos.
[in] | pos | iterator to the element to be removed. |
rethrows | destructor exception. |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_free_error | when freeing underlying segment failed. |
void pmem::obj::segment_vector< T, Policy >::free_data |
Clears the content of a segment_vector and frees all allocated persistent memory for data transactionally.
rethrows | destructor exception. |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_free_error | when freeing underlying segments failed. |
segment_vector< T, Policy >::reference pmem::obj::segment_vector< T, Policy >::front |
Access the first element and add this element to a transaction.
pmem::transaction_error | when adding the object to the transaction failed. |
segment_vector< T, Policy >::const_reference pmem::obj::segment_vector< T, Policy >::front |
Access the first element.
segment_vector< T, Policy >::iterator pmem::obj::segment_vector< T, Policy >::insert | ( | const_iterator | pos, |
const T & | value | ||
) |
Inserts value before pos in the container transactionally.
Causes allocation if the new size() is greater than the old capacity(). Only the iterators and references before the insertion point remain valid.
[in] | pos | iterator before which the content will be inserted. pos may be the end() iterator. |
[in] | value | element value to be inserted. |
rethrows | constructor's exception. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
segment_vector< T, Policy >::iterator pmem::obj::segment_vector< T, Policy >::insert | ( | const_iterator | pos, |
InputIt | first, | ||
InputIt | last | ||
) |
Inserts elements from range [first, last) before pos in the container transactionally.
Causes allocation if the new size() is greater than the old capacity(). Only the iterators and references before the insertion point remain valid. This overload participates in overload resolution only if InputIt qualifies as InputIterator, to avoid ambiguity with the pos-count-value overload. The behavior is undefined if first and last are iterators into *this.
[in] | pos | iterator before which the content will be inserted. pos may be the end() iterator. |
[in] | first | begin of the range of elements to insert, can't be iterator into container for which insert is called. |
[in] | last | end of the range of elements to insert, can't be iterator into container for which insert is called. |
rethrows | constructor's exception. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
segment_vector< T, Policy >::iterator pmem::obj::segment_vector< T, Policy >::insert | ( | const_iterator | pos, |
size_type | count, | ||
const T & | value | ||
) |
Inserts count copies of the value before pos in the container transactionally.
Causes allocation if the new size() is greater than the old capacity(). Only the iterators and references before the insertion point remain valid.
[in] | pos | iterator before which the content will be inserted. pos may be the end() iterator. |
[in] | count | number of copies to be inserted. |
[in] | value | element value to be inserted. |
rethrows | constructor's exception. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
segment_vector< T, Policy >::iterator pmem::obj::segment_vector< T, Policy >::insert | ( | const_iterator | pos, |
std::initializer_list< T > | ilist | ||
) |
Inserts elements from initializer list ilist before pos in the container transactionally.
Causes allocation if the new size() is greater than the old capacity(). Only the iterators and references before the insertion point remain valid.
[in] | pos | iterator before which the content will be inserted. pos may be the end() iterator. |
[in] | ilist | initializer list to insert the values from. |
rethrows | constructor's exception. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
segment_vector< T, Policy >::iterator pmem::obj::segment_vector< T, Policy >::insert | ( | const_iterator | pos, |
T && | value | ||
) |
Moves value before pos in the container transactionally.
Causes allocation if the new size() is greater than the old capacity(). Only the iterators and references before the insertion pointremain valid.
[in] | pos | iterator before which the content will be inserted. pos may be the end() iterator. |
[in] | value | element value to be inserted. |
rethrows | constructor's exception. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
|
constexprnoexcept |
segment_vector< T, Policy > & pmem::obj::segment_vector< T, Policy >::operator= | ( | const segment_vector< T, Policy > & | other | ) |
Copy assignment operator.
Replaces the contents with a copy of the contents of other transactionally.
rethrows | constructor's exception. |
rethrows | destructor exception. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
pmem::transaction_free_error | when freeing underlying segment failed. |
segment_vector< T, Policy > & pmem::obj::segment_vector< T, Policy >::operator= | ( | const std::vector< T > & | other | ) |
Copy assignment operator.
Replaces the contents with a copy of the contents of std::vector<T> other transactionally.
rethrows | constructor's exception. |
rethrows | destructor exception. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
pmem::transaction_free_error | when freeing underlying segment failed. |
segment_vector< T, Policy > & pmem::obj::segment_vector< T, Policy >::operator= | ( | segment_vector< T, Policy > && | other | ) |
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) transactionally. Other is in a valid but empty state afterwards.
rethrows | constructor's exception. |
rethrows | destructor exception. |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_free_error | when freeing underlying segment failed. |
segment_vector< T, Policy > & pmem::obj::segment_vector< T, Policy >::operator= | ( | std::initializer_list< T > | ilist | ) |
Replaces the contents with those identified by initializer list ilist transactionally.
rethrows | constructor's exception. |
rethrows | destructor exception. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
pmem::transaction_free_error | when freeing underlying segment failed. |
segment_vector< T, Policy >::reference pmem::obj::segment_vector< T, Policy >::operator[] | ( | size_type | n | ) |
Access element at specific index and add it to a transaction.
No bounds checking is performed.
[in] | n | index number. |
pmem::transaction_error | when adding the object to the transaction failed. |
segment_vector< T, Policy >::const_reference pmem::obj::segment_vector< T, Policy >::operator[] | ( | size_type | n | ) | const |
Access element at specific index.
No bounds checking is performed.
[in] | n | index number. |
void pmem::obj::segment_vector< T, Policy >::pop_back |
Removes the last element of the container transactionally.
Calling pop_back on an empty container does nothing. No iterators or references except for back() and end() are invalidated.
rethrows | constructor's exception. |
rethrows | destructor exception. |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_free_error | when freeing underlying segment failed. |
void pmem::obj::segment_vector< T, Policy >::push_back | ( | const T & | value | ) |
Appends the given element value to the end of the container transactionally.
The new element is initialized as a copy of value.
[in] | value | the value of the element to be appended. |
std::length_error | when new capacity larger than max_size(). |
rethrows | constructor's exception. |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
void pmem::obj::segment_vector< T, Policy >::push_back | ( | T && | value | ) |
Appends the given element value to the end of the container transactionally.
value is moved into the new element.
[in] | value | the value of the element to be appended. |
std::length_error | when new capacity larger than max_size(). |
rethrows | constructor's exception. |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
slice< typename segment_vector< T, Policy >::iterator > pmem::obj::segment_vector< T, Policy >::range | ( | size_type | start, |
size_type | n | ||
) |
Returns slice and snapshots requested range.
This method is not specified by STL standards.
[in] | start | start index of requested range. |
[in] | n | number of elements in range. |
std::out_of_range | if any element of the range would be outside of the segment_vector. |
pmem::transaction_error | when snapshotting failed. |
slice< typename segment_vector< T, Policy >::const_iterator > pmem::obj::segment_vector< T, Policy >::range | ( | size_type | start, |
size_type | n | ||
) | const |
Returns const slice.
This method is not specified by STL standards.
[in] | start | start index of requested range. |
[in] | n | number of elements in range. |
std::out_of_range | if any element of the range would be outside of the segment_vector. |
segment_vector< T, Policy >::reverse_iterator pmem::obj::segment_vector< T, Policy >::rbegin |
Returns a reverse iterator to the beginning.
|
noexcept |
Returns a const reverse iterator to the beginning.
segment_vector< T, Policy >::reverse_iterator pmem::obj::segment_vector< T, Policy >::rend |
Returns a reverse iterator to the end.
|
noexcept |
Returns a const reverse iterator to the end.
void pmem::obj::segment_vector< T, Policy >::reserve | ( | size_type | capacity_new | ) |
Increases the capacity of the segment_vector to capacity_new transactionally.
If segment where should be capacity_new is greater than the current capacity's segment, new segments allocated, otherwise the method does nothing. Past-the-end iterator invalidated if allocation occurs.
[in] | capacity_new | new capacity. |
std::length_error | when capacity_new larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
void pmem::obj::segment_vector< T, Policy >::resize | ( | size_type | count | ) |
Resizes the container to count elements transactionally.
If the current size is greater than count, the container is reduced to its first count elements. If the current size is less than count, additional default-inserted elements are appended.
[in] | count | new size of the container |
rethrows | constructor's exception. |
rethrows | destructor exception. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_free_error | when freeing underlying segment failed. |
pmem::transaction_alloc_error | when allocating new memory failed. |
pmem::transaction_out_of_memory | when not enough memory to allocate. |
void pmem::obj::segment_vector< T, Policy >::resize | ( | size_type | count, |
const value_type & | value | ||
) |
Resizes the container to contain count elements transactionally.
If the current size is greater than count, the container is reduced to its first count elements. If the current size is less than count, additional copies of value are appended.
[in] | count | new size of the container. |
[in] | value | the value to initialize the new elements with. |
rethrows | constructor's exception. |
rethrows | destructor exception. |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_free_error | when freeing underlying segment failed. |
std::length_error | when new capacity larger than max_size(). |
pmem::transaction_alloc_error | when allocating new memory failed. |
pmem::transaction_out_of_memory | when not enough memory to allocate. |
void pmem::obj::segment_vector< T, Policy >::shrink_to_fit |
Requests transactional removal of unused capacity.
New capacity will be set to nearest power of 2 greater than current size().
rethrows | destructor exception. |
pmem::transaction_error | when snapshotting failed. |
pmem::transaction_free_error | when freeing underlying segment failed. |
|
noexcept |
|
related |
Comparison operator.
Compares the contents of two containers.
Checks if containers have the different number of elements or at least one element in lhs is not equal to element in rhs at the same position.
[in] | lhs | is pmem::obj::experimental::segment_vector<T, Policy, SPolicy>. |
[in] | rhs | is pmem::obj::experimental::segment_vector<T, Policy, SPolicy>. |
|
related |
Comparison operator.
Compares the contents of two containers.
Checks if containers have the same number of elements and each element in lhs is equal to element in rhs at the same position.
[in] | lhs | is pmem::obj::experimental::segment_vector<T, SegmentPolicy, StoragePolicy> |
[in] | rhs | is std::vector<T>. |
|
related |
Comparison operator.
Compares the contents of two containers.
Checks if containers have the same number of elements and each element in lhs is equal to element in rhs at the same position.
[in] | lhs | is std::vector<T>. |
[in] | rhs | is pmem::obj::experimental::segment_vector<T, Policy, SPolicy>. |
|
related |
Comparison operator.
Compares the contents of two containers lexicographically.
[in] | lhs | is pmem::obj::experimental::segment_vector<T, Policy, SPolicy>. |
[in] | rhs | is pmem::obj::experimental::segment_vector<T, Policy, SPolicy>. |
|
related |
Comparison operator.
Compares the contents of two containers lexicographically.
[in] | lhs | is pmem::obj::experimental::segment_vector<T, SegmentPolicy, StoragePolicy> |
[in] | rhs | is std::vector<T>. |
|
related |
Comparison operator.
Compares the contents of two containers lexicographically.
[in] | lhs | is std::vector<T>. |
[in] | rhs | is pmem::obj::experimental::segment_vector<T, Policy, SPolicy>. |
|
related |
Comparison operator.
Compares the contents of two containers lexicographically.
[in] | lhs | is pmem::obj::experimental::segment_vector<T, Policy, SPolicy>. |
[in] | rhs | is pmem::obj::experimental::segment_vector<T, Policy>. |
|
related |
Comparison operator.
Compares the contents of two containers lexicographically.
[in] | lhs | is pmem::obj::experimental::segment_vector<T, SegmentPolicy, StoragePolicy> |
[in] | rhs | is std::vector<T>. |
|
related |
Comparison operator.
Compares the contents of two containers lexicographically.
[in] | lhs | is std::vector<T>. |
[in] | rhs | is pmem::obj::experimental::segment_vector<T, Policy, SPolicy>. |
|
related |
Comparison operator.
Compares the contents of two containers.
Checks if containers have the same number of elements and each element in lhs is equal to element in rhs at the same position.
[in] | lhs | is pmem::obj::experimental::segment_vector<T, Policy, SPolicy>. |
[in] | rhs | is pmem::obj::experimental::segment_vector<T, Policy, SPolicy>. |
|
related |
Comparison operator.
Compares the contents of two containers.
Checks if containers have the same number of elements and each element in lhs is equal to element in rhs at the same position.
[in] | lhs | is pmem::obj::experimental::segment_vector<T, SegmentPolicy, StoragePolicy> |
[in] | rhs | is std::vector<T>. |
|
related |
Comparison operator.
Compares the contents of two containers.
Checks if containers have the same number of elements and each element in lhs is equal to element in rhs at the same position.
[in] | lhs | is std::vector<T>. |
[in] | rhs | is pmem::obj::experimental::segment_vector<T, Policy, SPolicy>. |
|
related |
Comparison operator.
Compares the contents of two containers lexicographically.
[in] | lhs | is pmem::obj::experimental::segment_vector<T, Policy, SPolicy>. |
[in] | rhs | is pmem::obj::experimental::segment_vector<T, Policy, SPolicy>. |
|
related |
Comparison operator.
Compares the contents of two containers lexicographically.
[in] | lhs | is pmem::obj::experimental::segment_vector<T, SegmentPolicy, StoragePolicy> |
[in] | rhs | is std::vector<T>. |
|
related |
Comparison operator.
Compares the contents of two containers lexicographically.
[in] | lhs | is std::vector<T>. |
[in] | rhs | is pmem::obj::experimental::segment_vector<T, Policy, SPolicy>. |
|
related |
Comparison operator.
Compares the contents of two containers lexicographically.
[in] | lhs | is pmem::obj::experimental::segment_vector<T, Policy, SPolicy>. |
[in] | rhs | is pmem::obj::experimental::segment_vector<T, Policy, SPolicy>. |
|
related |
Comparison operator.
Compares the contents of two containers lexicographically.
[in] | lhs | is pmem::obj::experimental::segment_vector<T, SegmentPolicy, StoragePolicy> |
[in] | rhs | is std::vector<T>. |
|
related |
Comparison operator.
Compares the contents of two containers lexicographically.
[in] | lhs | is std::vector<T>. |
[in] | rhs | is pmem::obj::experimental::segment_vector<T, Policy, SPolicy>. |
|
related |
Swaps the contents of lhs and rhs.
[in] | lhs | first segment_vector. |
[in] | rhs | second segment_vector. |