PMDK C++ bindings
1.13.0-git107.g7e59f08f
This is the C++ bindings documentation for PMDK's libpmemobj.
|
Resides on pmem class. More...
#include <libpmemobj++/p.hpp>
Public Member Functions | |
p (const T &_val) noexcept | |
Value constructor. More... | |
p ()=default | |
Defaulted constructor. | |
p & | operator= (const p &rhs) |
Assignment operator. More... | |
template<typename Y , typename = typename std::enable_if< std::is_convertible<Y, T>::value>::type> | |
p & | operator= (const p< Y > &rhs) |
Converting assignment operator from a different p<>. More... | |
operator T () const noexcept | |
Conversion operator back to the underlying type. | |
T & | get_rw () |
Retrieves read-write reference of the object. More... | |
const T & | get_ro () const noexcept |
Retrieves read-only const reference of the object. More... | |
void | swap (p &other) |
Swaps two p objects of the same type. More... | |
Related Functions | |
(Note that these are not member functions.) | |
template<class T > | |
void | swap (p< T > &a, p< T > &b) |
Swaps two p objects of the same type. More... | |
template<typename T > | |
std::ostream & | operator<< (std::ostream &os, const p< T > &pp) |
Ostream operator overload. | |
template<typename T > | |
std::istream & | operator>> (std::istream &is, p< T > &pp) |
Istream operator overload. | |
template<typename T > | |
p< T > & | operator++ (p< T > &pp) |
Prefix increment operator overload. | |
template<typename T > | |
p< T > & | operator-- (p< T > &pp) |
Prefix decrement operator overload. | |
template<typename T > | |
p< T > | operator++ (p< T > &pp, int) |
Postfix increment operator overload. | |
template<typename T > | |
p< T > | operator-- (p< T > &pp, int) |
Postfix decrement operator overload. | |
template<typename T , typename Y > | |
p< T > & | operator+= (p< T > &lhs, const p< Y > &rhs) |
Addition assignment operator overload. | |
template<typename T , typename Y > | |
p< T > & | operator+= (p< T > &lhs, const Y &rhs) |
Addition assignment operator overload. | |
template<typename T , typename Y > | |
p< T > & | operator-= (p< T > &lhs, const p< Y > &rhs) |
Subtraction assignment operator overload. | |
template<typename T , typename Y > | |
p< T > & | operator-= (p< T > &lhs, const Y &rhs) |
Subtraction assignment operator overload. | |
template<typename T , typename Y > | |
p< T > & | operator*= (p< T > &lhs, const p< Y > &rhs) |
Multiplication assignment operator overload. | |
template<typename T , typename Y > | |
p< T > & | operator*= (p< T > &lhs, const Y &rhs) |
Multiplication assignment operator overload. | |
template<typename T , typename Y > | |
p< T > & | operator/= (p< T > &lhs, const p< Y > &rhs) |
Division assignment operator overload. | |
template<typename T , typename Y > | |
p< T > & | operator/= (p< T > &lhs, const Y &rhs) |
Division assignment operator overload. | |
template<typename T , typename Y > | |
p< T > & | operator%= (p< T > &lhs, const p< Y > &rhs) |
Modulo assignment operator overload. | |
template<typename T , typename Y > | |
p< T > & | operator%= (p< T > &lhs, const Y &rhs) |
Modulo assignment operator overload. | |
template<typename T , typename Y > | |
p< T > & | operator&= (p< T > &lhs, const p< Y > &rhs) |
Bitwise AND assignment operator overload. | |
template<typename T , typename Y > | |
p< T > & | operator&= (p< T > &lhs, const Y &rhs) |
Bitwise AND assignment operator overload. | |
template<typename T , typename Y > | |
p< T > & | operator|= (p< T > &lhs, const p< Y > &rhs) |
Bitwise OR assignment operator overload. | |
template<typename T , typename Y > | |
p< T > & | operator|= (p< T > &lhs, const Y &rhs) |
Bitwise OR assignment operator overload. | |
template<typename T , typename Y > | |
p< T > & | operator^= (p< T > &lhs, const p< Y > &rhs) |
Bitwise XOR assignment operator overload. | |
template<typename T , typename Y > | |
p< T > & | operator^= (p< T > &lhs, const Y &rhs) |
Bitwise XOR assignment operator overload. | |
template<typename T , typename Y > | |
p< T > & | operator<<= (p< T > &lhs, const p< Y > &rhs) |
Bitwise left shift assignment operator overload. | |
template<typename T , typename Y > | |
p< T > & | operator<<= (p< T > &lhs, const Y &rhs) |
Bitwise left shift assignment operator overload. | |
template<typename T , typename Y > | |
p< T > & | operator>>= (p< T > &lhs, const p< Y > &rhs) |
Bitwise right shift assignment operator overload. | |
template<typename T , typename Y > | |
p< T > & | operator>>= (p< T > &lhs, const Y &rhs) |
Bitwise right shift assignment operator overload. | |
Resides on pmem class.
p class is a property-like template class that has to be used for all variables (excluding persistent pointers), which are used in pmemobj transactions. The p property makes sure that changes to a variable within a transaction are made atomically with respect to persistence. It does it by creating a snapshot of the variable when modified in the transaction scope. The p class is not designed to be used with compound types. For that see the persistent_ptr.
|
inlinenoexcept |
Value constructor.
Directly assigns a value to the underlying storage.
_val | const reference to the value to be assigned. |
|
inlinenoexcept |
Retrieves read-only const reference of the object.
This method has no transaction side effects.
|
inline |
Retrieves read-write reference of the object.
The entire object is automatically added to the transaction.
pmem::transaction_error | when adding the object to the transaction failed. |
|
inline |
Assignment operator.
The p<> class property assignment within a transaction automatically registers this operation so that a rollback is possible.
pmem::transaction_error | when adding the object to the transaction failed. |
|
inline |
Converting assignment operator from a different p<>.
Available only for convertible types. Just like regular assignment, also automatically registers itself in a transaction.
pmem::transaction_error | when adding the object to the transaction failed. |
|
inline |
Swaps two p objects of the same type.
pmem::transaction_error | when adding the object to the transaction failed. |
Swaps two p objects of the same type.
Non-member swap function as required by Swappable concept. en.cppreference.com/w/cpp/concept/Swappable