Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/consolecommands3/src/libraries/core/command/Functor.h @ 7213

Last change on this file since 7213 was 7213, checked in by landauf, 14 years ago

small changes in Functor, removed specialization for FunctorStatic (FunctorMember<void>) to gain cast-ability to FunctorPointer<F>

  • Property svn:eol-style set to native
File size: 38.3 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Fabian 'x3n' Landau
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#ifndef _Functor_H__
30#define _Functor_H__
31
32#include <typeinfo>
33
34#include "core/CorePrereqs.h"
35
36#include "util/Debug.h"
37#include "util/MultiType.h"
38#include "FunctorPtr.h"
39
40namespace orxonox
41{
42    const unsigned int MAX_FUNCTOR_ARGUMENTS = 5;
43
44    template <class T>
45    inline std::string _typeToString() { return "unknown"; }
46
47    template <> inline std::string _typeToString<void>()               { return ""; }
48    template <> inline std::string _typeToString<int>()                { return "int"; }
49    template <> inline std::string _typeToString<unsigned int>()       { return "uint"; }
50    template <> inline std::string _typeToString<char>()               { return "char"; }
51    template <> inline std::string _typeToString<unsigned char>()      { return "uchar"; }
52    template <> inline std::string _typeToString<short>()              { return "short"; }
53    template <> inline std::string _typeToString<unsigned short>()     { return "ushort"; }
54    template <> inline std::string _typeToString<long>()               { return "long"; }
55    template <> inline std::string _typeToString<unsigned long>()      { return "ulong"; }
56    template <> inline std::string _typeToString<long long>()          { return "longlong"; }
57    template <> inline std::string _typeToString<unsigned long long>() { return "ulonglong"; }
58    template <> inline std::string _typeToString<float>()              { return "float"; }
59    template <> inline std::string _typeToString<double>()             { return "double"; }
60    template <> inline std::string _typeToString<long double>()        { return "longdouble"; }
61    template <> inline std::string _typeToString<bool>()               { return "bool"; }
62    template <> inline std::string _typeToString<std::string>()        { return "string"; }
63    template <> inline std::string _typeToString<Vector2>()            { return "Vector2"; }
64    template <> inline std::string _typeToString<Vector3>()            { return "Vector3"; }
65    template <> inline std::string _typeToString<Quaternion>()         { return "Quaternion"; }
66    template <> inline std::string _typeToString<ColourValue>()        { return "ColourValue"; }
67    template <> inline std::string _typeToString<Radian>()             { return "Radian"; }
68    template <> inline std::string _typeToString<Degree>()             { return "Degree"; }
69
70    template <class T>
71    inline std::string typeToString() { return _typeToString<typename Loki::TypeTraits<T>::UnqualifiedReferredType>(); }
72
73    class _CoreExport Functor
74    {
75        public:
76            struct Type
77            {
78                enum Enum
79                {
80                    Static,
81                    Member
82                };
83            };
84
85        public:
86            virtual MultiType operator()(const MultiType& param1 = MT_Type::Null, const MultiType& param2 = MT_Type::Null, const MultiType& param3 = MT_Type::Null, const MultiType& param4 = MT_Type::Null, const MultiType& param5 = MT_Type::Null) = 0;
87
88            virtual Type::Enum getType() const = 0;
89            virtual unsigned int getParamCount() const = 0;
90            virtual bool hasReturnvalue() const = 0;
91
92            virtual std::string getTypenameParam(unsigned int param) const = 0;
93            virtual std::string getTypenameReturnvalue() const = 0;
94
95            virtual void evaluateParam(unsigned int index, MultiType& param) const = 0;
96
97            virtual void setRawObjectPointer(void* object) {}
98            virtual void* getRawObjectPointer() const { return 0; }
99
100            template <class F>
101            inline bool setFunction(F* function)
102            {
103                if (this->getFullIdentifier() == typeid(F*))
104                {
105                    modifyFunctor(this, function);
106                    return true;
107                }
108                return false;
109            }
110
111            virtual const std::type_info& getFullIdentifier() const = 0;
112            virtual const std::type_info& getHeaderIdentifier() const = 0;
113    };
114
115    namespace detail
116    {
117        template <class O>
118        struct FunctorTypeStatic
119        { enum { result = false }; };
120        template <>
121        struct FunctorTypeStatic<void>
122        { enum { result = true }; };
123    }
124
125    template <class O>
126    class FunctorMember : public Functor
127    {
128        public:
129            FunctorMember(O* object = 0) : object_(object) {}
130
131            virtual MultiType operator()(O* object, const MultiType& param1 = MT_Type::Null, const MultiType& param2 = MT_Type::Null, const MultiType& param3 = MT_Type::Null, const MultiType& param4 = MT_Type::Null, const MultiType& param5 = MT_Type::Null) = 0;
132
133            MultiType operator()(const MultiType& param1 = MT_Type::Null, const MultiType& param2 = MT_Type::Null, const MultiType& param3 = MT_Type::Null, const MultiType& param4 = MT_Type::Null, const MultiType& param5 = MT_Type::Null)
134            {
135                if (detail::FunctorTypeStatic<O>::result || this->object_)
136                    return (*this)(this->object_, param1, param2, param3, param4, param5);
137                else
138                {
139                    COUT(1) << "Error: Can't execute FunctorMember, no object set." << std::endl;
140                    return MT_Type::Null;
141                }
142            }
143
144            Functor::Type::Enum getType() const
145                { return detail::FunctorTypeStatic<O>::result ? Functor::Type::Static : Functor::Type::Member; }
146
147            inline void setObject(O* object)
148                { this->object_ = object;}
149            inline O* getObject() const
150                { return this->object_; }
151
152            inline void setRawObjectPointer(void* object)
153                { this->object_ = (O*)object; }
154            inline void* getRawObjectPointer() const
155                { return this->object_; }
156
157        protected:
158            O* object_;
159    };
160
161    typedef FunctorMember<void> FunctorStatic;
162
163    template <class F, class O = void>
164    class FunctorPointer : public FunctorMember<O>
165    {
166        public:
167            FunctorPointer(F functionPointer, O* object = 0) : FunctorMember<O>(object), functionPointer_(functionPointer) {}
168
169            inline void setFunction(F functionPointer)
170                { this->functionPointer_ = functionPointer; }
171            inline F getFunction() const
172                { return this->functionPointer_; }
173
174            const std::type_info& getFullIdentifier() const
175                { return typeid(F); }
176
177        protected:
178            F functionPointer_;
179    };
180
181    namespace detail
182    {
183        template <class R, class O, bool isconst, class P1, class P2, class P3, class P4, class P5> struct FunctionPointer                                            { typedef R (O::*Type)(P1, P2, P3, P4, P5); };
184        template <class R, class O, class P1, class P2, class P3, class P4, class P5>               struct FunctionPointer<R, O, false, P1, P2, P3, P4, P5>           { typedef R (O::*Type)(P1, P2, P3, P4, P5); };
185        template <class R, class O, class P1, class P2, class P3, class P4>                         struct FunctionPointer<R, O, false, P1, P2, P3, P4, void>         { typedef R (O::*Type)(P1, P2, P3, P4); };
186        template <class R, class O, class P1, class P2, class P3>                                   struct FunctionPointer<R, O, false, P1, P2, P3, void, void>       { typedef R (O::*Type)(P1, P2, P3); };
187        template <class R, class O, class P1, class P2>                                             struct FunctionPointer<R, O, false, P1, P2, void, void, void>     { typedef R (O::*Type)(P1, P2); };
188        template <class R, class O, class P1>                                                       struct FunctionPointer<R, O, false, P1, void, void, void, void>   { typedef R (O::*Type)(P1); };
189        template <class R, class O>                                                                 struct FunctionPointer<R, O, false, void, void, void, void, void> { typedef R (O::*Type)(); };
190        template <class R, class O, class P1, class P2, class P3, class P4, class P5> struct FunctionPointer<R, O, true, P1, P2, P3, P4, P5>           { typedef R (O::*Type)(P1, P2, P3, P4, P5) const; };
191        template <class R, class O, class P1, class P2, class P3, class P4>           struct FunctionPointer<R, O, true, P1, P2, P3, P4, void>         { typedef R (O::*Type)(P1, P2, P3, P4) const; };
192        template <class R, class O, class P1, class P2, class P3>                     struct FunctionPointer<R, O, true, P1, P2, P3, void, void>       { typedef R (O::*Type)(P1, P2, P3) const; };
193        template <class R, class O, class P1, class P2>                               struct FunctionPointer<R, O, true, P1, P2, void, void, void>     { typedef R (O::*Type)(P1, P2) const; };
194        template <class R, class O, class P1>                                         struct FunctionPointer<R, O, true, P1, void, void, void, void>   { typedef R (O::*Type)(P1) const; };
195        template <class R, class O>                                                   struct FunctionPointer<R, O, true, void, void, void, void, void> { typedef R (O::*Type)() const; };
196        template <class R, class P1, class P2, class P3, class P4, class P5> struct FunctionPointer<R, void, false, P1, P2, P3, P4, P5>           { typedef R (*Type)(P1, P2, P3, P4, P5); };
197        template <class R, class P1, class P2, class P3, class P4>           struct FunctionPointer<R, void, false, P1, P2, P3, P4, void>         { typedef R (*Type)(P1, P2, P3, P4); };
198        template <class R, class P1, class P2, class P3>                     struct FunctionPointer<R, void, false, P1, P2, P3, void, void>       { typedef R (*Type)(P1, P2, P3); };
199        template <class R, class P1, class P2>                               struct FunctionPointer<R, void, false, P1, P2, void, void, void>     { typedef R (*Type)(P1, P2); };
200        template <class R, class P1>                                         struct FunctionPointer<R, void, false, P1, void, void, void, void>   { typedef R (*Type)(P1); };
201        template <class R>                                                   struct FunctionPointer<R, void, false, void, void, void, void, void> { typedef R (*Type)(); };
202
203        template <class R, class O, bool isconst, class P1, class P2, class P3, class P4, class P5> struct FunctorCaller                                              { static inline MultiType call(typename detail::FunctionPointer<R, O, isconst, P1, P2, P3, P4, P5>::Type functionPointer, O* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { return (object->*functionPointer)(param1, param2, param3, param4, param5); } };
204        template <class R, class O, bool isconst, class P1, class P2, class P3, class P4>           struct FunctorCaller<R, O, isconst, P1, P2, P3, P4, void>         { static inline MultiType call(typename detail::FunctionPointer<R, O, isconst, P1, P2, P3, P4, void>::Type functionPointer, O* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { return (object->*functionPointer)(param1, param2, param3, param4); } };
205        template <class R, class O, bool isconst, class P1, class P2, class P3>                     struct FunctorCaller<R, O, isconst, P1, P2, P3, void, void>       { static inline MultiType call(typename detail::FunctionPointer<R, O, isconst, P1, P2, P3, void, void>::Type functionPointer, O* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { return (object->*functionPointer)(param1, param2, param3); } };
206        template <class R, class O, bool isconst, class P1, class P2>                               struct FunctorCaller<R, O, isconst, P1, P2, void, void, void>     { static inline MultiType call(typename detail::FunctionPointer<R, O, isconst, P1, P2, void, void, void>::Type functionPointer, O* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { return (object->*functionPointer)(param1, param2); } };
207        template <class R, class O, bool isconst, class P1>                                         struct FunctorCaller<R, O, isconst, P1, void, void, void, void>   { static inline MultiType call(typename detail::FunctionPointer<R, O, isconst, P1, void, void, void, void>::Type functionPointer, O* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { return (object->*functionPointer)(param1); } };
208        template <class R, class O, bool isconst>                                                   struct FunctorCaller<R, O, isconst, void, void, void, void, void> { static inline MultiType call(typename detail::FunctionPointer<R, O, isconst, void, void, void, void, void>::Type functionPointer, O* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { return (object->*functionPointer)(); } };
209        template <class O, bool isconst, class P1, class P2, class P3, class P4, class P5> struct FunctorCaller<void, O, isconst, P1, P2, P3, P4, P5>           { static inline MultiType call(typename detail::FunctionPointer<void, O, isconst, P1, P2, P3, P4, P5>::Type functionPointer, O* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { (object->*functionPointer)(param1, param2, param3, param4, param5); return MT_Type::Null; } };
210        template <class O, bool isconst, class P1, class P2, class P3, class P4>           struct FunctorCaller<void, O, isconst, P1, P2, P3, P4, void>         { static inline MultiType call(typename detail::FunctionPointer<void, O, isconst, P1, P2, P3, P4, void>::Type functionPointer, O* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { (object->*functionPointer)(param1, param2, param3, param4); return MT_Type::Null; } };
211        template <class O, bool isconst, class P1, class P2, class P3>                     struct FunctorCaller<void, O, isconst, P1, P2, P3, void, void>       { static inline MultiType call(typename detail::FunctionPointer<void, O, isconst, P1, P2, P3, void, void>::Type functionPointer, O* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { (object->*functionPointer)(param1, param2, param3); return MT_Type::Null; } };
212        template <class O, bool isconst, class P1, class P2>                               struct FunctorCaller<void, O, isconst, P1, P2, void, void, void>     { static inline MultiType call(typename detail::FunctionPointer<void, O, isconst, P1, P2, void, void, void>::Type functionPointer, O* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { (object->*functionPointer)(param1, param2); return MT_Type::Null; } };
213        template <class O, bool isconst, class P1>                                         struct FunctorCaller<void, O, isconst, P1, void, void, void, void>   { static inline MultiType call(typename detail::FunctionPointer<void, O, isconst, P1, void, void, void, void>::Type functionPointer, O* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { (object->*functionPointer)(param1); return MT_Type::Null; } };
214        template <class O, bool isconst>                                                   struct FunctorCaller<void, O, isconst, void, void, void, void, void> { static inline MultiType call(typename detail::FunctionPointer<void, O, isconst, void, void, void, void, void>::Type functionPointer, O* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { (object->*functionPointer)(); return MT_Type::Null; } };
215        template <class R, bool isconst, class P1, class P2, class P3, class P4, class P5> struct FunctorCaller<R, void, isconst, P1, P2, P3, P4, P5>           { static inline MultiType call(typename detail::FunctionPointer<R, void, isconst, P1, P2, P3, P4, P5>::Type functionPointer, void*, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { return (*functionPointer)(param1, param2, param3, param4, param5); } };
216        template <class R, bool isconst, class P1, class P2, class P3, class P4>           struct FunctorCaller<R, void, isconst, P1, P2, P3, P4, void>         { static inline MultiType call(typename detail::FunctionPointer<R, void, isconst, P1, P2, P3, P4, void>::Type functionPointer, void*, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { return (*functionPointer)(param1, param2, param3, param4); } };
217        template <class R, bool isconst, class P1, class P2, class P3>                     struct FunctorCaller<R, void, isconst, P1, P2, P3, void, void>       { static inline MultiType call(typename detail::FunctionPointer<R, void, isconst, P1, P2, P3, void, void>::Type functionPointer, void*, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { return (*functionPointer)(param1, param2, param3); } };
218        template <class R, bool isconst, class P1, class P2>                               struct FunctorCaller<R, void, isconst, P1, P2, void, void, void>     { static inline MultiType call(typename detail::FunctionPointer<R, void, isconst, P1, P2, void, void, void>::Type functionPointer, void*, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { return (*functionPointer)(param1, param2); } };
219        template <class R, bool isconst, class P1>                                         struct FunctorCaller<R, void, isconst, P1, void, void, void, void>   { static inline MultiType call(typename detail::FunctionPointer<R, void, isconst, P1, void, void, void, void>::Type functionPointer, void*, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { return (*functionPointer)(param1); } };
220        template <class R, bool isconst>                                                   struct FunctorCaller<R, void, isconst, void, void, void, void, void> { static inline MultiType call(typename detail::FunctionPointer<R, void, isconst, void, void, void, void, void>::Type functionPointer, void*, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { return (*functionPointer)(); } };
221        template <bool isconst, class P1, class P2, class P3, class P4, class P5> struct FunctorCaller<void, void, isconst, P1, P2, P3, P4, P5>           { static inline MultiType call(typename detail::FunctionPointer<void, void, isconst, P1, P2, P3, P4, P5>::Type functionPointer, void*, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { (*functionPointer)(param1, param2, param3, param4, param5); return MT_Type::Null; } };
222        template <bool isconst, class P1, class P2, class P3, class P4>           struct FunctorCaller<void, void, isconst, P1, P2, P3, P4, void>         { static inline MultiType call(typename detail::FunctionPointer<void, void, isconst, P1, P2, P3, P4, void>::Type functionPointer, void*, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { (*functionPointer)(param1, param2, param3, param4); return MT_Type::Null; } };
223        template <bool isconst, class P1, class P2, class P3>                     struct FunctorCaller<void, void, isconst, P1, P2, P3, void, void>       { static inline MultiType call(typename detail::FunctionPointer<void, void, isconst, P1, P2, P3, void, void>::Type functionPointer, void*, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { (*functionPointer)(param1, param2, param3); return MT_Type::Null; } };
224        template <bool isconst, class P1, class P2>                               struct FunctorCaller<void, void, isconst, P1, P2, void, void, void>     { static inline MultiType call(typename detail::FunctionPointer<void, void, isconst, P1, P2, void, void, void>::Type functionPointer, void*, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { (*functionPointer)(param1, param2); return MT_Type::Null; } };
225        template <bool isconst, class P1>                                         struct FunctorCaller<void, void, isconst, P1, void, void, void, void>   { static inline MultiType call(typename detail::FunctionPointer<void, void, isconst, P1, void, void, void, void>::Type functionPointer, void*, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { (*functionPointer)(param1); return MT_Type::Null; } };
226        template <bool isconst>                                                   struct FunctorCaller<void, void, isconst, void, void, void, void, void> { static inline MultiType call(typename detail::FunctionPointer<void, void, isconst, void, void, void, void, void>::Type functionPointer, void*, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { (*functionPointer)(); return MT_Type::Null; } };
227
228        template <class R, class P1, class P2, class P3, class P4, class P5>
229        struct FunctorHeaderIdentifier
230        {};
231
232        template <class T>
233        struct FunctorHasReturnvalue
234        { enum { result = true }; };
235        template <>
236        struct FunctorHasReturnvalue<void>
237        { enum { result = false }; };
238
239        template <class P1, class P2, class P3, class P4, class P5>
240        struct FunctorParamCount
241        { enum { result = 5 }; };
242        template <class P1, class P2, class P3, class P4>
243        struct FunctorParamCount<P1, P2, P3, P4, void>
244        { enum { result = 4 }; };
245        template <class P1, class P2, class P3>
246        struct FunctorParamCount<P1, P2, P3, void, void>
247        { enum { result = 3 }; };
248        template <class P1, class P2>
249        struct FunctorParamCount<P1, P2, void, void, void>
250        { enum { result = 2 }; };
251        template <class P1>
252        struct FunctorParamCount<P1, void, void, void, void>
253        { enum { result = 1 }; };
254        template <>
255        struct FunctorParamCount<void, void, void, void, void>
256        { enum { result = 0 }; };
257    }
258
259    template <class R, class O, bool isconst, class P1, class P2, class P3, class P4, class P5>
260    class FunctorTemplate : public FunctorPointer<typename detail::FunctionPointer<R, O, isconst, P1, P2, P3, P4, P5>::Type, O>
261    {
262        public:
263            FunctorTemplate(typename detail::FunctionPointer<R, O, isconst, P1, P2, P3, P4, P5>::Type functionPointer, O* object = 0) : FunctorPointer<typename detail::FunctionPointer<R, O, isconst, P1, P2, P3, P4, P5>::Type, O>(functionPointer, object) {}
264
265            MultiType operator()(O* object, const MultiType& param1 = MT_Type::Null, const MultiType& param2 = MT_Type::Null, const MultiType& param3 = MT_Type::Null, const MultiType& param4 = MT_Type::Null, const MultiType& param5 = MT_Type::Null)
266            {
267                return detail::FunctorCaller<R, O, isconst, P1, P2, P3, P4, P5>::call(this->functionPointer_, object, param1, param2, param3, param4, param5);
268            }
269
270            void evaluateParam(unsigned int index, MultiType& param) const
271            {
272                switch (index)
273                {
274                    case 0: param.convert<P1>(); break;
275                    case 1: param.convert<P2>(); break;
276                    case 2: param.convert<P3>(); break;
277                    case 3: param.convert<P4>(); break;
278                    case 4: param.convert<P5>(); break;
279                }
280            }
281
282            unsigned int getParamCount() const
283            {
284                return detail::FunctorParamCount<P1, P2, P3, P4, P5>::result;
285            }
286
287            bool hasReturnvalue() const
288            {
289                return detail::FunctorHasReturnvalue<R>::result;
290            }
291
292            std::string getTypenameParam(unsigned int param) const
293            {
294                switch (param)
295                {
296                    case 0: return typeToString<P1>();
297                    case 1: return typeToString<P2>();
298                    case 2: return typeToString<P3>();
299                    case 3: return typeToString<P4>();
300                    case 4: return typeToString<P5>();
301                    default: return "";
302                }
303            }
304
305            std::string getTypenameReturnvalue() const
306            {
307                return typeToString<R>();
308            }
309
310            const std::type_info& getHeaderIdentifier() const
311            {
312                return typeid(detail::FunctorHeaderIdentifier<R, P1, P2, P3, P4, P5>);
313            }
314    };
315
316    template <class R, class O, class OO, class P1, class P2, class P3, class P4, class P5> SharedChildPtr<FunctorTemplate<R, O, false, P1, P2, P3, P4, P5>,           FunctorPointerPtr<typename detail::FunctionPointer<R, O, false, P1, P2, P3, P4, P5>::Type, O> >           createFunctor(R (O::*functionPointer)(P1, P2, P3, P4, P5), OO* object) { return new FunctorTemplate<R, O, false, P1, P2, P3, P4, P5>(functionPointer, object); }
317    template <class R, class O, class OO, class P1, class P2, class P3, class P4>           SharedChildPtr<FunctorTemplate<R, O, false, P1, P2, P3, P4, void>,         FunctorPointerPtr<typename detail::FunctionPointer<R, O, false, P1, P2, P3, P4, void>::Type, O> >         createFunctor(R (O::*functionPointer)(P1, P2, P3, P4), OO* object)     { return new FunctorTemplate<R, O, false, P1, P2, P3, P4, void>(functionPointer, object); }
318    template <class R, class O, class OO, class P1, class P2, class P3>                     SharedChildPtr<FunctorTemplate<R, O, false, P1, P2, P3, void, void>,       FunctorPointerPtr<typename detail::FunctionPointer<R, O, false, P1, P2, P3, void, void>::Type, O> >       createFunctor(R (O::*functionPointer)(P1, P2, P3), OO* object)         { return new FunctorTemplate<R, O, false, P1, P2, P3, void, void>(functionPointer, object); }
319    template <class R, class O, class OO, class P1, class P2>                               SharedChildPtr<FunctorTemplate<R, O, false, P1, P2, void, void, void>,     FunctorPointerPtr<typename detail::FunctionPointer<R, O, false, P1, P2, void, void, void>::Type, O> >     createFunctor(R (O::*functionPointer)(P1, P2), OO* object)             { return new FunctorTemplate<R, O, false, P1, P2, void, void, void>(functionPointer, object); }
320    template <class R, class O, class OO, class P1>                                         SharedChildPtr<FunctorTemplate<R, O, false, P1, void, void, void, void>,   FunctorPointerPtr<typename detail::FunctionPointer<R, O, false, P1, void, void, void, void>::Type, O> >   createFunctor(R (O::*functionPointer)(P1), OO* object)                 { return new FunctorTemplate<R, O, false, P1, void, void, void, void>(functionPointer, object); }
321    template <class R, class O, class OO>                                                   SharedChildPtr<FunctorTemplate<R, O, false, void, void, void, void, void>, FunctorPointerPtr<typename detail::FunctionPointer<R, O, false, void, void, void, void, void>::Type, O> > createFunctor(R (O::*functionPointer)(), OO* object)                   { return new FunctorTemplate<R, O, false, void, void, void, void, void>(functionPointer, object); }
322    template <class R, class O, class OO, class P1, class P2, class P3, class P4, class P5> SharedChildPtr<FunctorTemplate<R, O, true, P1, P2, P3, P4, P5>,           FunctorPointerPtr<typename detail::FunctionPointer<R, O, true, P1, P2, P3, P4, P5>::Type, O> >           createFunctor(R (O::*functionPointer)(P1, P2, P3, P4, P5) const, OO* object) { return new FunctorTemplate<R, O, true, P1, P2, P3, P4, P5>(functionPointer, object); }
323    template <class R, class O, class OO, class P1, class P2, class P3, class P4>           SharedChildPtr<FunctorTemplate<R, O, true, P1, P2, P3, P4, void>,         FunctorPointerPtr<typename detail::FunctionPointer<R, O, true, P1, P2, P3, P4, void>::Type, O> >         createFunctor(R (O::*functionPointer)(P1, P2, P3, P4) const, OO* object)     { return new FunctorTemplate<R, O, true, P1, P2, P3, P4, void>(functionPointer, object); }
324    template <class R, class O, class OO, class P1, class P2, class P3>                     SharedChildPtr<FunctorTemplate<R, O, true, P1, P2, P3, void, void>,       FunctorPointerPtr<typename detail::FunctionPointer<R, O, true, P1, P2, P3, void, void>::Type, O> >       createFunctor(R (O::*functionPointer)(P1, P2, P3) const, OO* object)         { return new FunctorTemplate<R, O, true, P1, P2, P3, void, void>(functionPointer, object); }
325    template <class R, class O, class OO, class P1, class P2>                               SharedChildPtr<FunctorTemplate<R, O, true, P1, P2, void, void, void>,     FunctorPointerPtr<typename detail::FunctionPointer<R, O, true, P1, P2, void, void, void>::Type, O> >     createFunctor(R (O::*functionPointer)(P1, P2) const, OO* object)             { return new FunctorTemplate<R, O, true, P1, P2, void, void, void>(functionPointer, object); }
326    template <class R, class O, class OO, class P1>                                         SharedChildPtr<FunctorTemplate<R, O, true, P1, void, void, void, void>,   FunctorPointerPtr<typename detail::FunctionPointer<R, O, true, P1, void, void, void, void>::Type, O> >   createFunctor(R (O::*functionPointer)(P1) const, OO* object)                 { return new FunctorTemplate<R, O, true, P1, void, void, void, void>(functionPointer, object); }
327    template <class R, class O, class OO>                                                   SharedChildPtr<FunctorTemplate<R, O, true, void, void, void, void, void>, FunctorPointerPtr<typename detail::FunctionPointer<R, O, true, void, void, void, void, void>::Type, O> > createFunctor(R (O::*functionPointer)() const, OO* object)                   { return new FunctorTemplate<R, O, true, void, void, void, void, void>(functionPointer, object); }
328
329    template <class R, class O, class P1, class P2, class P3, class P4, class P5> SharedChildPtr<FunctorTemplate<R, O, false, P1, P2, P3, P4, P5>,           FunctorPointerPtr<typename detail::FunctionPointer<R, O, false, P1, P2, P3, P4, P5>::Type, O> >           createFunctor(R (O::*functionPointer)(P1, P2, P3, P4, P5)) { return new FunctorTemplate<R, O, false, P1, P2, P3, P4, P5>(functionPointer); }
330    template <class R, class O, class P1, class P2, class P3, class P4>           SharedChildPtr<FunctorTemplate<R, O, false, P1, P2, P3, P4, void>,         FunctorPointerPtr<typename detail::FunctionPointer<R, O, false, P1, P2, P3, P4, void>::Type, O> >         createFunctor(R (O::*functionPointer)(P1, P2, P3, P4))     { return new FunctorTemplate<R, O, false, P1, P2, P3, P4, void>(functionPointer); }
331    template <class R, class O, class P1, class P2, class P3>                     SharedChildPtr<FunctorTemplate<R, O, false, P1, P2, P3, void, void>,       FunctorPointerPtr<typename detail::FunctionPointer<R, O, false, P1, P2, P3, void, void>::Type, O> >       createFunctor(R (O::*functionPointer)(P1, P2, P3))         { return new FunctorTemplate<R, O, false, P1, P2, P3, void, void>(functionPointer); }
332    template <class R, class O, class P1, class P2>                               SharedChildPtr<FunctorTemplate<R, O, false, P1, P2, void, void, void>,     FunctorPointerPtr<typename detail::FunctionPointer<R, O, false, P1, P2, void, void, void>::Type, O> >     createFunctor(R (O::*functionPointer)(P1, P2))             { return new FunctorTemplate<R, O, false, P1, P2, void, void, void>(functionPointer); }
333    template <class R, class O, class P1>                                         SharedChildPtr<FunctorTemplate<R, O, false, P1, void, void, void, void>,   FunctorPointerPtr<typename detail::FunctionPointer<R, O, false, P1, void, void, void, void>::Type, O> >   createFunctor(R (O::*functionPointer)(P1))                 { return new FunctorTemplate<R, O, false, P1, void, void, void, void>(functionPointer); }
334    template <class R, class O>                                                   SharedChildPtr<FunctorTemplate<R, O, false, void, void, void, void, void>, FunctorPointerPtr<typename detail::FunctionPointer<R, O, false, void, void, void, void, void>::Type, O> > createFunctor(R (O::*functionPointer)())                   { return new FunctorTemplate<R, O, false, void, void, void, void, void>(functionPointer); }
335    template <class R, class O, class P1, class P2, class P3, class P4, class P5> SharedChildPtr<FunctorTemplate<R, O, true, P1, P2, P3, P4, P5>,           FunctorPointerPtr<typename detail::FunctionPointer<R, O, true, P1, P2, P3, P4, P5>::Type, O> >           createFunctor(R (O::*functionPointer)(P1, P2, P3, P4, P5) const) { return new FunctorTemplate<R, O, true, P1, P2, P3, P4, P5>(functionPointer); }
336    template <class R, class O, class P1, class P2, class P3, class P4>           SharedChildPtr<FunctorTemplate<R, O, true, P1, P2, P3, P4, void>,         FunctorPointerPtr<typename detail::FunctionPointer<R, O, true, P1, P2, P3, P4, void>::Type, O> >         createFunctor(R (O::*functionPointer)(P1, P2, P3, P4) const)     { return new FunctorTemplate<R, O, true, P1, P2, P3, P4, void>(functionPointer); }
337    template <class R, class O, class P1, class P2, class P3>                     SharedChildPtr<FunctorTemplate<R, O, true, P1, P2, P3, void, void>,       FunctorPointerPtr<typename detail::FunctionPointer<R, O, true, P1, P2, P3, void, void>::Type, O> >       createFunctor(R (O::*functionPointer)(P1, P2, P3) const)         { return new FunctorTemplate<R, O, true, P1, P2, P3, void, void>(functionPointer); }
338    template <class R, class O, class P1, class P2>                               SharedChildPtr<FunctorTemplate<R, O, true, P1, P2, void, void, void>,     FunctorPointerPtr<typename detail::FunctionPointer<R, O, true, P1, P2, void, void, void>::Type, O> >     createFunctor(R (O::*functionPointer)(P1, P2) const)             { return new FunctorTemplate<R, O, true, P1, P2, void, void, void>(functionPointer); }
339    template <class R, class O, class P1>                                         SharedChildPtr<FunctorTemplate<R, O, true, P1, void, void, void, void>,   FunctorPointerPtr<typename detail::FunctionPointer<R, O, true, P1, void, void, void, void>::Type, O> >   createFunctor(R (O::*functionPointer)(P1) const)                 { return new FunctorTemplate<R, O, true, P1, void, void, void, void>(functionPointer); }
340    template <class R, class O>                                                   SharedChildPtr<FunctorTemplate<R, O, true, void, void, void, void, void>, FunctorPointerPtr<typename detail::FunctionPointer<R, O, true, void, void, void, void, void>::Type, O> > createFunctor(R (O::*functionPointer)() const)                   { return new FunctorTemplate<R, O, true, void, void, void, void, void>(functionPointer); }
341
342    template <class R, class P1, class P2, class P3, class P4, class P5> SharedChildPtr<FunctorTemplate<R, void, false, P1, P2, P3, P4, P5>,           FunctorPointerPtr<typename detail::FunctionPointer<R, void, false, P1, P2, P3, P4, P5>::Type, void> >           createFunctor(R (*functionPointer)(P1, P2, P3, P4, P5)) { return new FunctorTemplate<R, void, false, P1, P2, P3, P4, P5>(functionPointer); }
343    template <class R, class P1, class P2, class P3, class P4>           SharedChildPtr<FunctorTemplate<R, void, false, P1, P2, P3, P4, void>,         FunctorPointerPtr<typename detail::FunctionPointer<R, void, false, P1, P2, P3, P4, void>::Type, void> >         createFunctor(R (*functionPointer)(P1, P2, P3, P4))     { return new FunctorTemplate<R, void, false, P1, P2, P3, P4, void>(functionPointer); }
344    template <class R, class P1, class P2, class P3>                     SharedChildPtr<FunctorTemplate<R, void, false, P1, P2, P3, void, void>,       FunctorPointerPtr<typename detail::FunctionPointer<R, void, false, P1, P2, P3, void, void>::Type, void> >       createFunctor(R (*functionPointer)(P1, P2, P3))         { return new FunctorTemplate<R, void, false, P1, P2, P3, void, void>(functionPointer); }
345    template <class R, class P1, class P2>                               SharedChildPtr<FunctorTemplate<R, void, false, P1, P2, void, void, void>,     FunctorPointerPtr<typename detail::FunctionPointer<R, void, false, P1, P2, void, void, void>::Type, void> >     createFunctor(R (*functionPointer)(P1, P2))             { return new FunctorTemplate<R, void, false, P1, P2, void, void, void>(functionPointer); }
346    template <class R, class P1>                                         SharedChildPtr<FunctorTemplate<R, void, false, P1, void, void, void, void>,   FunctorPointerPtr<typename detail::FunctionPointer<R, void, false, P1, void, void, void, void>::Type, void> >   createFunctor(R (*functionPointer)(P1))                 { return new FunctorTemplate<R, void, false, P1, void, void, void, void>(functionPointer); }
347    template <class R>                                                   SharedChildPtr<FunctorTemplate<R, void, false, void, void, void, void, void>, FunctorPointerPtr<typename detail::FunctionPointer<R, void, false, void, void, void, void, void>::Type, void> > createFunctor(R (*functionPointer)())                   { return new FunctorTemplate<R, void, false, void, void, void, void, void>(functionPointer); }
348}
349
350#endif /* _Functor_H__ */
Note: See TracBrowser for help on using the repository browser.