// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 #pragma once #include #include #include namespace frantic { namespace max3d { namespace fpwrapper { // -------------- The main abstract base dispatcher class // This class calls a function based on the function publishing inputs template class FPDispatcher { protected: FunctionID m_fid; frantic::tstring m_name; std::vector m_paramNames; public: virtual void dispatch( MainClass* obj, TimeValue t, FPValue& result, FPParams* p ) = 0; virtual void add_descriptor_varargs( make_varargs& va ) = 0; const FunctionID get_fid() { return m_fid; } const frantic::tstring& get_name() { return m_name; } }; // -------------- The classes which handle actually calling the functions // General dispatcher, does nothing template struct FPDispatcherDispatch {}; // dispatcher for - void function(); template struct FPDispatcherDispatch { typedef void ( MainClass::*FnT )(); static const int arity = 0; typedef void ReturnType; inline static void dispatch( FnT function, MainClass* obj, TimeValue /*t*/, FPValue& /*result*/, FPParams* /*p*/ ) { ( obj->*function )(); } inline static void add_descriptor_argument_varargs( make_varargs& /*va*/, const std::vector& /*paramNames*/ ) {} }; // dispatcher for - void function(); with time template struct FPDispatcherDispatch { typedef void ( MainClass::*FnT )( FPTimeValue ); static const int arity = 0; typedef void ReturnType; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& /*result*/, FPParams* /*p*/ ) { ( obj->*function )( t ); } inline static void add_descriptor_argument_varargs( make_varargs& /*va*/, const std::vector& /*paramNames*/ ) {} }; // dispatcher for - RT function(); template struct FPDispatcherDispatch { typedef RT ( MainClass::*FnT )(); static const int arity = 0; typedef typename RemoveConstRef::type ReturnType; inline static void dispatch( FnT function, MainClass* obj, TimeValue /*t*/, FPValue& result, FPParams* /*p*/ ) { RT value = ( obj->*function )(); MaxTypeTraits::set_fpvalue( value, result ); } inline static void add_descriptor_argument_varargs( make_varargs& /*va*/, const std::vector& /*paramNames*/ ) {} }; // dispatcher for - RT function(); with time template struct FPDispatcherDispatch { typedef RT ( MainClass::*FnT )( FPTimeValue ); static const int arity = 0; typedef typename RemoveConstRef::type ReturnType; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& result, FPParams* /*p*/ ) { RT value = ( obj->*function )( t ); MaxTypeTraits::set_fpvalue( value, result ); } inline static void add_descriptor_argument_varargs( make_varargs& /*va*/, const std::vector& /*paramNames*/ ) {} }; // dispatcher for - void function( T0 ); template struct FPDispatcherDispatch { typedef void ( MainClass::*FnT )( T0 ); static const int arity = 1; typedef void ReturnType; typedef typename RemoveConstRef::type Arg0Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue /*t*/, FPValue& /*result*/, FPParams* p ) { ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ) ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - void function( T0 ); with time template struct FPDispatcherDispatch { typedef void ( MainClass::*FnT )( T0, FPTimeValue ); static const int arity = 1; typedef void ReturnType; typedef typename RemoveConstRef::type Arg0Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& /*result*/, FPParams* p ) { ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), t ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - RT function( T0 ); template struct FPDispatcherDispatch { typedef RT ( MainClass::*FnT )( T0 ); static const int arity = 1; typedef typename RemoveConstRef::type ReturnType; typedef typename RemoveConstRef::type Arg0Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue /*t*/, FPValue& result, FPParams* p ) { RT value = ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ) ); MaxTypeTraits::set_fpvalue( value, result ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - RT function( T0 ); with time template struct FPDispatcherDispatch { typedef RT ( MainClass::*FnT )( T0, FPTimeValue ); static const int arity = 1; typedef typename RemoveConstRef::type ReturnType; typedef typename RemoveConstRef::type Arg0Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& result, FPParams* p ) { RT value = ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), t ); MaxTypeTraits::set_fpvalue( value, result ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - void function( T0, T1 ); template struct FPDispatcherDispatch { typedef void ( MainClass::*FnT )( T0, T1 ); static const int arity = 2; typedef void ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue /*t*/, FPValue& /*result*/, FPParams* p ) { ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ) ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - void function( T0, T1 ); with time template struct FPDispatcherDispatch { typedef void ( MainClass::*FnT )( T0, T1, FPTimeValue ); static const int arity = 2; typedef void ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& /*result*/, FPParams* p ) { ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), t ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - RT function( T0, T1 ); template struct FPDispatcherDispatch { typedef RT ( MainClass::*FnT )( T0, T1 ); static const int arity = 2; typedef typename RemoveConstRef::type ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue /*t*/, FPValue& result, FPParams* p ) { RT value = ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ) ); MaxTypeTraits::set_fpvalue( value, result ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - RT function( T0, T1 ); with time template struct FPDispatcherDispatch { typedef RT ( MainClass::*FnT )( T0, T1, FPTimeValue ); static const int arity = 2; typedef typename RemoveConstRef::type ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; // found a weird optimizer bug that this pragma fixed #pragma optimize( "t", off ) inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& result, FPParams* p ) { RT value = ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), t ); MaxTypeTraits::set_fpvalue( value, result ); } #pragma optimize( "", on ) inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - void function( T0, T1, T2 ); template struct FPDispatcherDispatch { typedef void ( MainClass::*FnT )( T0, T1, T2 ); static const int arity = 3; typedef void ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue /*t*/, FPValue& /*result*/, FPParams* p ) { ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ) ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - void function( T0, T1, T2 ); with time template struct FPDispatcherDispatch { typedef void ( MainClass::*FnT )( T0, T1, T2, FPTimeValue ); static const int arity = 3; typedef void ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& /*result*/, FPParams* p ) { ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), t ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - RT function( T0, T1, T2 ); template struct FPDispatcherDispatch { typedef RT ( MainClass::*FnT )( T0, T1, T2 ); static const int arity = 3; typedef typename RemoveConstRef::type ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue /*t*/, FPValue& result, FPParams* p ) { RT value = ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ) ); MaxTypeTraits::set_fpvalue( value, result ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - RT function( T0, T1, T2 ); with time template struct FPDispatcherDispatch { typedef RT ( MainClass::*FnT )( T0, T1, T2, FPTimeValue ); static const int arity = 3; typedef typename RemoveConstRef::type ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& result, FPParams* p ) { RT value = ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), t ); MaxTypeTraits::set_fpvalue( value, result ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - void function( T0, T1, T2, T3 ); template struct FPDispatcherDispatch { typedef void ( MainClass::*FnT )( T0, T1, T2, T3 ); static const int arity = 4; typedef void ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue /*t*/, FPValue& /*result*/, FPParams* p ) { ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ) ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - void function( T0, T1, T2, T3 ); with time template struct FPDispatcherDispatch { typedef void ( MainClass::*FnT )( T0, T1, T2, T3, FPTimeValue ); static const int arity = 4; typedef void ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& /*result*/, FPParams* p ) { ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), t ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - RT function( T0, T1, T2, T3 ); template struct FPDispatcherDispatch { typedef RT ( MainClass::*FnT )( T0, T1, T2, T3 ); static const int arity = 4; typedef typename RemoveConstRef::type ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue /*t*/, FPValue& result, FPParams* p ) { RT value = ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ) ); MaxTypeTraits::set_fpvalue( value, result ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - RT function( T0, T1, T2, T3 ); with time template struct FPDispatcherDispatch { typedef RT ( MainClass::*FnT )( T0, T1, T2, T3, FPTimeValue ); static const int arity = 4; typedef typename RemoveConstRef::type ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& result, FPParams* p ) { RT value = ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), t ); MaxTypeTraits::set_fpvalue( value, result ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - void function( T0, T1, T2, T3, T4 ); template struct FPDispatcherDispatch { typedef void ( MainClass::*FnT )( T0, T1, T2, T3, T4 ); static const int arity = 5; typedef void ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; typedef typename RemoveConstRef::type Arg4Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue /*t*/, FPValue& /*result*/, FPParams* p ) { ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), MaxTypeTraits::to_type( p->params[4] ) ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[4].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - void function( T0, T1, T2, T3, T4 ); with time template struct FPDispatcherDispatch { typedef void ( MainClass::*FnT )( T0, T1, T2, T3, T4, FPTimeValue ); static const int arity = 5; typedef void ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; typedef typename RemoveConstRef::type Arg4Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& /*result*/, FPParams* p ) { ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), MaxTypeTraits::to_type( p->params[4] ), t ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[4].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - RT function( T0, T1, T2, T3, T4 ); template struct FPDispatcherDispatch { typedef RT ( MainClass::*FnT )( T0, T1, T2, T3, T4 ); static const int arity = 5; typedef typename RemoveConstRef::type ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; typedef typename RemoveConstRef::type Arg4Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue /*t*/, FPValue& result, FPParams* p ) { RT value = ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), MaxTypeTraits::to_type( p->params[4] ) ); MaxTypeTraits::set_fpvalue( value, result ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[4].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - RT function( T0, T1, T2, T3, T4 ); with time template struct FPDispatcherDispatch { typedef RT ( MainClass::*FnT )( T0, T1, T2, T3, T4, FPTimeValue ); static const int arity = 5; typedef typename RemoveConstRef::type ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; typedef typename RemoveConstRef::type Arg4Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& result, FPParams* p ) { RT value = ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), MaxTypeTraits::to_type( p->params[4] ), t ); MaxTypeTraits::set_fpvalue( value, result ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[4].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // HERE // dispatcher for - void function( T0, T1, T2, T3, T4, T5 ); template struct FPDispatcherDispatch { typedef void ( MainClass::*FnT )( T0, T1, T2, T3, T4, T5 ); static const int arity = 6; typedef void ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; typedef typename RemoveConstRef::type Arg4Type; typedef typename RemoveConstRef::type Arg5Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue /*t*/, FPValue& /*result*/, FPParams* p ) { ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), MaxTypeTraits::to_type( p->params[4] ), MaxTypeTraits::to_type( p->params[5] ) ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[4].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[5].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - void function( T0, T1, T2, T3, T4, T5 ); with time template struct FPDispatcherDispatch { typedef void ( MainClass::*FnT )( T0, T1, T2, T3, T4, T5, FPTimeValue ); static const int arity = 6; typedef void ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; typedef typename RemoveConstRef::type Arg4Type; typedef typename RemoveConstRef::type Arg5Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& /*result*/, FPParams* p ) { ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), MaxTypeTraits::to_type( p->params[4] ), MaxTypeTraits::to_type( p->params[5] ), t ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[4].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[5].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - RT function( T0, T1, T2, T3, T4, T5 ); template struct FPDispatcherDispatch { typedef RT ( MainClass::*FnT )( T0, T1, T2, T3, T4, T5 ); static const int arity = 6; typedef typename RemoveConstRef::type ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; typedef typename RemoveConstRef::type Arg4Type; typedef typename RemoveConstRef::type Arg5Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue /*t*/, FPValue& result, FPParams* p ) { RT value = ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), MaxTypeTraits::to_type( p->params[4] ), MaxTypeTraits::to_type( p->params[5] ) ); MaxTypeTraits::set_fpvalue( value, result ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[4].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[5].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - RT function( T0, T1, T2, T3, T4, T5 ); with time template struct FPDispatcherDispatch { typedef RT ( MainClass::*FnT )( T0, T1, T2, T3, T4, T5, FPTimeValue ); static const int arity = 6; typedef typename RemoveConstRef::type ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; typedef typename RemoveConstRef::type Arg4Type; typedef typename RemoveConstRef::type Arg5Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& result, FPParams* p ) { RT value = ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), MaxTypeTraits::to_type( p->params[4] ), MaxTypeTraits::to_type( p->params[5] ), t ); MaxTypeTraits::set_fpvalue( value, result ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[4].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[5].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - void function( T0, T1, T2, T3, T4, T5, T6 ); without time template struct FPDispatcherDispatch { typedef void ( MainClass::*FnT )( T0, T1, T2, T3, T4, T5, T6 ); static const int arity = 7; typedef void ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; typedef typename RemoveConstRef::type Arg4Type; typedef typename RemoveConstRef::type Arg5Type; typedef typename RemoveConstRef::type Arg6Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& /*result*/, FPParams* p ) { ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), MaxTypeTraits::to_type( p->params[4] ), MaxTypeTraits::to_type( p->params[5] ), MaxTypeTraits::to_type( p->params[6] ), ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[4].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[5].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[6].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - void function( T0, T1, T2, T3, T4, T5, T6 ); with time template struct FPDispatcherDispatch { typedef void ( MainClass::*FnT )( T0, T1, T2, T3, T4, T5, T6, FPTimeValue ); static const int arity = 7; typedef void ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; typedef typename RemoveConstRef::type Arg4Type; typedef typename RemoveConstRef::type Arg5Type; typedef typename RemoveConstRef::type Arg6Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& /*result*/, FPParams* p ) { ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), MaxTypeTraits::to_type( p->params[4] ), MaxTypeTraits::to_type( p->params[5] ), MaxTypeTraits::to_type( p->params[6] ), t ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[4].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[5].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[6].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - RT function( T0, T1, T2, T3, T4, T5, T6 ); without time template struct FPDispatcherDispatch { typedef RT ( MainClass::*FnT )( T0, T1, T2, T3, T4, T5, T6 ); static const int arity = 7; typedef typename RemoveConstRef::type ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; typedef typename RemoveConstRef::type Arg4Type; typedef typename RemoveConstRef::type Arg5Type; typedef typename RemoveConstRef::type Arg6Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& result, FPParams* p ) { RT value = ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), MaxTypeTraits::to_type( p->params[4] ), MaxTypeTraits::to_type( p->params[5] ), MaxTypeTraits::to_type( p->params[6] ), ); MaxTypeTraits::set_fpvalue( value, result ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[4].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[5].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[6].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - RT function( T0, T1, T2, T3, T4, T5, T6 ); with time template struct FPDispatcherDispatch { typedef RT ( MainClass::*FnT )( T0, T1, T2, T3, T4, T5, T6, FPTimeValue ); static const int arity = 7; typedef typename RemoveConstRef::type ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; typedef typename RemoveConstRef::type Arg4Type; typedef typename RemoveConstRef::type Arg5Type; typedef typename RemoveConstRef::type Arg6Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& result, FPParams* p ) { RT value = ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), MaxTypeTraits::to_type( p->params[4] ), MaxTypeTraits::to_type( p->params[5] ), MaxTypeTraits::to_type( p->params[6] ), t ); MaxTypeTraits::set_fpvalue( value, result ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[4].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[5].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[6].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - void function( T0, T1, T2, T3, T4, T5, T6, T7 ); without time template struct FPDispatcherDispatch { typedef void ( MainClass::*FnT )( T0, T1, T2, T3, T4, T5, T6, T7 ); static const int arity = 8; typedef void ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; typedef typename RemoveConstRef::type Arg4Type; typedef typename RemoveConstRef::type Arg5Type; typedef typename RemoveConstRef::type Arg6Type; typedef typename RemoveConstRef::type Arg7Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& /*result*/, FPParams* p ) { ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), MaxTypeTraits::to_type( p->params[4] ), MaxTypeTraits::to_type( p->params[5] ), MaxTypeTraits::to_type( p->params[6] ), MaxTypeTraits::to_type( p->params[7] ), ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[4].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[5].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[6].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[7].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - void function( T0, T1, T2, T3, T4, T5, T6, T7 ); with time template struct FPDispatcherDispatch { typedef void ( MainClass::*FnT )( T0, T1, T2, T3, T4, T5, T6, T7, FPTimeValue ); static const int arity = 8; typedef void ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; typedef typename RemoveConstRef::type Arg4Type; typedef typename RemoveConstRef::type Arg5Type; typedef typename RemoveConstRef::type Arg6Type; typedef typename RemoveConstRef::type Arg7Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& /*result*/, FPParams* p ) { ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), MaxTypeTraits::to_type( p->params[4] ), MaxTypeTraits::to_type( p->params[5] ), MaxTypeTraits::to_type( p->params[6] ), MaxTypeTraits::to_type( p->params[7] ), t ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[4].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[5].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[6].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[7].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - RT function( T0, T1, T2, T3, T4, T5, T6, T7 ); without time template struct FPDispatcherDispatch { typedef RT ( MainClass::*FnT )( T0, T1, T2, T3, T4, T5, T6, T7 ); static const int arity = 8; typedef typename RemoveConstRef::type ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; typedef typename RemoveConstRef::type Arg4Type; typedef typename RemoveConstRef::type Arg5Type; typedef typename RemoveConstRef::type Arg6Type; typedef typename RemoveConstRef::type Arg7Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& result, FPParams* p ) { RT value = ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), MaxTypeTraits::to_type( p->params[4] ), MaxTypeTraits::to_type( p->params[5] ), MaxTypeTraits::to_type( p->params[6] ), MaxTypeTraits::to_type( p->params[7] ) ); MaxTypeTraits::set_fpvalue( value, result ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[4].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[5].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[6].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[7].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - RT function( T0, T1, T2, T3, T4, T5, T6, T7 ); with time template struct FPDispatcherDispatch { typedef RT ( MainClass::*FnT )( T0, T1, T2, T3, T4, T5, T6, T7, FPTimeValue ); static const int arity = 8; typedef typename RemoveConstRef::type ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; typedef typename RemoveConstRef::type Arg4Type; typedef typename RemoveConstRef::type Arg5Type; typedef typename RemoveConstRef::type Arg6Type; typedef typename RemoveConstRef::type Arg7Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& result, FPParams* p ) { RT value = ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), MaxTypeTraits::to_type( p->params[4] ), MaxTypeTraits::to_type( p->params[5] ), MaxTypeTraits::to_type( p->params[6] ), MaxTypeTraits::to_type( p->params[7] ), t ); MaxTypeTraits::set_fpvalue( value, result ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[4].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[5].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[6].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[7].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - void function( T0, T1, T2, T3, T4, T5, T6, T7, T8 ); without time template struct FPDispatcherDispatch { typedef void ( MainClass::*FnT )( T0, T1, T2, T3, T4, T5, T6, T7, T8 ); static const int arity = 9; typedef void ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; typedef typename RemoveConstRef::type Arg4Type; typedef typename RemoveConstRef::type Arg5Type; typedef typename RemoveConstRef::type Arg6Type; typedef typename RemoveConstRef::type Arg7Type; typedef typename RemoveConstRef::type Arg8Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& /*result*/, FPParams* p ) { ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), MaxTypeTraits::to_type( p->params[4] ), MaxTypeTraits::to_type( p->params[5] ), MaxTypeTraits::to_type( p->params[6] ), MaxTypeTraits::to_type( p->params[7] ), MaxTypeTraits::to_type( p->params[8] ) ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[4].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[5].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[6].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[7].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[8].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - void function( T0, T1, T2, T3, T4, T5, T6, T7, T8 ); with time template struct FPDispatcherDispatch { typedef void ( MainClass::*FnT )( T0, T1, T2, T3, T4, T5, T6, T7, T8, FPTimeValue ); static const int arity = 9; typedef void ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; typedef typename RemoveConstRef::type Arg4Type; typedef typename RemoveConstRef::type Arg5Type; typedef typename RemoveConstRef::type Arg6Type; typedef typename RemoveConstRef::type Arg7Type; typedef typename RemoveConstRef::type Arg8Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& /*result*/, FPParams* p ) { ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), MaxTypeTraits::to_type( p->params[4] ), MaxTypeTraits::to_type( p->params[5] ), MaxTypeTraits::to_type( p->params[6] ), MaxTypeTraits::to_type( p->params[7] ), MaxTypeTraits::to_type( p->params[8] ), t ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[4].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[5].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[6].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[7].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[8].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - RT function( T0, T1, T2, T3, T4, T5, T6, T7, T8 ); without time template struct FPDispatcherDispatch { typedef RT ( MainClass::*FnT )( T0, T1, T2, T3, T4, T5, T6, T7, T8 ); static const int arity = 9; typedef typename RemoveConstRef::type ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; typedef typename RemoveConstRef::type Arg4Type; typedef typename RemoveConstRef::type Arg5Type; typedef typename RemoveConstRef::type Arg6Type; typedef typename RemoveConstRef::type Arg7Type; typedef typename RemoveConstRef::type Arg8Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& result, FPParams* p ) { RT value = ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), MaxTypeTraits::to_type( p->params[4] ), MaxTypeTraits::to_type( p->params[5] ), MaxTypeTraits::to_type( p->params[6] ), MaxTypeTraits::to_type( p->params[7] ), MaxTypeTraits::to_type( p->params[8] ), ); MaxTypeTraits::set_fpvalue( value, result ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[4].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[5].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[6].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[7].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[8].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // dispatcher for - RT function( T0, T1, T2, T3, T4, T5, T6, T7, T8 ); with time template struct FPDispatcherDispatch { typedef RT ( MainClass::*FnT )( T0, T1, T2, T3, T4, T5, T6, T7, T8, FPTimeValue ); static const int arity = 9; typedef typename RemoveConstRef::type ReturnType; typedef typename RemoveConstRef::type Arg0Type; typedef typename RemoveConstRef::type Arg1Type; typedef typename RemoveConstRef::type Arg2Type; typedef typename RemoveConstRef::type Arg3Type; typedef typename RemoveConstRef::type Arg4Type; typedef typename RemoveConstRef::type Arg5Type; typedef typename RemoveConstRef::type Arg6Type; typedef typename RemoveConstRef::type Arg7Type; typedef typename RemoveConstRef::type Arg8Type; inline static void dispatch( FnT function, MainClass* obj, TimeValue t, FPValue& result, FPParams* p ) { RT value = ( obj->*function )( MaxTypeTraits::to_type( p->params[0] ), MaxTypeTraits::to_type( p->params[1] ), MaxTypeTraits::to_type( p->params[2] ), MaxTypeTraits::to_type( p->params[3] ), MaxTypeTraits::to_type( p->params[4] ), MaxTypeTraits::to_type( p->params[5] ), MaxTypeTraits::to_type( p->params[6] ), MaxTypeTraits::to_type( p->params[7] ), MaxTypeTraits::to_type( p->params[8] ), t ); MaxTypeTraits::set_fpvalue( value, result ); } inline static void add_descriptor_argument_varargs( make_varargs& va, const std::vector& paramNames ) { va.add_values( paramNames[0].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[1].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[2].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[3].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[4].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[5].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[6].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[7].c_str(), 0, MaxTypeTraits::type_enum() ); va.add_values( paramNames[8].c_str(), 0, MaxTypeTraits::type_enum() ); } }; // ------------- The container class which holds the function pointer and knows how to dispatch it // dispatcher for - void function(); template class FPDispatcherImpl : public FPDispatcher { FnT m_function; public: static const int arity = FPDispatcherDispatch::arity; typedef typename FPDispatcherDispatch::ReturnType ReturnType; FPDispatcherImpl( const FnT& function, FunctionID fid, const frantic::tstring& name, const std::vector& paramNames ) : m_function( function ) { m_fid = fid; m_name = name; m_paramNames = paramNames; } void dispatch( MainClass* obj, TimeValue t, FPValue& result, FPParams* p ) { assert( arity == 0 || p != 0 ); #if MAX_VERSION_MAJOR < 15 assert( ( arity == 0 && p == 0 ) || p->params.Count() == arity ); #else assert( ( arity == 0 && p == 0 ) || p->params.length() == arity ); #endif try { FPDispatcherDispatch::dispatch( m_function, obj, t, result, p ); } catch( std::exception& e ) { const frantic::tstring msg = frantic::strings::to_tstring( e.what() ); throw MAXException( const_cast( msg.c_str() ) ); } } virtual void add_descriptor_varargs( make_varargs& va ) { // add the varargs specifying the function va.add_values( m_fid, m_name.c_str(), 0, MaxTypeTraits::type_enum(), 0, arity ); // and then the varargs specifying each argument FPDispatcherDispatch::add_descriptor_argument_varargs( va, m_paramNames ); } }; } // namespace fpwrapper } // namespace max3d } // namespace frantic