Add classes

This commit is contained in:
2025-05-24 09:39:59 -05:00
parent 87784e1279
commit 12f443a593
16 changed files with 2389 additions and 197 deletions

View File

@@ -2,6 +2,11 @@
namespace Tesses::CrossLang
{
TNativeObject::~TNativeObject()
{
}
TNative::TNative(void* ptr,std::function<void(void*)> destroy)
{
this->ptr = ptr;
@@ -34,6 +39,18 @@ namespace Tesses::CrossLang
this->destroy(this->ptr);
}
}
bool TNativeObject::ToBool()
{
return true;
}
bool TNativeObject::Equals(GC* gc, TObject right)
{
if(std::holds_alternative<THeapObjectHolder>(right))
{
return this == std::get<THeapObjectHolder>(right).obj;
}
return false;
}
TNative* TNative::Create(GCList& ls, void* ptr,std::function<void(void*)> destroy)
{
TNative* native = new TNative(ptr,destroy);