NVML C++ bindings  0.1 experimental
This is the C++ bindings documentation for NVML's libpmemobj.
Classes | Functions
persistent_ptr.hpp File Reference

Persistent smart pointer. More...

#include <cassert>
#include <memory>
#include <ostream>
#include "libpmemobj++/detail/common.hpp"
#include "libpmemobj++/detail/specialization.hpp"
#include "libpmemobj++/pool.hpp"
Include dependency graph for persistent_ptr.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  nvml::obj::pool< T >
 PMEMobj pool class. More...
 
class  nvml::obj::persistent_ptr< T >
 Persistent pointer class. More...
 

Functions

template<class T >
void nvml::obj::swap (persistent_ptr< T > &a, persistent_ptr< T > &b) noexcept
 Swaps two persistent_ptr objects of the same type. More...
 
template<typename T , typename Y >
bool nvml::obj::operator== (const persistent_ptr< T > &lhs, const persistent_ptr< Y > &rhs) noexcept
 Equality operator. More...
 
template<typename T , typename Y >
bool nvml::obj::operator!= (const persistent_ptr< T > &lhs, const persistent_ptr< Y > &rhs) noexcept
 Inequality operator.
 
template<typename T >
bool nvml::obj::operator== (const persistent_ptr< T > &lhs, std::nullptr_t) noexcept
 Equality operator with nullptr.
 
template<typename T >
bool nvml::obj::operator== (std::nullptr_t, const persistent_ptr< T > &lhs) noexcept
 Equality operator with nullptr.
 
template<typename T >
bool nvml::obj::operator!= (const persistent_ptr< T > &lhs, std::nullptr_t) noexcept
 Inequality operator with nullptr.
 
template<typename T >
bool nvml::obj::operator!= (std::nullptr_t, const persistent_ptr< T > &lhs) noexcept
 Inequality operator with nullptr.
 
template<typename T , typename Y >
bool nvml::obj::operator< (const persistent_ptr< T > &lhs, const persistent_ptr< Y > &rhs) noexcept
 Less than operator. More...
 
template<typename T , typename Y >
bool nvml::obj::operator<= (const persistent_ptr< T > &lhs, const persistent_ptr< Y > &rhs) noexcept
 Less or equal than operator. More...
 
template<typename T , typename Y >
bool nvml::obj::operator> (const persistent_ptr< T > &lhs, const persistent_ptr< Y > &rhs) noexcept
 Greater than operator. More...
 
template<typename T , typename Y >
bool nvml::obj::operator>= (const persistent_ptr< T > &lhs, const persistent_ptr< Y > &rhs) noexcept
 Greater or equal than operator. More...
 
template<typename T >
bool nvml::obj::operator< (const persistent_ptr< T > &lhs, std::nullptr_t) noexcept
 Compare a persistent_ptr with a null pointer.
 
template<typename T >
bool nvml::obj::operator< (std::nullptr_t, const persistent_ptr< T > &rhs) noexcept
 Compare a persistent_ptr with a null pointer.
 
template<typename T >
bool nvml::obj::operator<= (const persistent_ptr< T > &lhs, std::nullptr_t) noexcept
 Compare a persistent_ptr with a null pointer.
 
template<typename T >
bool nvml::obj::operator<= (std::nullptr_t, const persistent_ptr< T > &rhs) noexcept
 Compare a persistent_ptr with a null pointer.
 
template<typename T >
bool nvml::obj::operator> (const persistent_ptr< T > &lhs, std::nullptr_t) noexcept
 Compare a persistent_ptr with a null pointer.
 
template<typename T >
bool nvml::obj::operator> (std::nullptr_t, const persistent_ptr< T > &rhs) noexcept
 Compare a persistent_ptr with a null pointer.
 
template<typename T >
bool nvml::obj::operator>= (const persistent_ptr< T > &lhs, std::nullptr_t) noexcept
 Compare a persistent_ptr with a null pointer.
 
template<typename T >
bool nvml::obj::operator>= (std::nullptr_t, const persistent_ptr< T > &rhs) noexcept
 Compare a persistent_ptr with a null pointer.
 
template<typename T >
persistent_ptr< T > nvml::obj::operator+ (const persistent_ptr< T > &lhs, std::ptrdiff_t s)
 Addition operator for persistent pointers.
 
template<typename T >
persistent_ptr< T > nvml::obj::operator- (const persistent_ptr< T > &lhs, std::ptrdiff_t s)
 Subtraction operator for persistent pointers.
 
template<typename T >
ptrdiff_t nvml::obj::operator- (const persistent_ptr< T > &lhs, const persistent_ptr< T > &rhs)
 Subtraction operator for persistent pointers of identical type. More...
 
template<typename T >
std::ostream & nvml::obj::operator<< (std::ostream &os, const persistent_ptr< T > &pptr)
 Ostream operator for the persistent pointer.
 

Detailed Description

Persistent smart pointer.

Function Documentation

template<typename T >
ptrdiff_t nvml::obj::operator- ( const persistent_ptr< T > &  lhs,
const persistent_ptr< T > &  rhs 
)
inline

Subtraction operator for persistent pointers of identical type.

Calculates the offset difference of PMEMoids in terms of represented objects. Calculating the difference of pointers from objects of different pools is not allowed.

template<typename T , typename Y >
bool nvml::obj::operator< ( const persistent_ptr< T > &  lhs,
const persistent_ptr< Y > &  rhs 
)
inlinenoexcept

Less than operator.

Returns
true if the uuid_lo of lhs is less than the uuid_lo of rhs, should they be equal, the offsets are compared. Returns false otherwise.
template<typename T , typename Y >
bool nvml::obj::operator<= ( const persistent_ptr< T > &  lhs,
const persistent_ptr< Y > &  rhs 
)
inlinenoexcept

Less or equal than operator.

See less than operator for comparison rules.

template<typename T , typename Y >
bool nvml::obj::operator== ( const persistent_ptr< T > &  lhs,
const persistent_ptr< Y > &  rhs 
)
inlinenoexcept

Equality operator.

This checks if underlying PMEMoids are equal.

template<typename T , typename Y >
bool nvml::obj::operator> ( const persistent_ptr< T > &  lhs,
const persistent_ptr< Y > &  rhs 
)
inlinenoexcept

Greater than operator.

See less than operator for comparison rules.

template<typename T , typename Y >
bool nvml::obj::operator>= ( const persistent_ptr< T > &  lhs,
const persistent_ptr< Y > &  rhs 
)
inlinenoexcept

Greater or equal than operator.

See less than operator for comparison rules.

template<class T >
void nvml::obj::swap ( persistent_ptr< T > &  a,
persistent_ptr< T > &  b 
)
inlinenoexcept

Swaps two persistent_ptr objects of the same type.

Non-member swap function as required by Swappable concept. en.cppreference.com/w/cpp/concept/Swappable