38 #ifndef LIBPMEMOBJ_CPP_CTL_HPP
39 #define LIBPMEMOBJ_CPP_CTL_HPP
41 #include <libpmemobj.h>
57 ctl_get_detail(PMEMobjpool *pool,
const std::string &name)
62 int ret = pmemobj_ctl_getU(pool, name.c_str(), &tmp);
64 int ret = pmemobj_ctl_get(pool, name.c_str(), &tmp);
67 throw ctl_error(strerror(errno));
74 ctl_set_detail(PMEMobjpool *pool,
const std::string &name, T arg)
77 int ret = pmemobj_ctl_setU(pool, name.c_str(), &arg);
79 int ret = pmemobj_ctl_set(pool, name.c_str(), &arg);
82 throw ctl_error(strerror(errno));
89 ctl_exec_detail(PMEMobjpool *pool,
const std::string &name, T arg)
92 int ret = pmemobj_ctl_execU(pool, name.c_str(), &arg);
94 int ret = pmemobj_ctl_exec(pool, name.c_str(), &arg);
97 throw ctl_error(strerror(errno));
103 template <
typename T>
105 ctl_get_detail(PMEMobjpool *pool,
const std::wstring &name)
109 int ret = pmemobj_ctl_getW(pool, name.c_str(), &tmp);
111 throw ctl_error(strerror(errno));
116 template <
typename T>
118 ctl_set_detail(PMEMobjpool *pool,
const std::wstring &name, T arg)
120 int ret = pmemobj_ctl_setW(pool, name.c_str(), &arg);
122 throw ctl_error(strerror(errno));
127 template <
typename T>
129 ctl_exec_detail(PMEMobjpool *pool,
const std::wstring &name, T arg)
131 int ret = pmemobj_ctl_execW(pool, name.c_str(), &arg);
133 throw ctl_error(strerror(errno));