SimpleITK  
sitkDualMemberFunctionFactory.h
Go to the documentation of this file.
1 /*=========================================================================
2 *
3 * Copyright NumFOCUS
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::simple::detail
26 {
27 
28 
59 template <typename TMemberFunctionPointer>
61  : protected MemberFunctionFactoryBase<TMemberFunctionPointer, std::tuple<unsigned int, int, unsigned int, int> >
62 {
63 
64 public:
65 
68 
69  using MemberFunctionType = TMemberFunctionPointer;
70  using ObjectType = typename ::detail::FunctionTraits<MemberFunctionType>::ClassType;
71  using FunctionObjectType = typename Superclass::FunctionObjectType;
72 
76 
80  template< typename TImageType1, typename TImageType2 >
81  void Register( MemberFunctionType pfunc, TImageType1*, TImageType2* );
82 
120  template < typename TPixelIDTypeList1,
121  typename TPixelIDTypeList2,
122  unsigned int VImageDimension,
123  typename TAddressor >
124  void RegisterMemberFunctions( );
125  template < typename TPixelIDTypeList1,
126  typename TPixelIDTypeList2,
127  unsigned int VImageDimension >
129  {
131  this->RegisterMemberFunctions< TPixelIDTypeList1, TPixelIDTypeList2, VImageDimension, AddressorType>();
132  }
133 
134  template < typename TPixelIDTypeList,
135  unsigned int VImageDimension,
136  typename TAddressor >
137  void RegisterMemberFunctions( );
138  template < typename TPixelIDTypeList,
139  unsigned int VImageDimension >
141  {
143  this->RegisterMemberFunctions< TPixelIDTypeList, VImageDimension, AddressorType>();
144  }
150  bool HasMemberFunction( PixelIDValueType pixelID1,
151  PixelIDValueType pixelID2,
152  unsigned int imageDimension ) const noexcept;
153 
154 
174  FunctionObjectType GetMemberFunction( PixelIDValueType pixelID1, PixelIDValueType pixelID2, unsigned int imageDimension );
175 
176 protected:
177 
179 
180 };
181 
182 }
183 
184 #include "sitkDualMemberFunctionFactory.hxx"
185 
186 #endif // sitkDualMemberFunctionFactory_h
itk::simple::detail::DualMemberFunctionFactory::RegisterMemberFunctions
void RegisterMemberFunctions()
Registers the member functions for all combinations of TPixelIDTypeList1 and PixelIDTypeList2.
Definition: sitkDualMemberFunctionFactory.h:128
itk::simple::detail::DualMemberFunctionFactory::Register
void Register(MemberFunctionType pfunc, TImageType1 *, TImageType2 *)
Registers a specific member function.
itk::simple::detail::DualMemberFunctionFactory
A class used to instantiate and generate function objects of templated member functions with two temp...
Definition: sitkDualMemberFunctionFactory.h:60
itk::simple::detail
Definition: sitkDetail.h:24
itk::simple::detail::DualMemberFunctionFactory::HasMemberFunction
bool HasMemberFunction(PixelIDValueType pixelID1, PixelIDValueType pixelID2, unsigned int imageDimension) const noexcept
Query to determine if an member function has been registered for pixelID1, pixelID2 and imageDimensio...
sitkDetail.h
sitkMemberFunctionFactoryBase.h
itk::simple::detail::DualMemberFunctionFactory::GetMemberFunction
FunctionObjectType GetMemberFunction(PixelIDValueType pixelID1, PixelIDValueType pixelID2, unsigned int imageDimension)
Returns a function object for the combination of PixelID1 and PixelID2, and image dimension.
itk::simple::detail::DualMemberFunctionFactory::RegisterMemberFunctions
void RegisterMemberFunctions()
Registers the member functions for all combinations of TPixelIDTypeList1 and PixelIDTypeList2.
Definition: sitkDualMemberFunctionFactory.h:140
itk::simple::detail::DualMemberFunctionFactory::ObjectType
typename ::detail::FunctionTraits< MemberFunctionType >::ClassType ObjectType
Definition: sitkDualMemberFunctionFactory.h:70
itk::simple::detail::DualMemberFunctionFactory::m_ObjectPointer
ObjectType * m_ObjectPointer
Definition: sitkDualMemberFunctionFactory.h:178
itk::simple::detail::DualMemberFunctionFactory< MemberFunctionType >::FunctionObjectType
typename Superclass::FunctionObjectType FunctionObjectType
Definition: sitkDualMemberFunctionFactory.h:71
itk::simple::detail::DualExecuteInternalAddressor
Definition: sitkDetail.h:40
itk::simple::detail::DualMemberFunctionFactory::DualMemberFunctionFactory
DualMemberFunctionFactory(ObjectType *pObject)
Constructor which permanently binds the constructed object to pObject.
itk::simple::detail::DualMemberFunctionFactory< MemberFunctionType >::MemberFunctionType
MemberFunctionType MemberFunctionType
Definition: sitkDualMemberFunctionFactory.h:69
itk::simple::PixelIDValueType
int PixelIDValueType
Definition: sitkPixelIDValues.h:30
itk::simple::detail::DualMemberFunctionFactory::RegisterMemberFunctions
void RegisterMemberFunctions()
Registers the member functions for all combinations of TPixelIDTypeList1 and PixelIDTypeList2.
itk::simple::detail::MemberFunctionFactoryBase
A base class for the MemberFunctionFactory.
Definition: sitkMemberFunctionFactoryBase.h:96