PMDK C++ bindings  1.11.1
This is the C++ bindings documentation for PMDK's libpmemobj.
check_persistent_ptr_array.hpp
Go to the documentation of this file.
1 // SPDX-License-Identifier: BSD-3-Clause
2 /* Copyright 2016-2018, Intel Corporation */
3 
9 #ifndef LIBPMEMOBJ_CPP_CHECK_PERSISTENT_PTR_ARRAY_HPP
10 #define LIBPMEMOBJ_CPP_CHECK_PERSISTENT_PTR_ARRAY_HPP
11 
12 #include <cstddef>
13 
15 
16 namespace pmem
17 {
18 
19 namespace detail
20 {
21 
22 /*
23  * Typedef checking if given type is not an array.
24  */
25 template <typename T>
26 struct pp_if_not_array {
27  typedef obj::persistent_ptr<T> type;
28 };
29 
30 /*
31  * Typedef checking if given type is not an array.
32  */
33 template <typename T>
34 struct pp_if_not_array<T[]> {
35 };
36 
37 /*
38  * Typedef checking if given type is not an array.
39  */
40 template <typename T, size_t N>
41 struct pp_if_not_array<T[N]> {
42 };
43 
44 /*
45  * Typedef checking if given type is an array.
46  */
47 template <typename T>
48 struct pp_if_array;
49 
50 /*
51  * Typedef checking if given type is an array.
52  */
53 template <typename T>
54 struct pp_if_array<T[]> {
55  typedef obj::persistent_ptr<T[]> type;
56 };
57 
58 /*
59  * Typedef checking if given type is an array.
60  */
61 template <typename T>
62 struct pp_if_size_array;
63 
64 /*
65  * Typedef checking if given type is an array.
66  */
67 template <typename T, size_t N>
68 struct pp_if_size_array<T[N]> {
69  typedef obj::persistent_ptr<T[N]> type;
70 };
71 
72 } /* namespace detail */
73 
74 } /* namespace pmem */
75 
76 #endif /* LIBPMEMOBJ_CPP_CHECK_PERSISTENT_PTR_ARRAY_HPP */
pmem
Persistent memory namespace.
Definition: allocation_flag.hpp:15
persistent_ptr.hpp
Persistent smart pointer.