22 #ifndef vtkTryDowncast_h 23 #define vtkTryDowncast_h 29 #include <boost/mpl/for_each.hpp> 30 #include <boost/mpl/joint_view.hpp> 31 #include <boost/mpl/vector.hpp> 38 typedef boost::mpl::vector<vtkTypeUInt8, vtkTypeInt8, vtkTypeUInt16, vtkTypeInt16, vtkTypeUInt32, vtkTypeInt32, vtkTypeUInt64, vtkTypeInt64, vtkIdType>
vtkIntegerTypes;
44 typedef boost::mpl::joint_view<vtkIntegerTypes, vtkFloatingPointTypes>
vtkNumericTypes;
50 typedef boost::mpl::joint_view<vtkNumericTypes, vtkStringTypes>
vtkAllTypes;
53 template<
template <
typename>
class TargetT,
typename FunctorT>
64 template<
typename ValueT>
70 TargetT<ValueT>*
const target1 = TargetT<ValueT>::SafeDownCast(
Source1);
86 template<
template <
typename>
class TargetT,
typename FunctorT>
98 template<
typename ValueT>
104 TargetT<ValueT>*
const target1 = TargetT<ValueT>::SafeDownCast(
Source1);
105 TargetT<ValueT>*
const target2 = TargetT<ValueT>::SafeDownCast(Source2);
106 if(target1 && target2)
109 this->
Functor(target1, target2);
122 template<
template <
typename>
class TargetT,
typename FunctorT>
135 template<
typename ValueT>
141 TargetT<ValueT>*
const target1 = TargetT<ValueT>::SafeDownCast(
Source1);
142 TargetT<ValueT>*
const target2 = TargetT<ValueT>::SafeDownCast(Source2);
143 TargetT<ValueT>*
const target3 = TargetT<ValueT>::SafeDownCast(Source3);
144 if(target1 && target2 && target3)
147 this->
Functor(target1, target2, target3);
161 template<
template <
typename>
class TargetT,
typename TypesT,
typename FunctorT>
164 bool succeeded =
false;
169 template<
template <
typename>
class TargetT,
typename TypesT,
typename FunctorT>
172 bool succeeded =
false;
178 template<
template <
typename>
class TargetT,
typename TypesT,
typename FunctorT>
181 bool succeeded =
false;
boost::mpl::joint_view< vtkIntegerTypes, vtkFloatingPointTypes > vtkNumericTypes
vtkTryDowncastHelper2(vtkObject *source1, vtkObject *source2, FunctorT functor, bool &succeeded)
void operator()(ValueT) const
abstract base class for most VTK objects
vtkTryDowncastHelper3(vtkObject *source1, vtkObject *source2, vtkObject *source3, FunctorT functor, bool &succeeded)
boost::mpl::vector< vtkTypeUInt8, vtkTypeInt8, vtkTypeUInt16, vtkTypeInt16, vtkTypeUInt32, vtkTypeInt32, vtkTypeUInt64, vtkTypeInt64, vtkIdType > vtkIntegerTypes
vtkTryDowncastHelper1(vtkObject *source1, FunctorT functor, bool &succeeded)
boost::mpl::joint_view< vtkNumericTypes, vtkStringTypes > vtkAllTypes
bool vtkTryDowncast(vtkObject *source1, FunctorT functor)
boost::mpl::vector< vtkTypeFloat32, vtkTypeFloat64 > vtkFloatingPointTypes
void operator()(ValueT) const
void operator()(ValueT) const
boost::mpl::vector< vtkStdString, vtkUnicodeString > vtkStringTypes