pointer.cpp

changeset 22
335e430a6b4f
parent 21
9aebaaafa5da
child 23
69a91c1ff583
--- a/pointer.cpp	Sat Mar 16 16:59:16 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-#include "pointer.h"
-
-vector<objPointer*> g_pObjectPointers;
-
-void objPointer::replacePointers (LDObject* old, LDObject* repl) {
-	for (ulong i = 0; i < g_pObjectPointers.size(); ++i) {
-		objPointer* ptrptr = g_pObjectPointers[i];
-		
-		if ((*ptrptr).ptr == old)
-			(*ptrptr).ptr = repl;
-	}
-}
-
-objPointer::~objPointer () {
-	
-}
-
-objPointer::objPointer () {
-	ptr = nullptr;
-}
-
-objPointer::objPointer (LDObject* _ptr) {
-	ptr = _ptr;
-}
-
-void objPointer::serialize () {
-	g_pObjectPointers.push_back (this);
-}
-
-void objPointer::unSerialize () {
-	for (ulong i = 0; i < g_pObjectPointers.size(); ++i)
-		if (g_pObjectPointers[i] == this)
-			g_pObjectPointers.erase (g_pObjectPointers.begin() + i);
-}
-
-void objPointer::deleteObj (LDObject* obj) {
-	replacePointers (obj, nullptr);
-	delete obj;
-}
\ No newline at end of file

mercurial