go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkOpenCLGlobal.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright UMC Utrecht and contributors
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkOpenCLGlobal_h
19#define itkOpenCLGlobal_h
20
21#include <memory>
22
23namespace itk
24{
25template <typename T>
26static inline T *
28{
29 return ptr;
30}
31template <typename TObjectType>
32static inline typename std::unique_ptr<TObjectType>::element_type *
33OpenCLGetPtrHelper(const std::unique_ptr<TObjectType> & p)
34{
35 return p.get();
36}
37
38#define ITK_OPENCL_DECLARE_PRIVATE(Class) \
39 inline Class##Pimpl * d_func() { return reinterpret_cast<Class##Pimpl *>(OpenCLGetPtrHelper(d_ptr)); } \
40 inline const Class##Pimpl * d_func() const \
41 { \
42 return reinterpret_cast<const Class##Pimpl *>(OpenCLGetPtrHelper(d_ptr)); \
43 } \
44 friend class Class##Pimpl;
45
46#define ITK_OPENCL_DECLARE_PRIVATE_D(Dptr, Class) \
47 inline Class##Pimpl * d_func() { return reinterpret_cast<Class##Pimpl *>(Dptr); } \
48 inline const Class##Pimpl * d_func() const { return reinterpret_cast<const Class##Pimpl *>(Dptr); } \
49 friend class Class##Pimpl;
50
51#define ITK_OPENCL_DECLARE_PUBLIC(Class) \
52 inline Class * q_func() { return static_cast<Class *>(q_ptr); } \
53 inline const Class * q_func() const { return static_cast<const Class *>(q_ptr); } \
54 friend class Class;
55
56#define ITK_OPENCL_D(Class) Class##Pimpl * const d = d_func()
57#define ITK_OPENCL_Q(Class) Class * const q = q_func()
58} // end namespace itk
59
60#endif /* itkOpenCLGlobal_h */
static T * OpenCLGetPtrHelper(T *ptr)


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo