29#if defined(PointFunctorHolder_RECURSES)
30#error Recursive header files inclusion detected in PointFunctorHolder.h
33#define PointFunctorHolder_RECURSES
35#if !defined PointFunctorHolder_h
37#define PointFunctorHolder_h
45#include "DGtal/base/FunctorHolder.h"
117 typename std::enable_if<!std::is_base_of<PointFunctorHolder, typename std::decay<Function>::type>::value,
int>::type = 0
144 out <<
"[PointFunctorHolder] holding a " <<
myFunctor;
171template <
typename TPo
int,
typename TValue,
typename TFunctor>
175 object.selfDisplay(out);
221 typename std::decay<decltype(aFunctor(std::declval<TPoint>()))>::type,
222 decltype(
holdFunctor(std::forward<TFunctor>(aFunctor)))
227 typename std::decay<decltype(aFunctor(std::declval<TPoint>()))>::type,
228 decltype(
holdFunctor(std::forward<TFunctor>(aFunctor)))
229 >{
holdFunctor(std::forward<TFunctor>(aFunctor)) };
237#undef PointFunctorHolder_RECURSES
Aim: hold any object callable on points as a DGtal::concepts::CPointFunctor model.
void selfDisplay(std::ostream &out) const
Writes/Displays the object on an output stream.
constexpr bool isValid() const
Checks the validity/consistency of the object.
PointFunctorHolder(Function &&fn)
Constructor.
Value operator()(Point const &aPoint) const
Evaluates the functor at the given point.
Functor myFunctor
The held functor.
std::ostream & operator<<(std::ostream &out, const FunctorHolder< FunctorStorage, NeedDereference > &object)
Overloads 'operator<<' for displaying objects of class FunctorHolder.
auto holdPointFunctor(TFunctor &&aFunctor) -> PointFunctorHolder< TPoint, TValue, decltype(holdFunctor(std::forward< TFunctor >(aFunctor)))>
PointFunctorHolder construction helper with specification of the return type.
auto holdFunctor(Function &&fn) -> decltype(holdFunctorImpl(std::forward< Function >(fn), typename std::is_lvalue_reference< Function >{}))
Hold any callable object (function, functor, lambda, ...) as a C(Unary)Functor model.
DGtal is the top-level namespace which contains all DGtal functions and types.