2 #include "oxygine-include.h" 3 #include "ref_counter.h" 12 #if OBJECT_POOL_ALLOCATOR 13 void*
operator new(
size_t size);
14 void operator delete(
void* data,
size_t size);
26 const std::string& getName()
const;
27 const void* getUserData()
const {
return __userData;}
28 int getObjectID()
const {
return __id;}
29 bool isName(
const std::string& name)
const;
30 bool isName(
const char* name)
const;
34 void setName(
const std::string& name);
35 void setUserData(
const void* data) {__userData = data;}
37 void dumpObject()
const;
47 typedef std::vector<ObjectBase*> __createdObjects;
48 static __createdObjects& __getCreatedObjects();
50 static void __startTracingLeaks();
51 static void __stopTracingLeaks();
52 void __removeFromDebugList();
56 static void __addToDebugList(
ObjectBase* base);
57 static void __removeFromDebugList(
ObjectBase* base);
60 #if DYNAMIC_OBJECT_NAME 62 mutable std::string* __name;
64 mutable std::string __name;
66 std::string* __getName()
const;
67 void __freeName()
const;
70 const void* __userData;
73 #ifdef OXYGINE_DEBUG_TRACE_LEAKS 78 static int _assertCtorID;
79 static int _assertDtorID;
82 DECLARE_SMART(
Object, spObject);
87 Object(
bool assignUniqueID =
true);
99 template <
class dest,
class src>
100 dest safeCast(src ptr)
104 #ifdef OXYGINE_DEBUG_SAFECAST 105 dest cast =
dynamic_cast<dest
>(ptr);
106 OX_ASSERT(cast &&
"can't cast pointer");
109 return static_cast<dest
>(ptr);
113 template<
class T,
class U>
114 intrusive_ptr<T> safeSpCast(intrusive_ptr<U>
const& p)
118 #ifdef OXYGINE_DEBUG_SAFECAST 119 intrusive_ptr<T> t =
dynamic_cast<T*
>(p.get());
120 OX_ASSERT(t &&
"can't cast pointer");
122 return static_cast<T*
>(p.get());
126 EDITOR_INCLUDE(Object);
static void dumpCreatedObjects()
static void showAssertInDtor(int id)
Definition: ref_counter.h:8
–oxgl-end–!
Definition: Actor.h:14
static void showAssertInCtor(int id)