SimpleITK  1.1.0
sitkMemberFunctionFactory.h
Go to the documentation of this file.
1 /*=========================================================================
2 *
3 * Copyright Insight Software Consortium
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 sitkMemberFunctionFactory_h
19 #define sitkMemberFunctionFactory_h
20 
21 #include "sitkDetail.h"
23 #include "sitkPixelIDValues.h"
24 
25 namespace itk
26 {
27 namespace simple
28 {
29 // this namespace is internal classes not part of the external simple ITK interface
30 namespace detail {
31 
54 template <typename TMemberFunctionPointer>
56  : protected MemberFunctionFactoryBase<TMemberFunctionPointer, int>
57 {
58 
59 public:
60 
63 
64  typedef TMemberFunctionPointer MemberFunctionType;
65  typedef typename ::detail::FunctionTraits<MemberFunctionType>::ClassType ObjectType;
66  typedef typename Superclass::FunctionObjectType FunctionObjectType;
67 
71 
77  template< typename TImageType >
78  void Register( MemberFunctionType pfunc, TImageType* );
79 
115  template < typename TPixelIDTypeList,
116  unsigned int VImageDimension,
117  typename TAddressor >
118  void RegisterMemberFunctions( void );
119  template < typename TPixelIDTypeList, unsigned int VImageDimension >
121  {
123  this->RegisterMemberFunctions< TPixelIDTypeList, VImageDimension, AddressorType >();
124  }
130  bool HasMemberFunction( PixelIDValueType pixelID, unsigned int imageDimension ) const SITK_NOEXCEPT;
131 
151  FunctionObjectType GetMemberFunction( PixelIDValueType pixelID, unsigned int imageDimension );
152 
153 protected:
154 
156 
157 };
158 
159 } // end namespace detail
160 } // end namespace simple
161 } // end namespace itk
162 
163 #include "sitkMemberFunctionFactory.hxx"
164 
165 #endif // sitkMemberFunctionFactory_h
itk::simple::detail::MemberFunctionFactory::FunctionObjectType
Superclass::FunctionObjectType FunctionObjectType
Definition: sitkMemberFunctionFactory.h:66
itk::simple::PixelIDValueType
int PixelIDValueType
Definition: sitkPixelIDValues.h:32
itk::simple::detail::MemberFunctionFactory::Register
void Register(MemberFunctionType pfunc, TImageType *)
Registers a specific member function.
itk::simple::detail::MemberFunctionAddressor
Definition: sitkDetail.h:32
SITK_NOEXCEPT
#define SITK_NOEXCEPT
Definition: sitkMacro.h:68
itk::simple::detail::MemberFunctionFactory::Self
MemberFunctionFactory Self
Definition: sitkMemberFunctionFactory.h:62
itk::simple::detail::MemberFunctionFactory::GetMemberFunction
FunctionObjectType GetMemberFunction(PixelIDValueType pixelID, unsigned int imageDimension)
Returns a function object for the PixelIndex, and image dimension.
itk::simple::detail::MemberFunctionFactory
A class used to instantiate and generate function object to templated member functions.
Definition: sitkMemberFunctionFactory.h:55
itk::simple::detail::MemberFunctionFactory::HasMemberFunction
bool HasMemberFunction(PixelIDValueType pixelID, unsigned int imageDimension) const SITK_NOEXCEPT
Query to determine if an member function has been registered for pixelID and imageDimension.
sitkDetail.h
sitkMemberFunctionFactoryBase.h
sitkPixelIDValues.h
itk::simple::detail::MemberFunctionFactory::RegisterMemberFunctions
void RegisterMemberFunctions(void)
Registers all member functions in TPixelIDTypeList and simple::InstantiatedPixelIDTypeList over itk::...
Definition: sitkMemberFunctionFactory.h:120
itk::simple::detail::MemberFunctionFactory::m_ObjectPointer
ObjectType * m_ObjectPointer
Definition: sitkMemberFunctionFactory.h:155
itk
itk::simple::detail::MemberFunctionFactory::Superclass
MemberFunctionFactoryBase< TMemberFunctionPointer, int > Superclass
Definition: sitkMemberFunctionFactory.h:61
itk::simple::detail::MemberFunctionFactory::ObjectType
::detail::FunctionTraits< MemberFunctionType >::ClassType ObjectType
Definition: sitkMemberFunctionFactory.h:65
itk::simple::detail::MemberFunctionFactory::MemberFunctionFactory
MemberFunctionFactory(ObjectType *pObject)
Constructor which permanently binds the constructed object to pObject.
itk::simple::detail::MemberFunctionFactoryBase
A base class for the MemberFunctionFactory.
Definition: sitkMemberFunctionFactoryBase.h:67
itk::simple::detail::MemberFunctionFactory::MemberFunctionType
TMemberFunctionPointer MemberFunctionType
Definition: sitkMemberFunctionFactory.h:64
itk::simple::detail::MemberFunctionFactory::RegisterMemberFunctions
void RegisterMemberFunctions(void)
Registers all member functions in TPixelIDTypeList and simple::InstantiatedPixelIDTypeList over itk::...