Implement the pure typename meta-methods in chrono types using the standard method.

This commit is contained in:
Sandu Liviu Catalin
2016-11-15 21:20:33 +02:00
parent 27af2cfd3c
commit 60d6a96e07
8 changed files with 23 additions and 45 deletions
+5 -1
View File
@@ -6,6 +6,9 @@
// ------------------------------------------------------------------------------------------------
namespace SqMod {
// ------------------------------------------------------------------------------------------------
SQMODE_DECL_TYPENAME(Typename, _SC("SqTimer"))
// ------------------------------------------------------------------------------------------------
Timer::Timer()
: m_Timestamp(Chrono::GetCurrentSysTime())
@@ -67,11 +70,12 @@ Int64 Timer::GetElapsedTimeRaw() const
// ================================================================================================
void Register_ChronoTimer(HSQUIRRELVM vm, Table & /*cns*/)
{
RootTable(vm).Bind(_SC("SqTimer"), Class< Timer >(vm, _SC("SqChronoTimer"))
RootTable(vm).Bind(Typename::Str, Class< Timer >(vm, Typename::Str)
// Constructors
.Ctor()
.Ctor< const Timer & >()
// Core Meta-methods
.SquirrelFunc(_SC("_typename"), &Typename::Fn)
.Func(_SC("_tostring"), &Timer::ToString)
.Func(_SC("_cmp"), &Timer::Cmp)
// Properties