MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / Abstract_obj

Class Abstract_obj

src/hx/CFFI.cpp:22–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20{
21
22class Abstract_obj : public Object
23{
24public:
25 HX_IS_INSTANCE_OF enum { _hx_ClassId = hx::clsIdAbstract };
26
27 Abstract_obj(int inType,void *inData)
28 {
29 mType = inType;
30 mHandle = inData;
31 mFinalizer = 0;
32 mMarkSize = 0;
33 }
34
35 Abstract_obj(int inType,int inSize, finalizer inFinalizer)
36 {
37 mType = inType;
38 mFinalizer = 0;
39 mMarkSize = 0;
40 mHandle = 0;
41 if (inSize)
42 {
43 mMarkSize = inSize;
44 mHandle = HxAlloc(inSize);
45 memset(mHandle,0,mMarkSize);
46 }
47
48 SetFinalizer(inFinalizer);
49 }
50
51
52 int __GetType() const HXCPP_OVERRIDE { return mType; }
53 hx::ObjectPtr<hx::Class_obj> __GetClass() const HXCPP_OVERRIDE { return 0; }
54 virtual bool __IsClass(hx::Class inClass ) const { return false; }
55
56 void *__GetHandle() const HXCPP_OVERRIDE
57 {
58 return mHandle;
59 }
60
61 void __Mark(hx::MarkContext *__inCtx) HXCPP_OVERRIDE
62 {
63 HX_MARK_MEMBER(_hxcpp_toString);
64 if (mMarkSize>=sizeof(void *) && mHandle)
65 {
66 hx::MarkConservative((int *)mHandle, ((int *)mHandle) + (mMarkSize/sizeof(int)), __inCtx );
67 }
68 }
69
70 #ifdef HXCPP_VISIT_ALLOCS
71 void __Visit(hx::VisitContext *__inCtx) HXCPP_OVERRIDE
72 {
73 HX_VISIT_MEMBER(_hxcpp_toString);
74 if (mFinalizer)
75 mFinalizer->Visit(__inCtx);
76 }
77 #endif
78
79 void SetFinalizer(finalizer inFinalizer)

Callers

nothing calls this directly

Calls 2

__hxcpp_get_kindFunction · 0.85
DynamicClass · 0.50

Tested by

no test coverage detected