9 #ifndef LIBPMEMOBJ_CPP_PEXCEPTIONS_HPP
10 #define LIBPMEMOBJ_CPP_PEXCEPTIONS_HPP
14 #include <system_error>
17 #include <libpmemobj/atomic_base.h>
18 #include <libpmemobj/base.h>
49 template <
typename ExcT,
size_t... I,
typename Tuple>
53 static_assert(std::is_rvalue_reference<decltype(args)>::value,
54 "args should be rvalue reference!");
56 auto msg = std::get<
sizeof...(I)>(std::move(args)) +
std::string(
": ") +
58 return ExcT(std::get<I>(std::move(args))..., std::move(msg));
67 template <
class ExcT,
typename... Args>
71 return exception_with_errormsg_helper<ExcT>(
72 make_index_sequence<
sizeof...(Args) - 1>{},
73 std::forward_as_tuple(std::forward<Args>(args)...));
86 using std::runtime_error::runtime_error;
99 using pool_error::pool_error;
111 using std::runtime_error::runtime_error;
123 using std::system_error::system_error;
134 using transaction_error::transaction_error;
144 public std::bad_alloc {
146 using transaction_alloc_error::transaction_alloc_error;
147 using transaction_alloc_error::what;
158 using transaction_alloc_error::transaction_alloc_error;
169 using std::logic_error::logic_error;
180 using std::runtime_error::runtime_error;
191 using std::runtime_error::runtime_error;
202 using std::runtime_error::runtime_error;
214 using std::runtime_error::runtime_error;
Custom ctl error class.
Definition: pexceptions.hpp:200
Custom defrag error class.
Definition: pexceptions.hpp:212
pobj_defrag_result result
Results of the defragmentation run.
Definition: pexceptions.hpp:233
defrag_error(pobj_defrag_result result, const std::string &msg)
Construct error with partial results.
Definition: pexceptions.hpp:222
Custom layout error class.
Definition: pexceptions.hpp:189
Custom lock error class.
Definition: pexceptions.hpp:121
Custom transaction error class.
Definition: pexceptions.hpp:178
Custom pool error class.
Definition: pexceptions.hpp:84
Custom pool error class.
Definition: pexceptions.hpp:97
Custom transaction error class.
Definition: pexceptions.hpp:132
Custom transaction error class.
Definition: pexceptions.hpp:109
Custom transaction error class.
Definition: pexceptions.hpp:156
Custom out of memory error class.
Definition: pexceptions.hpp:144
Custom transaction error class.
Definition: pexceptions.hpp:167
basic_string< char > string
The most typical string usage - the char specialization.
Definition: string.hpp:24
Create c++14 style index sequence.
ExcT exception_with_errormsg_helper(index_sequence< I... >, Tuple &&args)
Helper for exception_with_errormsg.
Definition: pexceptions.hpp:51
ExcT exception_with_errormsg(Args &&... args)
Generic error message decorator for pmemobj-based exceptions.
Definition: pexceptions.hpp:69
std::string errormsg(void)
Return last libpmemobj error message as a std::string.
Definition: pexceptions.hpp:32
Persistent memory namespace.
Definition: allocation_flag.hpp:15