12 #ifdef DNA_DEPRECATED_ALLOW
14 # define DNA_DEPRECATED
16 # ifndef DNA_DEPRECATED
18 # define DNA_DEPRECATED __attribute__((deprecated))
21 # define DNA_DEPRECATED
27 # define DNA_PRIVATE_ATTR __attribute__((deprecated))
29 # define DNA_PRIVATE_ATTR
33 #ifdef DNA_DEPRECATED_ALLOW
34 # define DNA_DEPRECATED_GCC_POISON 0
38 # define DNA_DEPRECATED_GCC_POISON 1
40 # define DNA_DEPRECATED_GCC_POISON 0
45 #include "../blenlib/BLI_sys_types.h"
64 # define DNA_DEFINE_CXX_METHODS(class_name)
72 namespace blender::dna::internal {
74 template<
class T>
class ShallowDataConstRef {
76 constexpr
explicit ShallowDataConstRef(
const T &ref) : ref_(ref)
80 inline const T *get_pointer()
const
89 class ShallowZeroInitializeTag {
94 # define DNA_DEFINE_CXX_METHODS(class_name) \
95 class_name() = default; \
96 ~class_name() = default; \
98 class_name(const class_name &other) = delete; \
99 class_name(class_name &&other) noexcept = delete; \
100 class_name &operator=(const class_name &other) = delete; \
101 class_name &operator=(class_name &&other) = delete; \
104 class_name(const blender::dna::internal::ShallowDataConstRef<class_name> ref) : class_name() \
106 _DNA_internal_memcpy(this, ref.get_pointer(), sizeof(class_name)); \
108 class_name &operator=(const blender::dna::internal::ShallowDataConstRef<class_name> ref) \
110 if (this != ref.get_pointer()) { \
111 _DNA_internal_memcpy(this, ref.get_pointer(), sizeof(class_name)); \
116 class_name(const blender::dna::internal::ShallowZeroInitializeTag ) : class_name() \
118 _DNA_internal_memzero(this, sizeof(class_name)); \
120 class_name &operator=(const blender::dna::internal::ShallowZeroInitializeTag ) \
122 _DNA_internal_memzero(this, sizeof(class_name)); \
126 namespace blender::dna {
137 [[nodiscard]]
inline internal::ShallowDataConstRef<T> shallow_copy(
const T &other)
139 return internal::ShallowDataConstRef(other);
144 [[nodiscard]]
inline internal::ShallowZeroInitializeTag shallow_zero_initialize()
146 return internal::ShallowZeroInitializeTag();
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SyclQueue void void * src
void _DNA_internal_memzero(void *dst, size_t size)
void _DNA_internal_memcpy(void *dst, const void *src, size_t size)