11 #ifndef _LIBALCOMMON_ALCOMMON_ALFUNCTOR_H_
12 #define _LIBALCOMMON_ALCOMMON_ALFUNCTOR_H_
15 # include <boost/shared_ptr.hpp>
48 #include <alcommon/detail/alfunctorwithreturn.h>
49 #include <alcommon/detail/alfunctorwithoutreturn.h>
54 template <
typename C,
typename R>
55 boost::shared_ptr<ALFunctorBase> createFunctor(C *obj, R (C::*f) ()) {
56 return boost::shared_ptr<ALFunctorBase> (
new detail::ALFunctor_0<C, R>(obj, f));
59 template <
typename C,
typename P1,
typename R>
60 boost::shared_ptr<ALFunctorBase> createFunctor(C *obj, R (C::*f) (
const P1 &)) {
61 return boost::shared_ptr<ALFunctorBase>(
new detail::ALFunctor_1<C, P1, R>(obj, f));
64 template <
typename C,
typename P1,
typename P2,
typename R>
65 boost::shared_ptr<ALFunctorBase> createFunctor(C *obj, R (C::*f) (
const P1 &,
const P2 &)) {
66 return boost::shared_ptr<ALFunctorBase>(
new detail::ALFunctor_2<C, P1, P2, R>(obj, f));
69 template <
typename C,
typename P1,
typename P2,
typename P3,
typename R>
70 boost::shared_ptr<ALFunctorBase> createFunctor(C *obj, R (C::*f) (
const P1 &,
const P2 &,
const P3 &)) {
71 return boost::shared_ptr<ALFunctorBase>(
new detail::ALFunctor_3<C, P1, P2, P3, R>(obj, f));
74 template <
typename C,
typename P1,
typename P2,
typename P3,
typename P4,
typename R>
75 boost::shared_ptr<ALFunctorBase> createFunctor(C *obj, R (C::*f) (
const P1 &,
const P2 &,
const P3 &,
const P4 &)) {
76 return boost::shared_ptr<ALFunctorBase>(
new detail::ALFunctor_4<C, P1, P2, P3, P4, R>(obj, f));
79 template <
typename C,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename R>
80 boost::shared_ptr<ALFunctorBase> createFunctor(C *obj, R (C::*f) (
const P1 &,
const P2 &,
const P3 &,
const P4 &,
const P5 &)) {
81 return boost::shared_ptr<ALFunctorBase>(
new detail::ALFunctor_5<C, P1, P2, P3, P4, P5, R>(obj, f));
84 template <
typename C,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename R>
85 boost::shared_ptr<ALFunctorBase> createFunctor(C *obj, R (C::*f) (
const P1 &,
const P2 &,
const P3 &,
const P4 &,
const P5 &,
const P6 &)) {
86 return boost::shared_ptr<ALFunctorBase>(
new detail::ALFunctor_6<C, P1, P2, P3, P4, P5, P6, R>(obj, f));
91 #endif // _LIBALCOMMON_ALCOMMON_ALFUNCTOR_H_