PMDK C++ bindings
1.13.0-git23.gf49772ac
This is the C++ bindings documentation for PMDK's libpmemobj.
|
The non-template pool base class. More...
#include <libpmemobj++/pool.hpp>
Public Member Functions | |
pool_base () noexcept | |
Defaulted constructor. | |
pool_base (pmemobjpool *cpop) noexcept | |
Explicit constructor. More... | |
pool_base (const pool_base &) noexcept=default | |
Defaulted copy constructor. | |
pool_base (pool_base &&) noexcept=default | |
Defaulted move constructor. | |
pool_base & | operator= (const pool_base &) noexcept=default |
Defaulted copy assignment operator. | |
pool_base & | operator= (pool_base &&) noexcept=default |
Defaulted move assignment operator. | |
virtual | ~pool_base () noexcept=default |
Default virtual destructor. | |
void | close () |
Closes the pool. More... | |
void | persist (const void *addr, size_t len) noexcept |
Performs persist operation on a given chunk of memory. More... | |
template<typename Y > | |
void | persist (const p< Y > &prop) noexcept |
Performs persist operation on a given pmem property. More... | |
template<typename Y > | |
void | persist (const persistent_ptr< Y > &ptr) noexcept |
Performs persist operation on a given persistent pointer. More... | |
void | flush (const void *addr, size_t len) noexcept |
Performs flush operation on a given chunk of memory. More... | |
template<typename Y > | |
void | flush (const p< Y > &prop) noexcept |
Performs flush operation on a given pmem property. More... | |
template<typename Y > | |
void | flush (const persistent_ptr< Y > &ptr) noexcept |
Performs flush operation on a given persistent object. More... | |
void | drain (void) noexcept |
Performs drain operation. | |
void * | memcpy_persist (void *dest, const void *src, size_t len) noexcept |
Performs memcpy and persist operation on a given chunk of memory. More... | |
void * | memset_persist (void *dest, int c, size_t len) noexcept |
Performs memset and persist operation on a given chunk of memory. More... | |
PMEMobjpool * | handle () noexcept |
Gets the C style handle to the pool. More... | |
pobj_defrag_result | defrag (persistent_ptr_base **ptrv, size_t oidcnt) |
Starts defragmentation using selected pointers within this pool. More... | |
Static Public Member Functions | |
static pool_base | open (const std::string &path, const std::string &layout) |
Opens an existing object store memory pool. More... | |
static pool_base | create (const std::string &path, const std::string &layout, std::size_t size=PMEMOBJ_MIN_POOL, mode_t mode=DEFAULT_MODE) |
Creates a new transactional object store pool. More... | |
static int | check (const std::string &path, const std::string &layout) noexcept |
Checks if a given pool is consistent. More... | |
static pool_base | open (const std::wstring &path, const std::wstring &layout) |
Opens an existing object store memory pool. More... | |
static pool_base | create (const std::wstring &path, const std::wstring &layout, std::size_t size=PMEMOBJ_MIN_POOL, mode_t mode=DEFAULT_MODE) |
Creates a new transactional object store pool. More... | |
static int | check (const std::wstring &path, const std::wstring &layout) noexcept |
Checks if a given pool is consistent. More... | |
Static Protected Attributes | |
static const int | DEFAULT_MODE = S_IWRITE | S_IREAD |
Default create mode. | |
The non-template pool base class.
This class is a non-template version of pool. It is useful for places where providing pool template argument is undesirable. The typical usage example would be:
The exmple of using pool with RAII idiom:
|
inlineexplicitnoexcept |
Explicit constructor.
Create pool_base object based on C-style pool handle.
cpop | C-style pool handle. |
|
inlinestaticnoexcept |
Checks if a given pool is consistent.
path | System path to the file containing the memory pool or a pool set. |
layout | Unique identifier of the pool as specified at pool creation time. |
|
inlinestaticnoexcept |
Checks if a given pool is consistent.
Wide string variant. Available only on Windows.
path | System path to the file containing the memory pool or a pool set. |
layout | Unique identifier of the pool as specified at pool creation time. |
|
inline |
Closes the pool.
std::logic_error | if the pool has already been closed. |
|
inlinestatic |
Creates a new transactional object store pool.
path | System path to the file to be created. If exists the pool can be created in-place depending on the size parameter. Existing file must be zeroed. |
layout | Unique identifier of the pool, can be a null-terminated string. |
size | Size of the pool in bytes. If zero and the file exists the pool is created in-place. |
mode | File mode for the new file. |
pmem::pool_error | when an error during creation occurs. |
|
inlinestatic |
Creates a new transactional object store pool.
Wide string variant. Available only on Windows.
path | System path to the file to be created. If exists the pool can be created in-place depending on the size parameter. Existing file must be zeroed. |
layout | Unique identifier of the pool, can be a null-terminated string. |
size | Size of the pool in bytes. If zero and the file exists the pool is created in-place. |
mode | File mode for the new file. |
pmem::pool_error | when an error during creation occurs. |
|
inline |
Starts defragmentation using selected pointers within this pool.
[in] | ptrv | pointer to contiguous space containing persistent_ptr's for defrag. |
[in] | oidcnt | number of persistent_ptr's passed (in ptrv). |
pmem::defrag_error | when a failure during defragmentation occurs. Even if this error is thrown, some of the objects could have been relocated, see defrag_error.result for summary stats. |
|
inlinenoexcept |
Performs flush operation on a given pmem property.
[in] | prop | Resides on pmem property |
|
inlinenoexcept |
Performs flush operation on a given persistent object.
[in] | ptr | Persistent pointer to object |
|
inlinenoexcept |
Performs flush operation on a given chunk of memory.
[in] | addr | address of memory chunk |
[in] | len | size of memory chunk |
|
inlinenoexcept |
Gets the C style handle to the pool.
Necessary to be able to use the pool with the C API.
|
inlinenoexcept |
Performs memcpy and persist operation on a given chunk of memory.
[in] | dest | destination memory address |
[in] | src | source memory address |
[in] | len | size of memory chunk |
|
inlinenoexcept |
Performs memset and persist operation on a given chunk of memory.
[in] | dest | destination memory address |
[in] | c | constant value to fill the memory |
[in] | len | size of memory chunk |
|
inlinestatic |
Opens an existing object store memory pool.
path | System path to the file containing the memory pool or a pool set. |
layout | Unique identifier of the pool as specified at pool creation time. |
pmem::pool_error | when an error during opening occurs. |
|
inlinestatic |
Opens an existing object store memory pool.
Wide string variant. Available only on Windows.
path | System path to the file containing the memory pool or a pool set. |
layout | Unique identifier of the pool as specified at pool creation time. |
pmem::pool_error | when an error during opening occurs. |
|
inlinenoexcept |
Performs persist operation on a given pmem property.
[in] | prop | Resides on pmem property |
|
inlinenoexcept |
Performs persist operation on a given persistent pointer.
Persist is not performed on the object referenced by this pointer.
[in] | ptr | Persistent pointer to object |
|
inlinenoexcept |
Performs persist operation on a given chunk of memory.
[in] | addr | address of memory chunk |
[in] | len | size of memory chunk |