11 #include <angelscript.h>
14 #if !defined(RefCoutingObjectPtr_DEBUGTRACE)
15 # define RefCoutingObjectPtr_DEBUGTRACE(_Expr)
18 #if !defined(RefCountingObjectPtr_ASSERT)
20 # define RefCountingObjectPtr_ASSERT(_Expr_) assert(_Expr_)
56 operator long long()
const {
return reinterpret_cast<long long>(
m_ref); }
59 void EnumReferences(AS_NAMESPACE_QUALIFIER asIScriptEngine *engine);
87 const size_t DECLBUF_MAX = 300;
88 char decl_buf[DECLBUF_MAX];
90 #if defined(AS_USE_NAMESPACE)
91 using namespace AngelScript;
99 snprintf(decl_buf, DECLBUF_MAX,
"void f(%s @&in)", obj_name);
101 snprintf(decl_buf, DECLBUF_MAX,
"void f(const %s &in)", handle_name);
110 snprintf(decl_buf, DECLBUF_MAX,
"%s @ opImplCast()", obj_name);
114 snprintf(decl_buf, DECLBUF_MAX,
"%s @ getHandle()", obj_name);
118 snprintf(decl_buf, DECLBUF_MAX,
"%s &opHndlAssign(const %s &in)", handle_name, handle_name);
120 snprintf(decl_buf, DECLBUF_MAX,
"%s &opHndlAssign(const %s @&in)", handle_name, obj_name);
124 snprintf(decl_buf, DECLBUF_MAX,
"bool opEquals(const %s &in) const", handle_name);
126 snprintf(decl_buf, DECLBUF_MAX,
"bool opEquals(const %s @&in) const", obj_name);
137 return static_cast<T*
>(*objhandle);
143 T* ref = DereferenceHandle(objhandle);
154 T* ref =
self->GetRef();
163 T* ref = DereferenceHandle(objhandle);
171 T* ref = DereferenceHandle(objhandle);
172 return self->GetRef() == ref;
252 inEngine->GCEnumCallback(m_ref);