1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 00:37:15 +01:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Sandu Liviu Catalin
f4c2665e86 Update Vector.hpp 2021-08-24 19:14:37 +03:00
Sandu Liviu Catalin
31029cbaf0 "Hide" get/set tables. 2021-08-24 17:18:31 +03:00
Sandu Liviu Catalin
5ea7364a6d Update sqratClass.h 2021-08-24 17:16:24 +03:00
2 changed files with 20 additions and 4 deletions

View File

@ -164,6 +164,22 @@ template < class T > struct SqVector
{
}
/* --------------------------------------------------------------------------------------------
* Copy constructor from container.
*/
explicit SqVector(const Container & v)
: mC(Poco::makeShared< Container >(v))
{
}
/* --------------------------------------------------------------------------------------------
* Move constructor from container.
*/
explicit SqVector(Container && v) noexcept
: mC(Poco::makeShared< Container >(std::move(v)))
{
}
/* --------------------------------------------------------------------------------------------
* Move constructor.
*/

View File

@ -750,7 +750,7 @@ protected:
// add the set table (static)
HSQOBJECT& setTable = cd->setTable;
sq_resetobject(&setTable);
sq_pushstring(vm, _SC("__setTable"), -1);
sq_pushstring(vm, _SC("@set"), -1);
sq_newtable(vm);
sq_getstackobj(vm, -1, &setTable);
sq_addref(vm, &setTable);
@ -759,7 +759,7 @@ protected:
// add the get table (static)
HSQOBJECT& getTable = cd->getTable;
sq_resetobject(&getTable);
sq_pushstring(vm, _SC("__getTable"), -1);
sq_pushstring(vm, _SC("@get"), -1);
sq_newtable(vm);
sq_getstackobj(vm, -1, &getTable);
sq_addref(vm, &getTable);
@ -1033,7 +1033,7 @@ protected:
HSQOBJECT& setTable = cd->setTable;
sq_resetobject(&setTable);
sq_pushobject(vm, bd->setTable);
sq_pushstring(vm, _SC("__setTable"), -1);
sq_pushstring(vm, _SC("@set"), -1);
sq_clone(vm, -2);
sq_remove(vm, -3);
sq_getstackobj(vm, -1, &setTable);
@ -1044,7 +1044,7 @@ protected:
HSQOBJECT& getTable = cd->getTable;
sq_resetobject(&getTable);
sq_pushobject(vm, bd->getTable);
sq_pushstring(vm, _SC("__getTable"), -1);
sq_pushstring(vm, _SC("@get"), -1);
sq_clone(vm, -2);
sq_remove(vm, -3);
sq_getstackobj(vm, -1, &getTable);