1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-02-21 20:27:13 +01:00

Update the Routine type to use the new dynamic dispatching system for metamethods.

This commit is contained in:
Sandu Liviu Catalin 2016-08-24 22:28:15 +03:00
parent 3cf8f7a24a
commit 7aafb79ba2

View File

@ -1,5 +1,6 @@
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
#include "Routine.hpp" #include "Routine.hpp"
#include "Base/DynArg.hpp"
#include "Library/Chrono.hpp" #include "Library/Chrono.hpp"
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
@ -985,10 +986,10 @@ void Register_Routine(HSQUIRRELVM vm)
RootTable(vm).Bind(_SC("SqRoutine"), RootTable(vm).Bind(_SC("SqRoutine"),
Class< Routine, NoConstructor< Routine > >(vm, _SC("SqRoutine")) Class< Routine, NoConstructor< Routine > >(vm, _SC("SqRoutine"))
// Meta-methods // Meta-methods
.Func(_SC("_tostring"), &Routine::ToString)
.SquirrelFunc(_SC("_typename"), &Routine::Typename) .SquirrelFunc(_SC("_typename"), &Routine::Typename)
// We cannot set _cmp for c++ classes so we use this instead // We cannot set _cmp for c++ classes so we use this instead
.SquirrelFunc(_SC("cmp"), &SqCmpFwd< Routine, SQInteger, SQFloat, bool, CSStr, std::nullptr_t, Routine >) .SquirrelFunc(_SC("cmp"), &SqDynArgFwd< SqDynArgCmpFn< Routine >, SQInteger, SQFloat, bool, std::nullptr_t, Routine >)
.Func(_SC("_tostring"), &Routine::ToString)
// Properties // Properties
.Prop(_SC("Tag"), &Routine::GetTag, &Routine::SetTag) .Prop(_SC("Tag"), &Routine::GetTag, &Routine::SetTag)
.Prop(_SC("Data"), &Routine::GetData, &Routine::SetData) .Prop(_SC("Data"), &Routine::GetData, &Routine::SetData)