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 
23 namespace itk
24 {
25 template< typename T >
26 static inline T *
27 OpenCLGetPtrHelper( T * ptr ) { return ptr; }
28 template< typename TObjectType >
29 static inline typename std::auto_ptr< TObjectType >::element_type * OpenCLGetPtrHelper(
30  const std::auto_ptr< TObjectType > &p )
31 {
32  return p.get();
33 }
34 
35 #define ITK_OPENCL_DECLARE_PRIVATE( Class ) \
36  inline Class ## Pimpl * d_func() \
37  { \
38  return reinterpret_cast< Class ## Pimpl * >( OpenCLGetPtrHelper( d_ptr ) ); \
39  } \
40  inline const Class ## Pimpl * d_func() const { return reinterpret_cast< const Class ## Pimpl * >( OpenCLGetPtrHelper( \
41  d_ptr ) ); } \
42  friend class Class ## Pimpl;
43 
44 #define ITK_OPENCL_DECLARE_PRIVATE_D( Dptr, Class ) \
45  inline Class ## Pimpl * d_func() \
46  { \
47  return reinterpret_cast< Class ## Pimpl * >( Dptr ); \
48  } \
49  inline const Class ## Pimpl * d_func() const { return reinterpret_cast< const Class ## Pimpl * >( Dptr ); } \
50  friend class Class ## Pimpl;
51 
52 #define ITK_OPENCL_DECLARE_PUBLIC( Class ) \
53  inline Class * q_func() \
54  { \
55  return static_cast< Class * >( q_ptr ); \
56  } \
57  inline const Class * q_func() const { return static_cast< const Class * >( q_ptr ); } \
58  friend class Class;
59 
60 #define ITK_OPENCL_D( Class ) Class ## Pimpl * const d = d_func()
61 #define ITK_OPENCL_Q( Class ) Class * const q = q_func()
62 } // end namespace itk
63 
64 #endif /* __itkOpenCLGlobal_h */
static T * OpenCLGetPtrHelper(T *ptr)


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo