PMDK C++ bindings
1.13.0-git107.g7e59f08f
This is the C++ bindings documentation for PMDK's libpmemobj.
|
Persistent container with std::array compatible interface. More...
#include <libpmemobj++/container/array.hpp>
Public Types | |
using | value_type = T |
using | pointer = value_type * |
using | const_pointer = const value_type * |
using | reference = value_type & |
using | const_reference = const value_type & |
using | iterator = pmem::detail::basic_contiguous_iterator< T > |
using | const_iterator = const_pointer |
using | size_type = std::size_t |
using | difference_type = std::ptrdiff_t |
using | reverse_iterator = std::reverse_iterator< iterator > |
using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
using | range_snapshotting_iterator = pmem::detail::range_snapshotting_iterator< T > |
Public Member Functions | |
array ()=default | |
Defaulted constructor. | |
array (const array &)=default | |
Defaulted copy constructor. | |
array (array &&)=default | |
Defaulted move constructor. More... | |
array & | operator= (const array &other) |
Copy assignment operator - perform assignment from other pmem::obj::array. More... | |
array & | operator= (array &&other) |
Move assignment operator - perform move assignment from other pmem::obj::array. More... | |
reference | at (size_type n) |
Access element at specific index and add it to a transaction. More... | |
const_reference | at (size_type n) const |
Access element at specific index. More... | |
const_reference | const_at (size_type n) const |
Access element at specific index. 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... | |
T * | data () |
Returns raw pointer to the underlying data and adds entire array to a transaction. More... | |
const T * | data () const noexcept |
Returns const raw pointer to the underlying data. | |
const T * | cdata () const noexcept |
Returns const raw pointer to the underlying data. | |
iterator | begin () |
Returns an iterator to the beginning. More... | |
iterator | end () |
Returns an iterator to the end. More... | |
const_iterator | begin () const noexcept |
Returns const iterator to the beginning. | |
const_iterator | cbegin () const noexcept |
Returns const iterator to the beginning. | |
const_iterator | end () const noexcept |
Returns a const iterator to the end. | |
const_iterator | cend () const noexcept |
Returns a const iterator to the end. | |
reverse_iterator | rbegin () |
Returns a reverse iterator to the beginning. More... | |
reverse_iterator | rend () |
Returns a reverse iterator to the end. More... | |
const_reverse_iterator | rbegin () const noexcept |
Returns a const reverse iterator to the beginning. | |
const_reverse_iterator | crbegin () const noexcept |
Returns a const reverse iterator to the beginning. | |
const_reverse_iterator | rend () const noexcept |
Returns a const reverse iterator to the end. | |
const_reverse_iterator | crend () const noexcept |
Returns a const reverse iterator to the beginning. | |
reference | front () |
Access the first element and add this element to a transaction. More... | |
reference | back () |
Access the last element and add this element to a transaction. More... | |
const_reference | front () const |
Access the first element. | |
const_reference | cfront () const |
Access the first element. | |
const_reference | back () const |
Access the last element. | |
const_reference | cback () const |
Access the last element. | |
slice< pointer > | range (size_type start, size_type n) |
Returns slice and snapshots requested range. More... | |
slice< range_snapshotting_iterator > | range (size_type start, size_type n, size_type snapshot_size) |
Returns slice. 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 size_type | size () const noexcept |
Returns size of the array. | |
constexpr size_type | max_size () const noexcept |
Returns the maximum size of the array. | |
constexpr bool | empty () const noexcept |
Checks whether array is empty. | |
void | fill (const_reference value) |
Fills array with specified value inside internal transaction. More... | |
template<std::size_t Size = N> | |
std::enable_if< Size !=0 >::type | swap (array &other) |
Swaps content with other array's content inside internal transaction. More... | |
template<std::size_t Size = N> | |
std::enable_if< Size==0 >::type | swap (array &other) |
Swap for zero-sized array. | |
Public Attributes | |
standard_array_traits< T, N >::type | _data |
Related Functions | |
(Note that these are not member functions.) | |
template<typename T , std::size_t N> | |
bool | operator== (const array< T, N > &lhs, const array< T, N > &rhs) |
Non-member equal operator. | |
template<typename T , std::size_t N> | |
bool | operator!= (const array< T, N > &lhs, const array< T, N > &rhs) |
Non-member not-equal operator. | |
template<typename T , std::size_t N> | |
bool | operator< (const array< T, N > &lhs, const array< T, N > &rhs) |
Non-member less than operator. | |
template<typename T , std::size_t N> | |
bool | operator> (const array< T, N > &lhs, const array< T, N > &rhs) |
Non-member greater than operator. | |
template<typename T , std::size_t N> | |
bool | operator>= (const array< T, N > &lhs, const array< T, N > &rhs) |
Non-member greater or equal operator. | |
template<typename T , std::size_t N> | |
bool | operator<= (const array< T, N > &lhs, const array< T, N > &rhs) |
Non-member less or equal operator. | |
template<typename T , std::size_t N> | |
pmem::obj::array< T, N >::const_iterator | cbegin (const pmem::obj::array< T, N > &a) |
Non-member cbegin. | |
template<typename T , std::size_t N> | |
pmem::obj::array< T, N >::const_iterator | cend (const pmem::obj::array< T, N > &a) |
Non-member cend. | |
template<typename T , std::size_t N> | |
pmem::obj::array< T, N >::const_reverse_iterator | crbegin (const pmem::obj::array< T, N > &a) |
Non-member crbegin. | |
template<typename T , std::size_t N> | |
pmem::obj::array< T, N >::const_reverse_iterator | crend (const pmem::obj::array< T, N > &a) |
Non-member crend. | |
template<typename T , std::size_t N> | |
pmem::obj::array< T, N >::iterator | begin (pmem::obj::array< T, N > &a) |
Non-member begin. | |
template<typename T , std::size_t N> | |
pmem::obj::array< T, N >::const_iterator | begin (const pmem::obj::array< T, N > &a) |
Non-member begin. | |
template<typename T , std::size_t N> | |
pmem::obj::array< T, N >::iterator | end (pmem::obj::array< T, N > &a) |
Non-member end. | |
template<typename T , std::size_t N> | |
pmem::obj::array< T, N >::const_iterator | end (const pmem::obj::array< T, N > &a) |
Non-member end. | |
template<typename T , std::size_t N> | |
pmem::obj::array< T, N >::reverse_iterator | rbegin (pmem::obj::array< T, N > &a) |
Non-member rbegin. | |
template<typename T , std::size_t N> | |
pmem::obj::array< T, N >::const_reverse_iterator | rbegin (const pmem::obj::array< T, N > &a) |
Non-member rbegin. | |
template<typename T , std::size_t N> | |
pmem::obj::array< T, N >::reverse_iterator | rend (pmem::obj::array< T, N > &a) |
Non-member rend. | |
template<typename T , std::size_t N> | |
pmem::obj::array< T, N >::const_reverse_iterator | rend (const pmem::obj::array< T, N > &a) |
Non-member rend. | |
template<typename T , size_t N> | |
void | swap (pmem::obj::array< T, N > &lhs, pmem::obj::array< T, N > &rhs) |
Non-member swap function. | |
template<size_t I, typename T , size_t N> | |
T & | get (pmem::obj::array< T, N > &a) |
Non-member get function. | |
template<size_t I, typename T , size_t N> | |
T && | get (pmem::obj::array< T, N > &&a) |
Non-member get function. | |
template<size_t I, typename T , size_t N> | |
const T & | get (const pmem::obj::array< T, N > &a) noexcept |
Non-member get function. | |
template<size_t I, typename T , size_t N> | |
const T && | get (const pmem::obj::array< T, N > &&a) noexcept |
Non-member get function. | |
Persistent container with std::array compatible interface.
pmem::obj::array can only be stored on pmem. Creating array on stack will result with "pool_error" exception.
All methods which allow write access to specific element will add it to an active transaction.
All methods which return non-const pointer to raw data add entire array to a transaction.
When a non-const iterator is returned it adds part of the array to a transaction while traversing.
|
default |
Defaulted move constructor.
Performs member-wise move but do NOT add moved-from array to the transaction.
|
inline |
Access element at specific index and add it to a transaction.
std::out_of_range | if index is out of bound. |
transaction_error | when adding the object to the transaction failed. |
|
inline |
Access element at specific index.
std::out_of_range | if index is out of bound. |
|
inline |
Access the last element and add this element to a transaction.
transaction_error | when adding the object to the transaction failed. |
|
inline |
Returns an iterator to the beginning.
transaction_error | when adding the object to the transaction failed. |
|
inline |
Access element at specific index.
std::out_of_range | if index is out of bound. |
|
inline |
Returns const slice.
[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 array. |
|
inline |
Returns raw pointer to the underlying data and adds entire array to a transaction.
transaction_error | when adding the object to the transaction failed. |
|
inline |
Returns an iterator to the end.
transaction_error | when adding the object to the transaction failed. |
|
inline |
Fills array with specified value inside internal transaction.
transaction_error | when adding the object to the transaction failed. |
pmem::pool_error | if an object is not in persistent memory. |
|
inline |
Access the first element and add this element to a transaction.
transaction_error | when adding the object to the transaction failed. |
|
inline |
Move assignment operator - perform move assignment from other pmem::obj::array.
This function internally creates a transaction.
transaction_error | when adding the object to the transaction failed. |
pmem::pool_error | if an object is not in persistent memory. |
|
inline |
Copy assignment operator - perform assignment from other pmem::obj::array.
This function internally creates a transaction.
transaction_error | when adding the object to the transaction failed. |
pmem::pool_error | if an object is not in persistent memory. |
|
inline |
Access element at specific index and add it to a transaction.
No bounds checking is performed.
transaction_error | when adding the object to the transaction failed. |
|
inline |
Access element at specific index.
No bounds checking is performed.
|
inline |
Returns slice and snapshots requested range.
[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 array. |
|
inline |
Returns const slice.
[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 array. |
|
inline |
Returns slice.
[in] | start | start index of requested range. |
[in] | n | number of elements in range. |
[in] | snapshot_size | number of elements which should be snapshotted in a bulk while traversing this slice. If provided value is larger or equal to n, entire range is added to a transaction. If value is equal to 0 no snapshotting happens. |
std::out_of_range | if any element of the range would be outside of the array. |
|
inline |
Returns a reverse iterator to the beginning.
transaction_error | when adding the object to the transaction failed. |
|
inline |
Returns a reverse iterator to the end.
transaction_error | when adding the object to the transaction failed. |
|
inline |
Swaps content with other array's content inside internal transaction.
transaction_error | when adding the object to the transaction failed. |
pmem::pool_error | if an object is not in persistent memory. |