|
| pool () noexcept=default |
| Defaulted constructor.
|
|
| pool (const pool &) noexcept=default |
| Defaulted copy constructor.
|
|
| pool (pool &&) noexcept=default |
| Defaulted move constructor.
|
|
pool & | operator= (const pool &) noexcept=default |
| Defaulted copy assignment operator.
|
|
pool & | operator= (pool &&) noexcept=default |
| Defaulted move assignment operator.
|
|
| ~pool () noexcept=default |
| Default destructor.
|
|
| pool (const pool_base &pb) noexcept |
| Defaulted copy constructor.
|
|
| pool (pool_base &&pb) noexcept |
| Defaulted move constructor.
|
|
template<typename M > |
M | ctl_get (const std::string &name) |
| Query libpmemobj state at pool scope. More...
|
|
template<typename M > |
M | ctl_set (const std::string &name, M arg) |
| Modify libpmemobj state at pool scope. More...
|
|
template<typename M > |
M | ctl_exec (const std::string &name, M arg) |
| Execute function at pool scope. More...
|
|
template<typename M > |
M | ctl_get (const std::wstring &name) |
| Query libpmemobj state at pool scope. More...
|
|
template<typename M > |
M | ctl_set (const std::wstring &name, M arg) |
| Modify libpmemobj state at pool scope. More...
|
|
template<typename M > |
M | ctl_exec (const std::wstring &name, M arg) |
| Execute function at pool scope. More...
|
|
persistent_ptr< T > | root () |
| Retrieves pool's root object. More...
|
|
POBJ_CPP_DEPRECATED persistent_ptr< T > | get_root () |
|
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_CPP_DEPRECATED PMEMobjpool * | get_handle () noexcept |
|
pobj_defrag_result | defrag (persistent_ptr_base **ptrv, size_t oidcnt) |
| Starts defragmentation using selected pointers within this pool. More...
|
|
|
static pool< T > | open (const std::string &path, const std::string &layout) |
| Opens an existing object store memory pool. More...
|
|
static pool< T > | 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) |
| Checks if a given pool is consistent. More...
|
|
static pool< T > | open (const std::wstring &path, const std::wstring &layout) |
| Opens an existing object store memory pool. More...
|
|
static pool< T > | 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) |
| Checks if a given pool is consistent. More...
|
|
template<typename T>
class pmem::obj::pool< T >
PMEMobj pool class.
This class is the pmemobj pool handler. It provides basic primitives for operations on pmemobj pools. The template parameter defines the type of the root object within the pool. This pool class inherits also some methods from the base class: pmem::obj::pool_base.
The typical usage example would be:
#include <fcntl.h>
void
pool_example()
{
p<int> some_array[42];
p<int> some_other_array[42];
p<double> some_variable;
};
pop.close();
auto root_obj = pop.root();
root_obj->some_variable = 3.2;
pop.persist(root_obj->some_variable);
pop.memset_persist(root_obj->some_array, 2,
sizeof(root_obj->some_array));
pop.memcpy_persist(root_obj->some_other_array, root_obj->some_array,
sizeof(root_obj->some_array));
pop.close();
}
static pool< T > open(const std::string &path, const std::string &layout)
Opens an existing object store memory pool.
Definition: pool.hpp:672
static int check(const std::string &path, const std::string &layout)
Checks if a given pool is consistent.
Definition: pool.hpp:711
persistent_ptr< T > root()
Retrieves pool's root object.
Definition: pool.hpp:644
static pool< T > 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.
Definition: pool.hpp:694
Main libpmemobj namespace.
Definition: allocation_flag.hpp:18
Resides on pmem property template.
Persistent smart pointer.
This API should not be mixed with C API. For example explicitly calling pmemobj_set_user_data(pop) on pool which is handled by C++ pool object is undefined behaviour.