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  using Superclass =
68 
69  using MemberFunctionType = TMemberFunctionPointer;
70  using ObjectType = typename ::detail::FunctionTraits<MemberFunctionType>::ClassType;
72 
76 
80  template <typename TImageType1, typename TImageType2>
81  void
82  Register(MemberFunctionType pfunc, TImageType1 *, TImageType2 *);
83 
121  template <typename TPixelIDTypeList1, typename TPixelIDTypeList2, unsigned int VImageDimension, typename TAddressor>
122  void
124  template <typename TPixelIDTypeList1, typename TPixelIDTypeList2, unsigned int VImageDimension>
125  void
127  {
129  this->RegisterMemberFunctions<TPixelIDTypeList1, TPixelIDTypeList2, VImageDimension, AddressorType>();
130  }
131 
132  template <typename TPixelIDTypeList, unsigned int VImageDimension, typename TAddressor>
133  void
135  template <typename TPixelIDTypeList, unsigned int VImageDimension>
136  void
138  {
140  this->RegisterMemberFunctions<TPixelIDTypeList, VImageDimension, AddressorType>();
141  }
147  bool
148  HasMemberFunction(PixelIDValueType pixelID1, PixelIDValueType pixelID2, unsigned int imageDimension) const noexcept;
149 
150 
171  GetMemberFunction(PixelIDValueType pixelID1, PixelIDValueType pixelID2, unsigned int imageDimension);
172 
173 protected:
175 };
176 
177 } // namespace itk::simple::detail
178 
179 #include "sitkDualMemberFunctionFactory.hxx"
180 
181 #endif // sitkDualMemberFunctionFactory_h
itk::simple::detail::DualMemberFunctionFactory::RegisterMemberFunctions
void RegisterMemberFunctions()
Registers the member functions for all combinations of TPixelIDTypeList1 and PixelIDTypeList2.
Definition: sitkDualMemberFunctionFactory.h:126
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::MemberFunctionFactoryBase< TMemberFunctionPointer, std::tuple< unsigned int, int, unsigned int, int > >::FunctionObjectType
typename ::detail::FunctionTraits< MemberFunctionType >::FunctionObjectType FunctionObjectType
Definition: sitkMemberFunctionFactoryBase.h:101
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:137
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:174
itk::simple::detail::DualMemberFunctionFactory< MemberFunctionType >::FunctionObjectType
typename Superclass::FunctionObjectType FunctionObjectType
Definition: sitkDualMemberFunctionFactory.h:71
itk::simple::detail::DualExecuteInternalAddressor
Definition: sitkDetail.h:42
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
Definition: sitkMemberFunctionFactoryBase.h:86