PixelLightAPI  .
FuncScriptPtr.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: FuncScriptPtr.h                                *
00003  *
00004  *  Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/)
00005  *
00006  *  This file is part of PixelLight.
00007  *
00008  *  PixelLight is free software: you can redistribute it and/or modify
00009  *  it under the terms of the GNU Lesser General Public License as published by
00010  *  the Free Software Foundation, either version 3 of the License, or
00011  *  (at your option) any later version.
00012  *
00013  *  PixelLight is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016  *  GNU Lesser General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU Lesser General Public License
00019  *  along with PixelLight. If not, see <http://www.gnu.org/licenses/>.
00020 \*********************************************************/
00021 
00022 
00023 #ifndef __PLCORE_FUNCSCRIPTPTR_H__
00024 #define __PLCORE_FUNCSCRIPTPTR_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include "PLCore/Base/Func/Func.h"
00032 
00033 
00034 //[-------------------------------------------------------]
00035 //[ Namespace                                             ]
00036 //[-------------------------------------------------------]
00037 namespace PLCore {
00038 
00039 
00040 //[-------------------------------------------------------]
00041 //[ Forward declarations                                  ]
00042 //[-------------------------------------------------------]
00043 class Script;
00044 
00045 
00046 //[-------------------------------------------------------]
00047 //[ Classes                                               ]
00048 //[-------------------------------------------------------]
00049 /**
00050 *  @brief
00051 *    Script function pointer
00052 *
00053 *  @remarks
00054 *    This is a functoid that calls a function of a script
00055 */
00056 template <typename R, typename T0 = NullType, typename T1 = NullType, typename T2 = NullType, typename T3 = NullType, typename T4 = NullType, typename T5 = NullType, typename T6 = NullType, typename T7 = NullType, typename T8 = NullType, typename T9 = NullType, typename T10 = NullType, typename T11 = NullType, typename T12 = NullType, typename T13 = NullType, typename T14 = NullType, typename T15 = NullType>
00057 class FuncScriptPtr : public Func<R, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> {
00058     public:
00059         typedef typename Type<R>  ::_Type _R;
00060         typedef typename Type<T0> ::_Type _T0;
00061         typedef typename Type<T1> ::_Type _T1;
00062         typedef typename Type<T2> ::_Type _T2;
00063         typedef typename Type<T3> ::_Type _T3;
00064         typedef typename Type<T4> ::_Type _T4;
00065         typedef typename Type<T5> ::_Type _T5;
00066         typedef typename Type<T6> ::_Type _T6;
00067         typedef typename Type<T7> ::_Type _T7;
00068         typedef typename Type<T8> ::_Type _T8;
00069         typedef typename Type<T9> ::_Type _T9;
00070         typedef typename Type<T10>::_Type _T10;
00071         typedef typename Type<T11>::_Type _T11;
00072         typedef typename Type<T12>::_Type _T12;
00073         typedef typename Type<T13>::_Type _T13;
00074         typedef typename Type<T14>::_Type _T14;
00075         typedef typename Type<T15>::_Type _T15;
00076 
00077     public:
00078         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
00079         }
00080 
00081         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
00082         }
00083 
00084         virtual ~FuncScriptPtr() {
00085         }
00086 
00087         virtual _R operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5, _T6 t6, _T7 t7, _T8 t8, _T9 t9, _T10 t10, _T11 t11, _T12 t12, _T13 t13, _T14 t14, _T15 t15) override {
00088             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<R, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>::GetSignature(), m_sNamespace)) {
00089                 m_pScript->PushArgument(t0);
00090                 m_pScript->PushArgument(t1);
00091                 m_pScript->PushArgument(t2);
00092                 m_pScript->PushArgument(t3);
00093                 m_pScript->PushArgument(t4);
00094                 m_pScript->PushArgument(t5);
00095                 m_pScript->PushArgument(t6);
00096                 m_pScript->PushArgument(t7);
00097                 m_pScript->PushArgument(t8);
00098                 m_pScript->PushArgument(t9);
00099                 m_pScript->PushArgument(t10);
00100                 m_pScript->PushArgument(t11);
00101                 m_pScript->PushArgument(t12);
00102                 m_pScript->PushArgument(t13);
00103                 m_pScript->PushArgument(t14);
00104                 m_pScript->PushArgument(t15);
00105                 if (m_pScript->EndCall()) {
00106                     _R r = DefaultValue<R>::Default();
00107                     return (R)m_pScript->GetReturn(r);  // C-style cast to be as flexible as possible in here
00108                 }
00109             }
00110             return DefaultValue<R>::Default();
00111         }
00112 
00113         virtual DynFunc *Clone() const override {
00114             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
00115         }
00116 
00117     private:
00118         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
00119         String  m_sFunction;    /**< Name of the script function to use */
00120         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
00121 };
00122 
00123 /**
00124 *  @brief
00125 *    Script function pointer
00126 *
00127 *  @remarks
00128 *    Implementation for up to 16 parameters without a return value
00129 */
00130 template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15>
00131 class FuncScriptPtr<void, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> : public Func<void, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> {
00132     public:
00133         typedef typename Type<T0> ::_Type _T0;
00134         typedef typename Type<T1> ::_Type _T1;
00135         typedef typename Type<T2> ::_Type _T2;
00136         typedef typename Type<T3> ::_Type _T3;
00137         typedef typename Type<T4> ::_Type _T4;
00138         typedef typename Type<T5> ::_Type _T5;
00139         typedef typename Type<T6> ::_Type _T6;
00140         typedef typename Type<T7> ::_Type _T7;
00141         typedef typename Type<T8> ::_Type _T8;
00142         typedef typename Type<T9> ::_Type _T9;
00143         typedef typename Type<T10>::_Type _T10;
00144         typedef typename Type<T11>::_Type _T11;
00145         typedef typename Type<T12>::_Type _T12;
00146         typedef typename Type<T13>::_Type _T13;
00147         typedef typename Type<T14>::_Type _T14;
00148         typedef typename Type<T15>::_Type _T15;
00149 
00150     public:
00151         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
00152         }
00153 
00154         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
00155         }
00156 
00157         virtual ~FuncScriptPtr() {
00158         }
00159 
00160         virtual void operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5, _T6 t6, _T7 t7, _T8 t8, _T9 t9, _T10 t10, _T11 t11, _T12 t12, _T13 t13, _T14 t14, _T15 t15) override {
00161             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<void, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>::GetSignature(), m_sNamespace)) {
00162                 m_pScript->PushArgument(t0);
00163                 m_pScript->PushArgument(t1);
00164                 m_pScript->PushArgument(t2);
00165                 m_pScript->PushArgument(t3);
00166                 m_pScript->PushArgument(t4);
00167                 m_pScript->PushArgument(t5);
00168                 m_pScript->PushArgument(t6);
00169                 m_pScript->PushArgument(t7);
00170                 m_pScript->PushArgument(t8);
00171                 m_pScript->PushArgument(t9);
00172                 m_pScript->PushArgument(t10);
00173                 m_pScript->PushArgument(t11);
00174                 m_pScript->PushArgument(t12);
00175                 m_pScript->PushArgument(t13);
00176                 m_pScript->PushArgument(t14);
00177                 m_pScript->PushArgument(t15);
00178                 m_pScript->EndCall();
00179             }
00180         }
00181 
00182         virtual DynFunc *Clone() const override {
00183             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
00184         }
00185 
00186     private:
00187         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
00188         String  m_sFunction;    /**< Name of the script function to use */
00189         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
00190 };
00191 
00192 /**
00193 *  @brief
00194 *    Script function pointer
00195 *
00196 *  @remarks
00197 *    Implementation for 15 parameters and a return value
00198 */
00199 template <typename R, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14>
00200 class FuncScriptPtr<R, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> : public Func<R, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> {
00201     public:
00202         typedef typename Type<R>  ::_Type _R;
00203         typedef typename Type<T0> ::_Type _T0;
00204         typedef typename Type<T1> ::_Type _T1;
00205         typedef typename Type<T2> ::_Type _T2;
00206         typedef typename Type<T3> ::_Type _T3;
00207         typedef typename Type<T4> ::_Type _T4;
00208         typedef typename Type<T5> ::_Type _T5;
00209         typedef typename Type<T6> ::_Type _T6;
00210         typedef typename Type<T7> ::_Type _T7;
00211         typedef typename Type<T8> ::_Type _T8;
00212         typedef typename Type<T9> ::_Type _T9;
00213         typedef typename Type<T10>::_Type _T10;
00214         typedef typename Type<T11>::_Type _T11;
00215         typedef typename Type<T12>::_Type _T12;
00216         typedef typename Type<T13>::_Type _T13;
00217         typedef typename Type<T14>::_Type _T14;
00218 
00219     public:
00220         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
00221         }
00222 
00223         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
00224         }
00225 
00226         virtual ~FuncScriptPtr() {
00227         }
00228 
00229         virtual _R operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5, _T6 t6, _T7 t7, _T8 t8, _T9 t9, _T10 t10, _T11 t11, _T12 t12, _T13 t13, _T14 t14) override {
00230             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<R, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>::GetSignature(), m_sNamespace)) {
00231                 m_pScript->PushArgument(t0);
00232                 m_pScript->PushArgument(t1);
00233                 m_pScript->PushArgument(t2);
00234                 m_pScript->PushArgument(t3);
00235                 m_pScript->PushArgument(t4);
00236                 m_pScript->PushArgument(t5);
00237                 m_pScript->PushArgument(t6);
00238                 m_pScript->PushArgument(t7);
00239                 m_pScript->PushArgument(t8);
00240                 m_pScript->PushArgument(t9);
00241                 m_pScript->PushArgument(t10);
00242                 m_pScript->PushArgument(t11);
00243                 m_pScript->PushArgument(t12);
00244                 m_pScript->PushArgument(t13);
00245                 m_pScript->PushArgument(t14);
00246                 if (m_pScript->EndCall()) {
00247                     _R r = DefaultValue<R>::Default();
00248                     return (R)m_pScript->GetReturn(r);  // C-style cast to be as flexible as possible in here
00249                 }
00250             }
00251             return DefaultValue<R>::Default();
00252         }
00253 
00254         virtual DynFunc *Clone() const override {
00255             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
00256         }
00257 
00258     private:
00259         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
00260         String  m_sFunction;    /**< Name of the script function to use */
00261         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
00262 };
00263 
00264 /**
00265 *  @brief
00266 *    Script function pointer
00267 *
00268 *  @remarks
00269 *    Implementation for 15 parameters without a return value
00270 */
00271 template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14>
00272 class FuncScriptPtr<void, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> : public Func<void, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> {
00273     public:
00274         typedef typename Type<T0> ::_Type _T0;
00275         typedef typename Type<T1> ::_Type _T1;
00276         typedef typename Type<T2> ::_Type _T2;
00277         typedef typename Type<T3> ::_Type _T3;
00278         typedef typename Type<T4> ::_Type _T4;
00279         typedef typename Type<T5> ::_Type _T5;
00280         typedef typename Type<T6> ::_Type _T6;
00281         typedef typename Type<T7> ::_Type _T7;
00282         typedef typename Type<T8> ::_Type _T8;
00283         typedef typename Type<T9> ::_Type _T9;
00284         typedef typename Type<T10>::_Type _T10;
00285         typedef typename Type<T11>::_Type _T11;
00286         typedef typename Type<T12>::_Type _T12;
00287         typedef typename Type<T13>::_Type _T13;
00288         typedef typename Type<T14>::_Type _T14;
00289 
00290     public:
00291         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
00292         }
00293 
00294         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
00295         }
00296 
00297         virtual ~FuncScriptPtr() {
00298         }
00299 
00300         virtual void operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5, _T6 t6, _T7 t7, _T8 t8, _T9 t9, _T10 t10, _T11 t11, _T12 t12, _T13 t13, _T14 t14) override {
00301             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<void, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>::GetSignature(), m_sNamespace)) {
00302                 m_pScript->PushArgument(t0);
00303                 m_pScript->PushArgument(t1);
00304                 m_pScript->PushArgument(t2);
00305                 m_pScript->PushArgument(t3);
00306                 m_pScript->PushArgument(t4);
00307                 m_pScript->PushArgument(t5);
00308                 m_pScript->PushArgument(t6);
00309                 m_pScript->PushArgument(t7);
00310                 m_pScript->PushArgument(t8);
00311                 m_pScript->PushArgument(t9);
00312                 m_pScript->PushArgument(t10);
00313                 m_pScript->PushArgument(t11);
00314                 m_pScript->PushArgument(t12);
00315                 m_pScript->PushArgument(t13);
00316                 m_pScript->PushArgument(t14);
00317                 m_pScript->EndCall();
00318             }
00319         }
00320 
00321         virtual DynFunc *Clone() const override {
00322             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
00323         }
00324 
00325     private:
00326         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
00327         String  m_sFunction;    /**< Name of the script function to use */
00328         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
00329 };
00330 
00331 /**
00332 *  @brief
00333 *    Script function pointer
00334 *
00335 *  @remarks
00336 *    Implementation for 14 parameters and a return value
00337 */
00338 template <typename R, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13>
00339 class FuncScriptPtr<R, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> : public Func<R, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> {
00340     public:
00341         typedef typename Type<R>  ::_Type _R;
00342         typedef typename Type<T0> ::_Type _T0;
00343         typedef typename Type<T1> ::_Type _T1;
00344         typedef typename Type<T2> ::_Type _T2;
00345         typedef typename Type<T3> ::_Type _T3;
00346         typedef typename Type<T4> ::_Type _T4;
00347         typedef typename Type<T5> ::_Type _T5;
00348         typedef typename Type<T6> ::_Type _T6;
00349         typedef typename Type<T7> ::_Type _T7;
00350         typedef typename Type<T8> ::_Type _T8;
00351         typedef typename Type<T9> ::_Type _T9;
00352         typedef typename Type<T10>::_Type _T10;
00353         typedef typename Type<T11>::_Type _T11;
00354         typedef typename Type<T12>::_Type _T12;
00355         typedef typename Type<T13>::_Type _T13;
00356 
00357     public:
00358         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
00359         }
00360 
00361         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
00362         }
00363 
00364         virtual ~FuncScriptPtr() {
00365         }
00366 
00367         virtual _R operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5, _T6 t6, _T7 t7, _T8 t8, _T9 t9, _T10 t10, _T11 t11, _T12 t12, _T13 t13) override {
00368             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<R, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>::GetSignature(), m_sNamespace)) {
00369                 m_pScript->PushArgument(t0);
00370                 m_pScript->PushArgument(t1);
00371                 m_pScript->PushArgument(t2);
00372                 m_pScript->PushArgument(t3);
00373                 m_pScript->PushArgument(t4);
00374                 m_pScript->PushArgument(t5);
00375                 m_pScript->PushArgument(t6);
00376                 m_pScript->PushArgument(t7);
00377                 m_pScript->PushArgument(t8);
00378                 m_pScript->PushArgument(t9);
00379                 m_pScript->PushArgument(t10);
00380                 m_pScript->PushArgument(t11);
00381                 m_pScript->PushArgument(t12);
00382                 m_pScript->PushArgument(t13);
00383                 if (m_pScript->EndCall()) {
00384                     _R r = DefaultValue<R>::Default();
00385                     return (R)m_pScript->GetReturn(r);  // C-style cast to be as flexible as possible in here
00386                 }
00387             }
00388             return DefaultValue<R>::Default();
00389         }
00390 
00391         virtual DynFunc *Clone() const override {
00392             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
00393         }
00394 
00395     private:
00396         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
00397         String  m_sFunction;    /**< Name of the script function to use */
00398         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
00399 };
00400 
00401 /**
00402 *  @brief
00403 *    Script function pointer
00404 *
00405 *  @remarks
00406 *    Implementation for 14 parameters without a return value
00407 */
00408 template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13>
00409 class FuncScriptPtr<void, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> : public Func<void, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> {
00410     public:
00411         typedef typename Type<T0> ::_Type _T0;
00412         typedef typename Type<T1> ::_Type _T1;
00413         typedef typename Type<T2> ::_Type _T2;
00414         typedef typename Type<T3> ::_Type _T3;
00415         typedef typename Type<T4> ::_Type _T4;
00416         typedef typename Type<T5> ::_Type _T5;
00417         typedef typename Type<T6> ::_Type _T6;
00418         typedef typename Type<T7> ::_Type _T7;
00419         typedef typename Type<T8> ::_Type _T8;
00420         typedef typename Type<T9> ::_Type _T9;
00421         typedef typename Type<T10>::_Type _T10;
00422         typedef typename Type<T11>::_Type _T11;
00423         typedef typename Type<T12>::_Type _T12;
00424         typedef typename Type<T13>::_Type _T13;
00425 
00426     public:
00427         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
00428         }
00429 
00430         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
00431         }
00432 
00433         virtual ~FuncScriptPtr() {
00434         }
00435 
00436         virtual void operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5, _T6 t6, _T7 t7, _T8 t8, _T9 t9, _T10 t10, _T11 t11, _T12 t12, _T13 t13) override {
00437             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<void, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>::GetSignature(), m_sNamespace)) {
00438                 m_pScript->PushArgument(t0);
00439                 m_pScript->PushArgument(t1);
00440                 m_pScript->PushArgument(t2);
00441                 m_pScript->PushArgument(t3);
00442                 m_pScript->PushArgument(t4);
00443                 m_pScript->PushArgument(t5);
00444                 m_pScript->PushArgument(t6);
00445                 m_pScript->PushArgument(t7);
00446                 m_pScript->PushArgument(t8);
00447                 m_pScript->PushArgument(t9);
00448                 m_pScript->PushArgument(t10);
00449                 m_pScript->PushArgument(t11);
00450                 m_pScript->PushArgument(t12);
00451                 m_pScript->PushArgument(t13);
00452                 m_pScript->EndCall();
00453             }
00454         }
00455 
00456         virtual DynFunc *Clone() const override {
00457             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
00458         }
00459 
00460     private:
00461         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
00462         String  m_sFunction;    /**< Name of the script function to use */
00463         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
00464 };
00465 
00466 /**
00467 *  @brief
00468 *    Script function pointer
00469 *
00470 *  @remarks
00471 *    Implementation for 13 parameters and a return value
00472 */
00473 template <typename R, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12>
00474 class FuncScriptPtr<R, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> : public Func<R, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> {
00475     public:
00476         typedef typename Type<R>  ::_Type _R;
00477         typedef typename Type<T0> ::_Type _T0;
00478         typedef typename Type<T1> ::_Type _T1;
00479         typedef typename Type<T2> ::_Type _T2;
00480         typedef typename Type<T3> ::_Type _T3;
00481         typedef typename Type<T4> ::_Type _T4;
00482         typedef typename Type<T5> ::_Type _T5;
00483         typedef typename Type<T6> ::_Type _T6;
00484         typedef typename Type<T7> ::_Type _T7;
00485         typedef typename Type<T8> ::_Type _T8;
00486         typedef typename Type<T9> ::_Type _T9;
00487         typedef typename Type<T10>::_Type _T10;
00488         typedef typename Type<T11>::_Type _T11;
00489         typedef typename Type<T12>::_Type _T12;
00490 
00491     public:
00492         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
00493         }
00494 
00495         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
00496         }
00497 
00498         virtual ~FuncScriptPtr() {
00499         }
00500 
00501         virtual _R operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5, _T6 t6, _T7 t7, _T8 t8, _T9 t9, _T10 t10, _T11 t11, _T12 t12) override {
00502             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<R, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>::GetSignature(), m_sNamespace)) {
00503                 m_pScript->PushArgument(t0);
00504                 m_pScript->PushArgument(t1);
00505                 m_pScript->PushArgument(t2);
00506                 m_pScript->PushArgument(t3);
00507                 m_pScript->PushArgument(t4);
00508                 m_pScript->PushArgument(t5);
00509                 m_pScript->PushArgument(t6);
00510                 m_pScript->PushArgument(t7);
00511                 m_pScript->PushArgument(t8);
00512                 m_pScript->PushArgument(t9);
00513                 m_pScript->PushArgument(t10);
00514                 m_pScript->PushArgument(t11);
00515                 m_pScript->PushArgument(t12);
00516                 if (m_pScript->EndCall()) {
00517                     _R r = DefaultValue<R>::Default();
00518                     return (R)m_pScript->GetReturn(r);  // C-style cast to be as flexible as possible in here
00519                 }
00520             }
00521             return DefaultValue<R>::Default();
00522         }
00523 
00524         virtual DynFunc *Clone() const override {
00525             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
00526         }
00527 
00528     private:
00529         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
00530         String  m_sFunction;    /**< Name of the script function to use */
00531         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
00532 };
00533 
00534 /**
00535 *  @brief
00536 *    Script function pointer
00537 *
00538 *  @remarks
00539 *    Implementation for 13 parameters without a return value
00540 */
00541 template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12>
00542 class FuncScriptPtr<void, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> : public Func<void, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> {
00543     public:
00544         typedef typename Type<T0> ::_Type _T0;
00545         typedef typename Type<T1> ::_Type _T1;
00546         typedef typename Type<T2> ::_Type _T2;
00547         typedef typename Type<T3> ::_Type _T3;
00548         typedef typename Type<T4> ::_Type _T4;
00549         typedef typename Type<T5> ::_Type _T5;
00550         typedef typename Type<T6> ::_Type _T6;
00551         typedef typename Type<T7> ::_Type _T7;
00552         typedef typename Type<T8> ::_Type _T8;
00553         typedef typename Type<T9> ::_Type _T9;
00554         typedef typename Type<T10>::_Type _T10;
00555         typedef typename Type<T11>::_Type _T11;
00556         typedef typename Type<T12>::_Type _T12;
00557 
00558     public:
00559         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
00560         }
00561 
00562         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
00563         }
00564 
00565         virtual ~FuncScriptPtr() {
00566         }
00567 
00568         virtual void operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5, _T6 t6, _T7 t7, _T8 t8, _T9 t9, _T10 t10, _T11 t11, _T12 t12) override {
00569             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<void, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>::GetSignature(), m_sNamespace)) {
00570                 m_pScript->PushArgument(t0);
00571                 m_pScript->PushArgument(t1);
00572                 m_pScript->PushArgument(t2);
00573                 m_pScript->PushArgument(t3);
00574                 m_pScript->PushArgument(t4);
00575                 m_pScript->PushArgument(t5);
00576                 m_pScript->PushArgument(t6);
00577                 m_pScript->PushArgument(t7);
00578                 m_pScript->PushArgument(t8);
00579                 m_pScript->PushArgument(t9);
00580                 m_pScript->PushArgument(t10);
00581                 m_pScript->PushArgument(t11);
00582                 m_pScript->PushArgument(t12);
00583                 m_pScript->EndCall();
00584             }
00585         }
00586 
00587         virtual DynFunc *Clone() const override {
00588             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
00589         }
00590 
00591     private:
00592         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
00593         String  m_sFunction;    /**< Name of the script function to use */
00594         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
00595 };
00596 
00597 /**
00598 *  @brief
00599 *    Script function pointer
00600 *
00601 *  @remarks
00602 *    Implementation for 12 parameters and a return value
00603 */
00604 template <typename R, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11>
00605 class FuncScriptPtr<R, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> : public Func<R, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> {
00606     public:
00607         typedef typename Type<R>  ::_Type _R;
00608         typedef typename Type<T0> ::_Type _T0;
00609         typedef typename Type<T1> ::_Type _T1;
00610         typedef typename Type<T2> ::_Type _T2;
00611         typedef typename Type<T3> ::_Type _T3;
00612         typedef typename Type<T4> ::_Type _T4;
00613         typedef typename Type<T5> ::_Type _T5;
00614         typedef typename Type<T6> ::_Type _T6;
00615         typedef typename Type<T7> ::_Type _T7;
00616         typedef typename Type<T8> ::_Type _T8;
00617         typedef typename Type<T9> ::_Type _T9;
00618         typedef typename Type<T10>::_Type _T10;
00619         typedef typename Type<T11>::_Type _T11;
00620 
00621     public:
00622         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
00623         }
00624 
00625         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
00626         }
00627 
00628         virtual ~FuncScriptPtr() {
00629         }
00630 
00631         virtual _R operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5, _T6 t6, _T7 t7, _T8 t8, _T9 t9, _T10 t10, _T11 t11) override {
00632             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<R, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>::GetSignature(), m_sNamespace)) {
00633                 m_pScript->PushArgument(t0);
00634                 m_pScript->PushArgument(t1);
00635                 m_pScript->PushArgument(t2);
00636                 m_pScript->PushArgument(t3);
00637                 m_pScript->PushArgument(t4);
00638                 m_pScript->PushArgument(t5);
00639                 m_pScript->PushArgument(t6);
00640                 m_pScript->PushArgument(t7);
00641                 m_pScript->PushArgument(t8);
00642                 m_pScript->PushArgument(t9);
00643                 m_pScript->PushArgument(t10);
00644                 m_pScript->PushArgument(t11);
00645                 if (m_pScript->EndCall()) {
00646                     _R r = DefaultValue<R>::Default();
00647                     return (R)m_pScript->GetReturn(r);  // C-style cast to be as flexible as possible in here
00648                 }
00649             }
00650             return DefaultValue<R>::Default();
00651         }
00652 
00653         virtual DynFunc *Clone() const override {
00654             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
00655         }
00656 
00657     private:
00658         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
00659         String  m_sFunction;    /**< Name of the script function to use */
00660         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
00661 };
00662 
00663 /**
00664 *  @brief
00665 *    Script function pointer
00666 *
00667 *  @remarks
00668 *    Implementation for 12 parameters without a return value
00669 */
00670 template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11>
00671 class FuncScriptPtr<void, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> : public Func<void, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> {
00672     public:
00673         typedef typename Type<T0> ::_Type _T0;
00674         typedef typename Type<T1> ::_Type _T1;
00675         typedef typename Type<T2> ::_Type _T2;
00676         typedef typename Type<T3> ::_Type _T3;
00677         typedef typename Type<T4> ::_Type _T4;
00678         typedef typename Type<T5> ::_Type _T5;
00679         typedef typename Type<T6> ::_Type _T6;
00680         typedef typename Type<T7> ::_Type _T7;
00681         typedef typename Type<T8> ::_Type _T8;
00682         typedef typename Type<T9> ::_Type _T9;
00683         typedef typename Type<T10>::_Type _T10;
00684         typedef typename Type<T11>::_Type _T11;
00685 
00686     public:
00687         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
00688         }
00689 
00690         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
00691         }
00692 
00693         virtual ~FuncScriptPtr() {
00694         }
00695 
00696         virtual void operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5, _T6 t6, _T7 t7, _T8 t8, _T9 t9, _T10 t10, _T11 t11) override {
00697             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<void, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>::GetSignature(), m_sNamespace)) {
00698                 m_pScript->PushArgument(t0);
00699                 m_pScript->PushArgument(t1);
00700                 m_pScript->PushArgument(t2);
00701                 m_pScript->PushArgument(t3);
00702                 m_pScript->PushArgument(t4);
00703                 m_pScript->PushArgument(t5);
00704                 m_pScript->PushArgument(t6);
00705                 m_pScript->PushArgument(t7);
00706                 m_pScript->PushArgument(t8);
00707                 m_pScript->PushArgument(t9);
00708                 m_pScript->PushArgument(t10);
00709                 m_pScript->PushArgument(t11);
00710                 m_pScript->EndCall();
00711             }
00712         }
00713 
00714         virtual DynFunc *Clone() const override {
00715             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
00716         }
00717 
00718     private:
00719         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
00720         String  m_sFunction;    /**< Name of the script function to use */
00721         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
00722 };
00723 
00724 /**
00725 *  @brief
00726 *    Script function pointer
00727 *
00728 *  @remarks
00729 *    Implementation for 11 parameters and a return value
00730 */
00731 template <typename R, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10>
00732 class FuncScriptPtr<R, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> : public Func<R, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> {
00733     public:
00734         typedef typename Type<R>  ::_Type _R;
00735         typedef typename Type<T0> ::_Type _T0;
00736         typedef typename Type<T1> ::_Type _T1;
00737         typedef typename Type<T2> ::_Type _T2;
00738         typedef typename Type<T3> ::_Type _T3;
00739         typedef typename Type<T4> ::_Type _T4;
00740         typedef typename Type<T5> ::_Type _T5;
00741         typedef typename Type<T6> ::_Type _T6;
00742         typedef typename Type<T7> ::_Type _T7;
00743         typedef typename Type<T8> ::_Type _T8;
00744         typedef typename Type<T9> ::_Type _T9;
00745         typedef typename Type<T10>::_Type _T10;
00746 
00747     public:
00748         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
00749         }
00750 
00751         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
00752         }
00753 
00754         virtual ~FuncScriptPtr() {
00755         }
00756 
00757         virtual _R operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5, _T6 t6, _T7 t7, _T8 t8, _T9 t9, _T10 t10) override {
00758             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<R, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>::GetSignature(), m_sNamespace)) {
00759                 m_pScript->PushArgument(t0);
00760                 m_pScript->PushArgument(t1);
00761                 m_pScript->PushArgument(t2);
00762                 m_pScript->PushArgument(t3);
00763                 m_pScript->PushArgument(t4);
00764                 m_pScript->PushArgument(t5);
00765                 m_pScript->PushArgument(t6);
00766                 m_pScript->PushArgument(t7);
00767                 m_pScript->PushArgument(t8);
00768                 m_pScript->PushArgument(t9);
00769                 m_pScript->PushArgument(t10);
00770                 if (m_pScript->EndCall()) {
00771                     _R r = DefaultValue<R>::Default();
00772                     return (R)m_pScript->GetReturn(r);  // C-style cast to be as flexible as possible in here
00773                 }
00774             }
00775             return DefaultValue<R>::Default();
00776         }
00777 
00778         virtual DynFunc *Clone() const override {
00779             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
00780         }
00781 
00782     private:
00783         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
00784         String  m_sFunction;    /**< Name of the script function to use */
00785         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
00786 };
00787 
00788 /**
00789 *  @brief
00790 *    Script function pointer
00791 *
00792 *  @remarks
00793 *    Implementation for 11 parameters without a return value
00794 */
00795 template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10>
00796 class FuncScriptPtr<void, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> : public Func<void, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> {
00797     public:
00798         typedef typename Type<T0> ::_Type _T0;
00799         typedef typename Type<T1> ::_Type _T1;
00800         typedef typename Type<T2> ::_Type _T2;
00801         typedef typename Type<T3> ::_Type _T3;
00802         typedef typename Type<T4> ::_Type _T4;
00803         typedef typename Type<T5> ::_Type _T5;
00804         typedef typename Type<T6> ::_Type _T6;
00805         typedef typename Type<T7> ::_Type _T7;
00806         typedef typename Type<T8> ::_Type _T8;
00807         typedef typename Type<T9> ::_Type _T9;
00808         typedef typename Type<T10>::_Type _T10;
00809 
00810     public:
00811         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
00812         }
00813 
00814         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
00815         }
00816 
00817         virtual ~FuncScriptPtr() {
00818         }
00819 
00820         virtual void operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5, _T6 t6, _T7 t7, _T8 t8, _T9 t9, _T10 t10) override {
00821             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<void, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>::GetSignature(), m_sNamespace)) {
00822                 m_pScript->PushArgument(t0);
00823                 m_pScript->PushArgument(t1);
00824                 m_pScript->PushArgument(t2);
00825                 m_pScript->PushArgument(t3);
00826                 m_pScript->PushArgument(t4);
00827                 m_pScript->PushArgument(t5);
00828                 m_pScript->PushArgument(t6);
00829                 m_pScript->PushArgument(t7);
00830                 m_pScript->PushArgument(t8);
00831                 m_pScript->PushArgument(t9);
00832                 m_pScript->PushArgument(t10);
00833                 m_pScript->EndCall();
00834             }
00835         }
00836 
00837         virtual DynFunc *Clone() const override {
00838             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
00839         }
00840 
00841     private:
00842         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
00843         String  m_sFunction;    /**< Name of the script function to use */
00844         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
00845 };
00846 
00847 /**
00848 *  @brief
00849 *    Script function pointer
00850 *
00851 *  @remarks
00852 *    Implementation for 10 parameters and a return value
00853 */
00854 template <typename R, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
00855 class FuncScriptPtr<R, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> : public Func<R, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> {
00856     public:
00857         typedef typename Type<R>  ::_Type _R;
00858         typedef typename Type<T0> ::_Type _T0;
00859         typedef typename Type<T1> ::_Type _T1;
00860         typedef typename Type<T2> ::_Type _T2;
00861         typedef typename Type<T3> ::_Type _T3;
00862         typedef typename Type<T4> ::_Type _T4;
00863         typedef typename Type<T5> ::_Type _T5;
00864         typedef typename Type<T6> ::_Type _T6;
00865         typedef typename Type<T7> ::_Type _T7;
00866         typedef typename Type<T8> ::_Type _T8;
00867         typedef typename Type<T9> ::_Type _T9;
00868 
00869     public:
00870         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
00871         }
00872 
00873         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
00874         }
00875 
00876         virtual ~FuncScriptPtr() {
00877         }
00878 
00879         virtual _R operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5, _T6 t6, _T7 t7, _T8 t8, _T9 t9) override {
00880             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<R, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::GetSignature(), m_sNamespace)) {
00881                 m_pScript->PushArgument(t0);
00882                 m_pScript->PushArgument(t1);
00883                 m_pScript->PushArgument(t2);
00884                 m_pScript->PushArgument(t3);
00885                 m_pScript->PushArgument(t4);
00886                 m_pScript->PushArgument(t5);
00887                 m_pScript->PushArgument(t6);
00888                 m_pScript->PushArgument(t7);
00889                 m_pScript->PushArgument(t8);
00890                 m_pScript->PushArgument(t9);
00891                 if (m_pScript->EndCall()) {
00892                     _R r = DefaultValue<R>::Default();
00893                     return (R)m_pScript->GetReturn(r);  // C-style cast to be as flexible as possible in here
00894                 }
00895             }
00896             return DefaultValue<R>::Default();
00897         }
00898 
00899         virtual DynFunc *Clone() const override {
00900             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
00901         }
00902 
00903     private:
00904         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
00905         String  m_sFunction;    /**< Name of the script function to use */
00906         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
00907 };
00908 
00909 /**
00910 *  @brief
00911 *    Script function pointer
00912 *
00913 *  @remarks
00914 *    Implementation for 10 parameters without a return value
00915 */
00916 template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
00917 class FuncScriptPtr<void, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> : public Func<void, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> {
00918     public:
00919         typedef typename Type<T0> ::_Type _T0;
00920         typedef typename Type<T1> ::_Type _T1;
00921         typedef typename Type<T2> ::_Type _T2;
00922         typedef typename Type<T3> ::_Type _T3;
00923         typedef typename Type<T4> ::_Type _T4;
00924         typedef typename Type<T5> ::_Type _T5;
00925         typedef typename Type<T6> ::_Type _T6;
00926         typedef typename Type<T7> ::_Type _T7;
00927         typedef typename Type<T8> ::_Type _T8;
00928         typedef typename Type<T9> ::_Type _T9;
00929 
00930     public:
00931         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
00932         }
00933 
00934         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
00935         }
00936 
00937         virtual ~FuncScriptPtr() {
00938         }
00939 
00940         virtual void operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5, _T6 t6, _T7 t7, _T8 t8, _T9 t9) override {
00941             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<void, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::GetSignature(), m_sNamespace)) {
00942                 m_pScript->PushArgument(t0);
00943                 m_pScript->PushArgument(t1);
00944                 m_pScript->PushArgument(t2);
00945                 m_pScript->PushArgument(t3);
00946                 m_pScript->PushArgument(t4);
00947                 m_pScript->PushArgument(t5);
00948                 m_pScript->PushArgument(t6);
00949                 m_pScript->PushArgument(t7);
00950                 m_pScript->PushArgument(t8);
00951                 m_pScript->PushArgument(t9);
00952                 m_pScript->EndCall();
00953             }
00954         }
00955 
00956         virtual DynFunc *Clone() const override {
00957             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
00958         }
00959 
00960     private:
00961         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
00962         String  m_sFunction;    /**< Name of the script function to use */
00963         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
00964 };
00965 
00966 /**
00967 *  @brief
00968 *    Script function pointer
00969 *
00970 *  @remarks
00971 *    Implementation for 9 parameters and a return value
00972 */
00973 template <typename R, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
00974 class FuncScriptPtr<R, T0, T1, T2, T3, T4, T5, T6, T7, T8> : public Func<R, T0, T1, T2, T3, T4, T5, T6, T7, T8> {
00975     public:
00976         typedef typename Type<R>  ::_Type _R;
00977         typedef typename Type<T0> ::_Type _T0;
00978         typedef typename Type<T1> ::_Type _T1;
00979         typedef typename Type<T2> ::_Type _T2;
00980         typedef typename Type<T3> ::_Type _T3;
00981         typedef typename Type<T4> ::_Type _T4;
00982         typedef typename Type<T5> ::_Type _T5;
00983         typedef typename Type<T6> ::_Type _T6;
00984         typedef typename Type<T7> ::_Type _T7;
00985         typedef typename Type<T8> ::_Type _T8;
00986 
00987     public:
00988         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
00989         }
00990 
00991         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
00992         }
00993 
00994         virtual ~FuncScriptPtr() {
00995         }
00996 
00997         virtual _R operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5, _T6 t6, _T7 t7, _T8 t8) override {
00998             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<R, T0, T1, T2, T3, T4, T5, T6, T7, T8>::GetSignature(), m_sNamespace)) {
00999                 m_pScript->PushArgument(t0);
01000                 m_pScript->PushArgument(t1);
01001                 m_pScript->PushArgument(t2);
01002                 m_pScript->PushArgument(t3);
01003                 m_pScript->PushArgument(t4);
01004                 m_pScript->PushArgument(t5);
01005                 m_pScript->PushArgument(t6);
01006                 m_pScript->PushArgument(t7);
01007                 m_pScript->PushArgument(t8);
01008                 if (m_pScript->EndCall()) {
01009                     _R r = DefaultValue<R>::Default();
01010                     return (R)m_pScript->GetReturn(r);  // C-style cast to be as flexible as possible in here
01011                 }
01012             }
01013             return DefaultValue<R>::Default();
01014         }
01015 
01016         virtual DynFunc *Clone() const override {
01017             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
01018         }
01019 
01020     private:
01021         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
01022         String  m_sFunction;    /**< Name of the script function to use */
01023         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
01024 };
01025 
01026 /**
01027 *  @brief
01028 *    Script function pointer
01029 *
01030 *  @remarks
01031 *    Implementation for 9 parameters without a return value
01032 */
01033 template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
01034 class FuncScriptPtr<void, T0, T1, T2, T3, T4, T5, T6, T7, T8> : public Func<void, T0, T1, T2, T3, T4, T5, T6, T7, T8> {
01035     public:
01036         typedef typename Type<T0> ::_Type _T0;
01037         typedef typename Type<T1> ::_Type _T1;
01038         typedef typename Type<T2> ::_Type _T2;
01039         typedef typename Type<T3> ::_Type _T3;
01040         typedef typename Type<T4> ::_Type _T4;
01041         typedef typename Type<T5> ::_Type _T5;
01042         typedef typename Type<T6> ::_Type _T6;
01043         typedef typename Type<T7> ::_Type _T7;
01044         typedef typename Type<T8> ::_Type _T8;
01045 
01046     public:
01047         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
01048         }
01049 
01050         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
01051         }
01052 
01053         virtual ~FuncScriptPtr() {
01054         }
01055 
01056         virtual void operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5, _T6 t6, _T7 t7, _T8 t8) override {
01057             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<void, T0, T1, T2, T3, T4, T5, T6, T7, T8>::GetSignature(), m_sNamespace)) {
01058                 m_pScript->PushArgument(t0);
01059                 m_pScript->PushArgument(t1);
01060                 m_pScript->PushArgument(t2);
01061                 m_pScript->PushArgument(t3);
01062                 m_pScript->PushArgument(t4);
01063                 m_pScript->PushArgument(t5);
01064                 m_pScript->PushArgument(t6);
01065                 m_pScript->PushArgument(t7);
01066                 m_pScript->PushArgument(t8);
01067                 m_pScript->EndCall();
01068             }
01069         }
01070 
01071         virtual DynFunc *Clone() const override {
01072             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
01073         }
01074 
01075     private:
01076         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
01077         String  m_sFunction;    /**< Name of the script function to use */
01078         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
01079 };
01080 
01081 /**
01082 *  @brief
01083 *    Script function pointer
01084 *
01085 *  @remarks
01086 *    Implementation for 8 parameters and a return value
01087 */
01088 template <typename R, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
01089 class FuncScriptPtr<R, T0, T1, T2, T3, T4, T5, T6, T7> : public Func<R, T0, T1, T2, T3, T4, T5, T6, T7> {
01090     public:
01091         typedef typename Type<R>  ::_Type _R;
01092         typedef typename Type<T0> ::_Type _T0;
01093         typedef typename Type<T1> ::_Type _T1;
01094         typedef typename Type<T2> ::_Type _T2;
01095         typedef typename Type<T3> ::_Type _T3;
01096         typedef typename Type<T4> ::_Type _T4;
01097         typedef typename Type<T5> ::_Type _T5;
01098         typedef typename Type<T6> ::_Type _T6;
01099         typedef typename Type<T7> ::_Type _T7;
01100 
01101     public:
01102         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
01103         }
01104 
01105         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
01106         }
01107 
01108         virtual ~FuncScriptPtr() {
01109         }
01110 
01111         virtual _R operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5, _T6 t6, _T7 t7) override {
01112             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<R, T0, T1, T2, T3, T4, T5, T6, T7>::GetSignature(), m_sNamespace)) {
01113                 m_pScript->PushArgument(t0);
01114                 m_pScript->PushArgument(t1);
01115                 m_pScript->PushArgument(t2);
01116                 m_pScript->PushArgument(t3);
01117                 m_pScript->PushArgument(t4);
01118                 m_pScript->PushArgument(t5);
01119                 m_pScript->PushArgument(t6);
01120                 m_pScript->PushArgument(t7);
01121                 if (m_pScript->EndCall()) {
01122                     _R r = DefaultValue<R>::Default();
01123                     return (R)m_pScript->GetReturn(r);  // C-style cast to be as flexible as possible in here
01124                 }
01125             }
01126             return DefaultValue<R>::Default();
01127         }
01128 
01129         virtual DynFunc *Clone() const override {
01130             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
01131         }
01132 
01133     private:
01134         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
01135         String  m_sFunction;    /**< Name of the script function to use */
01136         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
01137 };
01138 
01139 /**
01140 *  @brief
01141 *    Script function pointer
01142 *
01143 *  @remarks
01144 *    Implementation for 8 parameters without a return value
01145 */
01146 template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
01147 class FuncScriptPtr<void, T0, T1, T2, T3, T4, T5, T6, T7> : public Func<void, T0, T1, T2, T3, T4, T5, T6, T7> {
01148     public:
01149         typedef typename Type<T0> ::_Type _T0;
01150         typedef typename Type<T1> ::_Type _T1;
01151         typedef typename Type<T2> ::_Type _T2;
01152         typedef typename Type<T3> ::_Type _T3;
01153         typedef typename Type<T4> ::_Type _T4;
01154         typedef typename Type<T5> ::_Type _T5;
01155         typedef typename Type<T6> ::_Type _T6;
01156         typedef typename Type<T7> ::_Type _T7;
01157 
01158     public:
01159         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
01160         }
01161 
01162         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
01163         }
01164 
01165         virtual ~FuncScriptPtr() {
01166         }
01167 
01168         virtual void operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5, _T6 t6, _T7 t7) override {
01169             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<void, T0, T1, T2, T3, T4, T5, T6, T7>::GetSignature(), m_sNamespace)) {
01170                 m_pScript->PushArgument(t0);
01171                 m_pScript->PushArgument(t1);
01172                 m_pScript->PushArgument(t2);
01173                 m_pScript->PushArgument(t3);
01174                 m_pScript->PushArgument(t4);
01175                 m_pScript->PushArgument(t5);
01176                 m_pScript->PushArgument(t6);
01177                 m_pScript->PushArgument(t7);
01178                 m_pScript->EndCall();
01179             }
01180         }
01181 
01182         virtual DynFunc *Clone() const override {
01183             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
01184         }
01185 
01186     private:
01187         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
01188         String  m_sFunction;    /**< Name of the script function to use */
01189         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
01190 };
01191 
01192 /**
01193 *  @brief
01194 *    Script function pointer
01195 *
01196 *  @remarks
01197 *    Implementation for 7 parameters and a return value
01198 */
01199 template <typename R, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
01200 class FuncScriptPtr<R, T0, T1, T2, T3, T4, T5, T6> : public Func<R, T0, T1, T2, T3, T4, T5, T6> {
01201     public:
01202         typedef typename Type<R>  ::_Type _R;
01203         typedef typename Type<T0> ::_Type _T0;
01204         typedef typename Type<T1> ::_Type _T1;
01205         typedef typename Type<T2> ::_Type _T2;
01206         typedef typename Type<T3> ::_Type _T3;
01207         typedef typename Type<T4> ::_Type _T4;
01208         typedef typename Type<T5> ::_Type _T5;
01209         typedef typename Type<T6> ::_Type _T6;
01210 
01211     public:
01212         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
01213         }
01214 
01215         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
01216         }
01217 
01218         virtual ~FuncScriptPtr() {
01219         }
01220 
01221         virtual _R operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5, _T6 t6) override {
01222             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<R, T0, T1, T2, T3, T4, T5, T6>::GetSignature(), m_sNamespace)) {
01223                 m_pScript->PushArgument(t0);
01224                 m_pScript->PushArgument(t1);
01225                 m_pScript->PushArgument(t2);
01226                 m_pScript->PushArgument(t3);
01227                 m_pScript->PushArgument(t4);
01228                 m_pScript->PushArgument(t5);
01229                 m_pScript->PushArgument(t6);
01230                 if (m_pScript->EndCall()) {
01231                     _R r = DefaultValue<R>::Default();
01232                     return (R)m_pScript->GetReturn(r);  // C-style cast to be as flexible as possible in here
01233                 }
01234             }
01235             return DefaultValue<R>::Default();
01236         }
01237 
01238         virtual DynFunc *Clone() const override {
01239             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
01240         }
01241 
01242     private:
01243         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
01244         String  m_sFunction;    /**< Name of the script function to use */
01245         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
01246 };
01247 
01248 /**
01249 *  @brief
01250 *    Script function pointer
01251 *
01252 *  @remarks
01253 *    Implementation for 7 parameters without a return value
01254 */
01255 template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
01256 class FuncScriptPtr<void, T0, T1, T2, T3, T4, T5, T6> : public Func<void, T0, T1, T2, T3, T4, T5, T6> {
01257     public:
01258         typedef typename Type<T0> ::_Type _T0;
01259         typedef typename Type<T1> ::_Type _T1;
01260         typedef typename Type<T2> ::_Type _T2;
01261         typedef typename Type<T3> ::_Type _T3;
01262         typedef typename Type<T4> ::_Type _T4;
01263         typedef typename Type<T5> ::_Type _T5;
01264         typedef typename Type<T6> ::_Type _T6;
01265 
01266     public:
01267         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
01268         }
01269 
01270         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
01271         }
01272 
01273         virtual ~FuncScriptPtr() {
01274         }
01275 
01276         virtual void operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5, _T6 t6) override {
01277             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<void, T0, T1, T2, T3, T4, T5, T6>::GetSignature(), m_sNamespace)) {
01278                 m_pScript->PushArgument(t0);
01279                 m_pScript->PushArgument(t1);
01280                 m_pScript->PushArgument(t2);
01281                 m_pScript->PushArgument(t3);
01282                 m_pScript->PushArgument(t4);
01283                 m_pScript->PushArgument(t5);
01284                 m_pScript->PushArgument(t6);
01285                 m_pScript->EndCall();
01286             }
01287         }
01288 
01289         virtual DynFunc *Clone() const override {
01290             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
01291         }
01292 
01293     private:
01294         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
01295         String  m_sFunction;    /**< Name of the script function to use */
01296         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
01297 };
01298 
01299 /**
01300 *  @brief
01301 *    Script function pointer
01302 *
01303 *  @remarks
01304 *    Implementation for 6 parameters and a return value
01305 */
01306 template <typename R, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>
01307 class FuncScriptPtr<R, T0, T1, T2, T3, T4, T5> : public Func<R, T0, T1, T2, T3, T4, T5> {
01308     public:
01309         typedef typename Type<R>  ::_Type _R;
01310         typedef typename Type<T0> ::_Type _T0;
01311         typedef typename Type<T1> ::_Type _T1;
01312         typedef typename Type<T2> ::_Type _T2;
01313         typedef typename Type<T3> ::_Type _T3;
01314         typedef typename Type<T4> ::_Type _T4;
01315         typedef typename Type<T5> ::_Type _T5;
01316 
01317     public:
01318         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
01319         }
01320 
01321         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
01322         }
01323 
01324         virtual ~FuncScriptPtr() {
01325         }
01326 
01327         virtual _R operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5) override {
01328             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<R, T0, T1, T2, T3, T4, T5>::GetSignature(), m_sNamespace)) {
01329                 m_pScript->PushArgument(t0);
01330                 m_pScript->PushArgument(t1);
01331                 m_pScript->PushArgument(t2);
01332                 m_pScript->PushArgument(t3);
01333                 m_pScript->PushArgument(t4);
01334                 m_pScript->PushArgument(t5);
01335                 if (m_pScript->EndCall()) {
01336                     _R r = DefaultValue<R>::Default();
01337                     return (R)m_pScript->GetReturn(r);  // C-style cast to be as flexible as possible in here
01338                 }
01339             }
01340             return DefaultValue<R>::Default();
01341         }
01342 
01343         virtual DynFunc *Clone() const override {
01344             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
01345         }
01346 
01347     private:
01348         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
01349         String  m_sFunction;    /**< Name of the script function to use */
01350         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
01351 };
01352 
01353 /**
01354 *  @brief
01355 *    Script function pointer
01356 *
01357 *  @remarks
01358 *    Implementation for 6 parameters without a return value
01359 */
01360 template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>
01361 class FuncScriptPtr<void, T0, T1, T2, T3, T4, T5> : public Func<void, T0, T1, T2, T3, T4, T5> {
01362     public:
01363         typedef typename Type<T0> ::_Type _T0;
01364         typedef typename Type<T1> ::_Type _T1;
01365         typedef typename Type<T2> ::_Type _T2;
01366         typedef typename Type<T3> ::_Type _T3;
01367         typedef typename Type<T4> ::_Type _T4;
01368         typedef typename Type<T5> ::_Type _T5;
01369 
01370     public:
01371         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
01372         }
01373 
01374         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
01375         }
01376 
01377         virtual ~FuncScriptPtr() {
01378         }
01379 
01380         virtual void operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4, _T5 t5) override {
01381             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<void, T0, T1, T2, T3, T4, T5>::GetSignature(), m_sNamespace)) {
01382                 m_pScript->PushArgument(t0);
01383                 m_pScript->PushArgument(t1);
01384                 m_pScript->PushArgument(t2);
01385                 m_pScript->PushArgument(t3);
01386                 m_pScript->PushArgument(t4);
01387                 m_pScript->PushArgument(t5);
01388                 m_pScript->EndCall();
01389             }
01390         }
01391 
01392         virtual DynFunc *Clone() const override {
01393             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
01394         }
01395 
01396     private:
01397         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
01398         String  m_sFunction;    /**< Name of the script function to use */
01399         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
01400 };
01401 
01402 /**
01403 *  @brief
01404 *    Script function pointer
01405 *
01406 *  @remarks
01407 *    Implementation for 5 parameters and a return value
01408 */
01409 template < typename R, typename T0, typename T1, typename T2, typename T3, typename T4>
01410 class FuncScriptPtr<R, T0, T1, T2, T3, T4> : public Func<R, T0, T1, T2, T3, T4> {
01411     public:
01412         typedef typename Type<R>  ::_Type _R;
01413         typedef typename Type<T0> ::_Type _T0;
01414         typedef typename Type<T1> ::_Type _T1;
01415         typedef typename Type<T2> ::_Type _T2;
01416         typedef typename Type<T3> ::_Type _T3;
01417         typedef typename Type<T4> ::_Type _T4;
01418 
01419     public:
01420         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
01421         }
01422 
01423         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
01424         }
01425 
01426         virtual ~FuncScriptPtr() {
01427         }
01428 
01429         virtual _R operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4) override {
01430             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<R, T0, T1, T2, T3, T4>::GetSignature(), m_sNamespace)) {
01431                 m_pScript->PushArgument(t0);
01432                 m_pScript->PushArgument(t1);
01433                 m_pScript->PushArgument(t2);
01434                 m_pScript->PushArgument(t3);
01435                 m_pScript->PushArgument(t4);
01436                 if (m_pScript->EndCall()) {
01437                     _R r = DefaultValue<R>::Default();
01438                     return (R)m_pScript->GetReturn(r);  // C-style cast to be as flexible as possible in here
01439                 }
01440             }
01441             return DefaultValue<R>::Default();
01442         }
01443 
01444         virtual DynFunc *Clone() const override {
01445             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
01446         }
01447 
01448     private:
01449         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
01450         String  m_sFunction;    /**< Name of the script function to use */
01451         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
01452 };
01453 
01454 /**
01455 *  @brief
01456 *    Script function pointer
01457 *
01458 *  @remarks
01459 *    Implementation for 5 parameters without a return value
01460 */
01461 template <typename T0, typename T1, typename T2, typename T3, typename T4>
01462 class FuncScriptPtr<void, T0, T1, T2, T3, T4> : public Func<void, T0, T1, T2, T3, T4> {
01463     public:
01464         typedef typename Type<T0> ::_Type _T0;
01465         typedef typename Type<T1> ::_Type _T1;
01466         typedef typename Type<T2> ::_Type _T2;
01467         typedef typename Type<T3> ::_Type _T3;
01468         typedef typename Type<T4> ::_Type _T4;
01469 
01470     public:
01471         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
01472         }
01473 
01474         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
01475         }
01476 
01477         virtual ~FuncScriptPtr() {
01478         }
01479 
01480         virtual void operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3, _T4 t4) override {
01481             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<void, T0, T1, T2, T3, T4>::GetSignature(), m_sNamespace)) {
01482                 m_pScript->PushArgument(t0);
01483                 m_pScript->PushArgument(t1);
01484                 m_pScript->PushArgument(t2);
01485                 m_pScript->PushArgument(t3);
01486                 m_pScript->PushArgument(t4);
01487                 m_pScript->EndCall();
01488             }
01489         }
01490 
01491         virtual DynFunc *Clone() const override {
01492             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
01493         }
01494 
01495     private:
01496         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
01497         String  m_sFunction;    /**< Name of the script function to use */
01498         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
01499 };
01500 
01501 /**
01502 *  @brief
01503 *    Script function pointer
01504 *
01505 *  @remarks
01506 *    Implementation for 4 parameters and a return value
01507 */
01508 template <typename R, typename T0, typename T1, typename T2, typename T3>
01509 class FuncScriptPtr<R, T0, T1, T2, T3> : public Func<R, T0, T1, T2, T3> {
01510     public:
01511         typedef typename Type<R>  ::_Type _R;
01512         typedef typename Type<T0> ::_Type _T0;
01513         typedef typename Type<T1> ::_Type _T1;
01514         typedef typename Type<T2> ::_Type _T2;
01515         typedef typename Type<T3> ::_Type _T3;
01516 
01517     public:
01518         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
01519         }
01520 
01521         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
01522         }
01523 
01524         virtual ~FuncScriptPtr() {
01525         }
01526 
01527         virtual _R operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3) override {
01528             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<R, T0, T1, T2, T3>::GetSignature(), m_sNamespace)) {
01529                 m_pScript->PushArgument(t0);
01530                 m_pScript->PushArgument(t1);
01531                 m_pScript->PushArgument(t2);
01532                 m_pScript->PushArgument(t3);
01533                 if (m_pScript->EndCall()) {
01534                     _R r = DefaultValue<R>::Default();
01535                     return (R)m_pScript->GetReturn(r);  // C-style cast to be as flexible as possible in here
01536                 }
01537             }
01538             return DefaultValue<R>::Default();
01539         }
01540 
01541         virtual DynFunc *Clone() const override {
01542             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
01543         }
01544 
01545     private:
01546         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
01547         String  m_sFunction;    /**< Name of the script function to use */
01548         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
01549 };
01550 
01551 /**
01552 *  @brief
01553 *    Script function pointer
01554 *
01555 *  @remarks
01556 *    Implementation for 4 parameters without a return value
01557 */
01558 template <typename T0, typename T1, typename T2, typename T3>
01559 class FuncScriptPtr<void, T0, T1, T2, T3> : public Func<void, T0, T1, T2, T3> {
01560     public:
01561         typedef typename Type<T0> ::_Type _T0;
01562         typedef typename Type<T1> ::_Type _T1;
01563         typedef typename Type<T2> ::_Type _T2;
01564         typedef typename Type<T3> ::_Type _T3;
01565 
01566     public:
01567         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
01568         }
01569 
01570         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
01571         }
01572 
01573         virtual ~FuncScriptPtr() {
01574         }
01575 
01576         virtual void operator ()(_T0 t0, _T1 t1, _T2 t2, _T3 t3) override {
01577             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<void, T0, T1, T2, T3>::GetSignature(), m_sNamespace)) {
01578                 m_pScript->PushArgument(t0);
01579                 m_pScript->PushArgument(t1);
01580                 m_pScript->PushArgument(t2);
01581                 m_pScript->PushArgument(t3);
01582                 m_pScript->EndCall();
01583             }
01584         }
01585 
01586         virtual DynFunc *Clone() const override {
01587             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
01588         }
01589 
01590     private:
01591         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
01592         String  m_sFunction;    /**< Name of the script function to use */
01593         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
01594 };
01595 
01596 /**
01597 *  @brief
01598 *    Script function pointer
01599 *
01600 *  @remarks
01601 *    Implementation for 3 parameters and a return value
01602 */
01603 template <typename R, typename T0, typename T1, typename T2>
01604 class FuncScriptPtr<R, T0, T1, T2> : public Func<R, T0, T1, T2> {
01605     public:
01606         typedef typename Type<R>  ::_Type _R;
01607         typedef typename Type<T0> ::_Type _T0;
01608         typedef typename Type<T1> ::_Type _T1;
01609         typedef typename Type<T2> ::_Type _T2;
01610 
01611     public:
01612         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
01613         }
01614 
01615         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
01616         }
01617 
01618         virtual ~FuncScriptPtr() {
01619         }
01620 
01621         virtual _R operator ()(_T0 t0, _T1 t1, _T2 t2) override {
01622             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<R, T0, T1, T2>::GetSignature(), m_sNamespace)) {
01623                 m_pScript->PushArgument(t0);
01624                 m_pScript->PushArgument(t1);
01625                 m_pScript->PushArgument(t2);
01626                 if (m_pScript->EndCall()) {
01627                     _R r = DefaultValue<R>::Default();
01628                     return (R)m_pScript->GetReturn(r);  // C-style cast to be as flexible as possible in here
01629                 }
01630             }
01631             return DefaultValue<R>::Default();
01632         }
01633 
01634         virtual DynFunc *Clone() const override {
01635             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
01636         }
01637 
01638     private:
01639         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
01640         String  m_sFunction;    /**< Name of the script function to use */
01641         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
01642 };
01643 
01644 /**
01645 *  @brief
01646 *    Script function pointer
01647 *
01648 *  @remarks
01649 *    Implementation for 3 parameters without a return value
01650 */
01651 template <typename T0, typename T1, typename T2>
01652 class FuncScriptPtr<void, T0, T1, T2> : public Func<void, T0, T1, T2> {
01653     public:
01654         typedef typename Type<T0> ::_Type _T0;
01655         typedef typename Type<T1> ::_Type _T1;
01656         typedef typename Type<T2> ::_Type _T2;
01657 
01658     public:
01659         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
01660         }
01661 
01662         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
01663         }
01664 
01665         virtual ~FuncScriptPtr() {
01666         }
01667 
01668         virtual void operator ()(_T0 t0, _T1 t1, _T2 t2) override {
01669             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<void, T0, T1, T2>::GetSignature(), m_sNamespace)) {
01670                 m_pScript->PushArgument(t0);
01671                 m_pScript->PushArgument(t1);
01672                 m_pScript->PushArgument(t2);
01673                 m_pScript->EndCall();
01674             }
01675         }
01676 
01677         virtual DynFunc *Clone() const override {
01678             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
01679         }
01680 
01681     private:
01682         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
01683         String  m_sFunction;    /**< Name of the script function to use */
01684         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
01685 };
01686 
01687 /**
01688 *  @brief
01689 *    Script function pointer
01690 *
01691 *  @remarks
01692 *    Implementation for 2 parameters and a return value
01693 */
01694 template <typename R, typename T0, typename T1>
01695 class FuncScriptPtr<R, T0, T1> : public Func<R, T0, T1> {
01696     public:
01697         typedef typename Type<R>  ::_Type _R;
01698         typedef typename Type<T0> ::_Type _T0;
01699         typedef typename Type<T1> ::_Type _T1;
01700 
01701     public:
01702         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
01703         }
01704 
01705         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
01706         }
01707 
01708         virtual ~FuncScriptPtr() {
01709         }
01710 
01711         virtual _R operator ()(_T0 t0, _T1 t1) override {
01712             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<R, T0, T1>::GetSignature(), m_sNamespace)) {
01713                 m_pScript->PushArgument(t0);
01714                 m_pScript->PushArgument(t1);
01715                 if (m_pScript->EndCall()) {
01716                     _R r = DefaultValue<R>::Default();
01717                     return (R)m_pScript->GetReturn(r);  // C-style cast to be as flexible as possible in here
01718                 }
01719             }
01720             return DefaultValue<R>::Default();
01721         }
01722 
01723         virtual DynFunc *Clone() const override {
01724             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
01725         }
01726 
01727     private:
01728         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
01729         String  m_sFunction;    /**< Name of the script function to use */
01730         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
01731 };
01732 
01733 /**
01734 *  @brief
01735 *    Script function pointer
01736 *
01737 *  @remarks
01738 *    Implementation for 2 parameters without a return value
01739 */
01740 template <typename T0, typename T1>
01741 class FuncScriptPtr<void, T0, T1> : public Func<void, T0, T1> {
01742     public:
01743         typedef typename Type<T0> ::_Type _T0;
01744         typedef typename Type<T1> ::_Type _T1;
01745 
01746     public:
01747         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
01748         }
01749 
01750         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
01751         }
01752 
01753         virtual ~FuncScriptPtr() {
01754         }
01755 
01756         virtual void operator ()(_T0 t0, _T1 t1) override {
01757             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<void, T0, T1>::GetSignature(), m_sNamespace)) {
01758                 m_pScript->PushArgument(t0);
01759                 m_pScript->PushArgument(t1);
01760                 m_pScript->EndCall();
01761             }
01762         }
01763 
01764         virtual DynFunc *Clone() const override {
01765             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
01766         }
01767 
01768     private:
01769         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
01770         String  m_sFunction;    /**< Name of the script function to use */
01771         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
01772 };
01773 
01774 /**
01775 *  @brief
01776 *    Script function pointer
01777 *
01778 *  @remarks
01779 *    Implementation for 1 parameters and a return value
01780 */
01781 template <typename R, typename T0>
01782 class FuncScriptPtr<R, T0> : public Func<R, T0> {
01783     public:
01784         typedef typename Type<R>  ::_Type _R;
01785         typedef typename Type<T0> ::_Type _T0;
01786 
01787     public:
01788         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
01789         }
01790 
01791         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
01792         }
01793 
01794         virtual ~FuncScriptPtr() {
01795         }
01796 
01797         virtual _R operator ()(_T0 t0) override {
01798             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<R, T0>::GetSignature(), m_sNamespace)) {
01799                 m_pScript->PushArgument(t0);
01800                 if (m_pScript->EndCall()) {
01801                     _R r = DefaultValue<R>::Default();
01802                     return (R)m_pScript->GetReturn(r);  // C-style cast to be as flexible as possible in here
01803                 }
01804             }
01805             return DefaultValue<R>::Default();
01806         }
01807 
01808         virtual DynFunc *Clone() const override {
01809             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
01810         }
01811 
01812     private:
01813         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
01814         String  m_sFunction;    /**< Name of the script function to use */
01815         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
01816 };
01817 
01818 /**
01819 *  @brief
01820 *    Script function pointer
01821 *
01822 *  @remarks
01823 *    Implementation for 1 parameters without a return value
01824 */
01825 template <typename T0>
01826 class FuncScriptPtr<void, T0> : public Func<void, T0> {
01827     public:
01828         typedef typename Type<T0> ::_Type _T0;
01829 
01830     public:
01831         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
01832         }
01833 
01834         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
01835         }
01836 
01837         virtual ~FuncScriptPtr() {
01838         }
01839 
01840         virtual void operator ()(_T0 t0) override {
01841             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<void, T0>::GetSignature(), m_sNamespace)) {
01842                 m_pScript->PushArgument(t0);
01843                 m_pScript->EndCall();
01844             }
01845         }
01846 
01847         virtual DynFunc *Clone() const override {
01848             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
01849         }
01850 
01851     private:
01852         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
01853         String  m_sFunction;    /**< Name of the script function to use */
01854         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
01855 };
01856 
01857 /**
01858 *  @brief
01859 *    Script function pointer
01860 *
01861 *  @remarks
01862 *    Implementation for 0 parameters and a return value
01863 */
01864 template <typename R>
01865 class FuncScriptPtr<R> : public Func<R> {
01866     public:
01867         typedef typename Type<R>  ::_Type _R;
01868 
01869     public:
01870         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
01871         }
01872 
01873         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
01874         }
01875 
01876         virtual ~FuncScriptPtr() {
01877         }
01878 
01879         virtual _R operator ()() override {
01880             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<R>::GetSignature(), m_sNamespace)) {
01881                 if (m_pScript->EndCall()) {
01882                     _R r = DefaultValue<R>::Default();
01883                     return (R)m_pScript->GetReturn(r);  // C-style cast to be as flexible as possible in here
01884                 }
01885             }
01886             return DefaultValue<R>::Default();
01887         }
01888 
01889         virtual DynFunc *Clone() const override {
01890             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
01891         }
01892 
01893     private:
01894         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
01895         String  m_sFunction;    /**< Name of the script function to use */
01896         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
01897 };
01898 
01899 /**
01900 *  @brief
01901 *    Script function pointer
01902 *
01903 *  @remarks
01904 *    Implementation for 0 parameters without a return value
01905 */
01906 template <>
01907 class FuncScriptPtr<void> : public Func<void> {
01908     public:
01909         FuncScriptPtr(Script *pScript, const String &sFunction) : m_pScript(pScript), m_sFunction(sFunction) {
01910         }
01911 
01912         FuncScriptPtr(Script *pScript, const String &sFunction, const String &sNamespace) : m_pScript(pScript), m_sFunction(sFunction), m_sNamespace(sNamespace) {
01913         }
01914 
01915         virtual ~FuncScriptPtr() {
01916         }
01917 
01918         virtual void operator ()() override {
01919             if (m_pScript && m_pScript->BeginCall(m_sFunction, Func<void>::GetSignature(), m_sNamespace))
01920                 m_pScript->EndCall();
01921         }
01922 
01923         virtual DynFunc *Clone() const override {
01924             return new FuncScriptPtr(m_pScript, m_sFunction, m_sNamespace);
01925         }
01926 
01927     private:
01928         Script *m_pScript;      /**< Script instance the function is in, can be a null pointer */
01929         String  m_sFunction;    /**< Name of the script function to use */
01930         String  m_sNamespace;   /**< Optional namespace (e.g. "MyNamespace", "MyNamespace.MyOtherNamespace" and so on) */
01931 };
01932 
01933 
01934 //[-------------------------------------------------------]
01935 //[ Namespace                                             ]
01936 //[-------------------------------------------------------]
01937 } // PLCore
01938 
01939 
01940 #endif // __PLCORE_FUNCSCRIPTPTR_H__


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:08:55
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported