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,
60 typename TContainer = std::unordered_map<std::tuple<unsigned int, int, unsigned int, int>,
61 TMemberFunctionPointer,
64 : protected MemberFunctionFactoryBase<TMemberFunctionPointer,
65 std::tuple<unsigned int, int, unsigned int, int>,
66 TContainer>
67{
68
69public:
70 using Superclass =
73
74 using MemberFunctionType = TMemberFunctionPointer;
75 using ObjectType = typename ::detail::FunctionTraits<MemberFunctionType>::ClassType;
77
81
84
88 template <typename TImageType1, typename TImageType2>
89 void
90 Register(MemberFunctionType pfunc, TImageType1 *, TImageType2 *);
91
129 template <typename TPixelIDTypeList1, typename TPixelIDTypeList2, unsigned int VImageDimension, typename TAddressor>
130 void
132 template <typename TPixelIDTypeList1, typename TPixelIDTypeList2, unsigned int VImageDimension>
133 void
139
140 template <typename TPixelIDTypeList, unsigned int VImageDimension, typename TAddressor>
141 void
143 template <typename TPixelIDTypeList, unsigned int VImageDimension>
144 void
150
151
155 bool
156 HasMemberFunction(PixelIDValueType pixelID1, PixelIDValueType pixelID2, unsigned int imageDimension) const noexcept;
157
158
185 PixelIDValueType pixelID2,
186 unsigned int imageDimension,
187 ObjectType * objectPointer) const;
188};
189
190} // namespace itk::simple::detail
191
192#include "sitkDualMemberFunctionFactory.hxx"
193
194#endif // sitkDualMemberFunctionFactory_h
void Register(MemberFunctionType pfunc, TImageType1 *, TImageType2 *)
Registers a specific member function.
typename ::detail::FunctionTraits< MemberFunctionType >::ClassType ObjectType
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 RegisterMemberFunctions()
Registers the member functions for all combinations of TPixelIDTypeList1 and PixelIDTypeList2.
DualMemberFunctionFactory()=default
Constructor which permanently binds the constructed object to pObject.
FunctionObjectType GetMemberFunction(PixelIDValueType pixelID1, PixelIDValueType pixelID2, unsigned int imageDimension, ObjectType *objectPointer) const
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.
void RegisterMemberFunctions()
Registers the member functions for all combinations of TPixelIDTypeList1 and PixelIDTypeList2.
MemberFunctionFactoryBase< TMemberFunctionPointer, std::tuple< unsigned int, int, unsigned int, int >, TContainer > Superclass
typename Superclass::FunctionObjectType FunctionObjectType