SimpleITK  1.3.0.dev466
sitkDualMemberFunctionFactory.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 sitkDualMemberFunctionFactory_h
19 #define sitkDualMemberFunctionFactory_h
20 
21 #include "sitkDetail.h"
23 
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 {
32 
33 
64 template <typename TMemberFunctionPointer>
66  : protected MemberFunctionFactoryBase<TMemberFunctionPointer, std::pair<int, int> >
67 {
68 
69 public:
70 
73 
74  typedef TMemberFunctionPointer MemberFunctionType;
75  typedef typename ::detail::FunctionTraits<MemberFunctionType>::ClassType ObjectType;
76  typedef typename Superclass::FunctionObjectType FunctionObjectType;
77 
80  DualMemberFunctionFactory( ObjectType *pObject );
81 
85  template< typename TImageType1, typename TImageType2 >
86  void Register( MemberFunctionType pfunc, TImageType1*, TImageType2* );
87 
125  template < typename TPixelIDTypeList1,
126  typename TPixelIDTypeList2,
127  unsigned int VImageDimension,
128  typename TAddressor >
129  void RegisterMemberFunctions( void );
130  template < typename TPixelIDTypeList1,
131  typename TPixelIDTypeList2,
132  unsigned int VImageDimension >
134  {
136  this->RegisterMemberFunctions< TPixelIDTypeList1, TPixelIDTypeList2, VImageDimension, AddressorType>();
137  }
143  bool HasMemberFunction( PixelIDValueType pixelID1,
144  PixelIDValueType pixelID2,
145  unsigned int imageDimension ) const SITK_NOEXCEPT;
146 
147 
167  FunctionObjectType GetMemberFunction( PixelIDValueType pixelID1, PixelIDValueType pixelID2, unsigned int imageDimension );
168 
169 protected:
170 
171  ObjectType *m_ObjectPointer;
172 
173 };
174 
175 } // end namespace detail
176 } // end namespace simple
177 } // end namespace itk
178 
179 #include "sitkDualMemberFunctionFactory.hxx"
180 
181 #endif // sitkDualMemberFunctionFactory_h
FunctionObjectType GetMemberFunction(PixelIDValueType pixelID1, PixelIDValueType pixelID2, unsigned int imageDimension)
Returns a function object for the combination of PixelID1 and PixelID2, and image dimension...
A class used to instantiate and generate function objects of templated member functions with two temp...
void RegisterMemberFunctions(void)
Registers the member functions for all combinations of TPixelIDTypeList1 and PixelIDTypeList2.
MemberFunctionFactoryBase< TMemberFunctionPointer, std::pair< int, int > > Superclass
::detail::FunctionTraits< MemberFunctionType >::ClassType ObjectType
void RegisterMemberFunctions(void)
Registers the member functions for all combinations of TPixelIDTypeList1 and PixelIDTypeList2.
bool HasMemberFunction(PixelIDValueType pixelID1, PixelIDValueType pixelID2, unsigned int imageDimension) const SITK_NOEXCEPT
Query to determine if an member function has been registered for pixelID1, pixelID2 and imageDimensio...
DualMemberFunctionFactory(ObjectType *pObject)
Constructor which permanently binds the constructed object to pObject.
#define SITK_NOEXCEPT
Definition: sitkMacro.h:68
A base class for the MemberFunctionFactory.
void Register(MemberFunctionType pfunc, TImageType1 *, TImageType2 *)
Registers a specific member function.