mirror of
https://onedev.site.tesses.net/crosslang
synced 2026-02-09 01:25:45 +00:00
Add classes
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user