SimpleITK  1.0.1
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 
26 namespace itk
27 {
28 namespace simple
29 {
30 // this namespace is internal classes not part of the external simple ITK interface
31 namespace detail
32 {
33 
34 
35 
66 template <typename TMemberFunctionPointer>
68  : protected MemberFunctionFactoryBase<TMemberFunctionPointer, std::pair<int, int> >
69 {
70 
71 public:
72 
75 
76  typedef TMemberFunctionPointer MemberFunctionType;
77  typedef typename ::detail::FunctionTraits<MemberFunctionType>::ClassType ObjectType;
78  typedef typename Superclass::FunctionObjectType FunctionObjectType;
79 
82  DualMemberFunctionFactory( ObjectType *pObject );
83 
87  template< typename TImageType1, typename TImageType2 >
88  void Register( MemberFunctionType pfunc, TImageType1*, TImageType2* );
89 
127  template < typename TPixelIDTypeList1,
128  typename TPixelIDTypeList2,
129  unsigned int VImageDimension,
130  typename TAddressor >
131  void RegisterMemberFunctions( void );
132  template < typename TPixelIDTypeList1,
133  typename TPixelIDTypeList2,
134  unsigned int VImageDimension >
136  {
138  this->RegisterMemberFunctions< TPixelIDTypeList1, TPixelIDTypeList2, VImageDimension, AddressorType>();
139  }
145  bool HasMemberFunction( PixelIDValueType pixelID1,
146  PixelIDValueType pixelID2,
147  unsigned int imageDimension ) const throw();
148 
149 
169  FunctionObjectType GetMemberFunction( PixelIDValueType pixelID1, PixelIDValueType pixelID2, unsigned int imageDimension );
170 
171 protected:
172 
173  ObjectType *m_ObjectPointer;
174 
175 };
176 
177 } // end namespace detail
178 } // end namespace simple
179 } // end namespace itk
180 
181 #include "sitkDualMemberFunctionFactory.hxx"
182 
183 #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...
bool HasMemberFunction(PixelIDValueType pixelID1, PixelIDValueType pixelID2, unsigned int imageDimension) const
Query to determine if an member function has been registered for pixelID1, pixelID2 and imageDimensio...
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.
DualMemberFunctionFactory(ObjectType *pObject)
Constructor which permanently binds the constructed object to pObject.
A base class for the MemberFunctionFactory.
void Register(MemberFunctionType pfunc, TImageType1 *, TImageType2 *)
Registers a specific member function.