Skip to content
Snippets Groups Projects
Commit 415c6219 authored by Julien Michel's avatar Julien Michel
Browse files

ENH: Add macro and SFINAE to enable the old-style setters

parent 21ec65b5
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,26 @@ public:
this->SetNthInput(I,inputPtr);
}
#define DefineLegacySetInputMacro(n) \
template<typename Tuple = InputTypesTupleType, typename std::enable_if<n<=std::tuple_size<Tuple>::value >::type> \
void SetInput ## n(typename std::tuple_element<n-1,Tuple>::type * img) \
{ \
this->SetVInput<n-1>(img); \
}
// The following defines legacy setters SetInput1()
// ... SetInput10(), only if the number of input type is sufficient
DefineLegacySetInputMacro(1);
DefineLegacySetInputMacro(2);
DefineLegacySetInputMacro(3);
DefineLegacySetInputMacro(4);
DefineLegacySetInputMacro(5);
DefineLegacySetInputMacro(6);
DefineLegacySetInputMacro(7);
DefineLegacySetInputMacro(8);
DefineLegacySetInputMacro(9);
DefineLegacySetInputMacro(10);
template <std::size_t I> const typename std::tuple_element<I,InputTypesTupleType>::type * GetVInput()
{
using ImageType = typename std::tuple_element<I,InputTypesTupleType>::type;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment