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
25namespace itk::simple::detail
26{
27
28
59template <typename TMemberFunctionPointer>
61 : protected MemberFunctionFactoryBase<TMemberFunctionPointer, std::tuple<unsigned int, int, unsigned int, int>>
62{
63
64public:
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
131
132 template <typename TPixelIDTypeList, unsigned int VImageDimension, typename TAddressor>
133 void
135 template <typename TPixelIDTypeList, unsigned int VImageDimension>
136 void
142
143
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
173protected:
175};
176
177} // namespace itk::simple::detail
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.
void RegisterMemberFunctions()
Registers the member functions for all combinations of TPixelIDTypeList1 and PixelIDTypeList2.
DualMemberFunctionFactory(ObjectType *pObject)
Constructor which permanently binds the constructed object to pObject.
void RegisterMemberFunctions()
Registers the member functions for all combinations of TPixelIDTypeList1 and PixelIDTypeList2.
MemberFunctionFactoryBase< TMemberFunctionPointer, std::tuple< unsigned int, int, unsigned int, int > > Superclass
typename ::detail::FunctionTraits< MemberFunctionType >::ClassType ObjectType
typename Superclass::FunctionObjectType FunctionObjectType
void RegisterMemberFunctions()
Registers the member functions for all combinations of TPixelIDTypeList1 and PixelIDTypeList2.
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...
void Register(MemberFunctionType pfunc, TImageType1 *, TImageType2 *)
Registers a specific member function.