PMDK C++ bindings
1.12-git53.g67ba2be4
This is the C++ bindings documentation for PMDK's libpmemobj.
Main Page
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
m
n
o
p
r
s
t
Functions
a
b
c
d
e
g
m
n
o
p
r
s
t
Typedefs
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
~
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
~
Variables
Typedefs
Enumerations
Related Functions
Files
File List
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Friends
Pages
libpmemobj++
utils.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSD-3-Clause
2
/* Copyright 2016-2019, Intel Corporation */
3
8
#ifndef LIBPMEMOBJ_CPP_UTILS_HPP
9
#define LIBPMEMOBJ_CPP_UTILS_HPP
10
11
#include <
libpmemobj++/persistent_ptr.hpp
>
12
#include <
libpmemobj++/pexceptions.hpp
>
13
#include <libpmemobj/base.h>
14
15
namespace
pmem
16
{
17
18
namespace
obj
19
{
20
30
template
<
typename
T>
31
inline
pool_base
32
pool_by_vptr
(
const
T *that)
33
{
34
auto
pop = pmemobj_pool_by_ptr(that);
35
if
(!pop)
36
throw
pmem::pool_error
(
"Object not in an open pool."
);
37
38
return
pool_base
(pop);
39
}
40
50
template
<
typename
T>
51
inline
pool_base
52
pool_by_pptr
(
const
persistent_ptr<T>
ptr)
53
{
54
auto
pop = pmemobj_pool_by_oid(ptr.raw());
55
if
(!pop)
56
throw
pmem::pool_error
(
"Object not in an open pool."
);
57
58
return
pool_base
(pop);
59
}
60
61
}
/* namespace obj */
62
63
}
/* namespace pmem */
64
65
#endif
/* LIBPMEMOBJ_CPP_UTILS_HPP */
pmem::pool_error
Custom pool error class.
Definition:
pexceptions.hpp:45
pmem
Persistent memory namespace.
Definition:
allocation_flag.hpp:15
pexceptions.hpp
Custom exceptions.
pmem::obj::pool_by_pptr
pool_base pool_by_pptr(const persistent_ptr< T > ptr)
Retrieve pool handle for the given persistent_ptr.
Definition:
utils.hpp:52
pmem::obj::persistent_ptr
Persistent pointer class.
Definition:
persistent_ptr.hpp:152
pmem::obj::pool_by_vptr
pool_base pool_by_vptr(const T *that)
Retrieve pool handle for the given pointer.
Definition:
utils.hpp:32
pmem::obj::pool_base
The non-template pool base class.
Definition:
pool.hpp:46
persistent_ptr.hpp
Persistent smart pointer.
Generated by
1.8.20