Huge engine change, replace all std::shared_ptrs

Create a new shared pointer type stdext::shared_object_ptr and stdext::shared_obj
using boost::intrusive_ptr

Advantages:
 * half memory usage
 * faster and lightweight

Disadvantages:
 * using weak_ptr is not supported anymore
 * compiling seems slower
This commit is contained in:
Eduardo Bart
2012-07-29 00:34:40 -03:00
parent 3ca6494343
commit e0431021b5
81 changed files with 314 additions and 336 deletions

View File

@@ -24,6 +24,8 @@
#define UIWIDGET_H
#include "declarations.h"
#include "uilayout.h"
#include <framework/luaengine/luaobject.h>
#include <framework/graphics/declarations.h>
#include <framework/otml/otmlnode.h>
@@ -68,7 +70,7 @@ protected:
Boolean<false> m_destroyed;
Boolean<false> m_clipping;
UILayoutPtr m_layout;
UIWidgetWeakPtr m_parent;
UIWidgetPtr m_parent;
UIWidgetList m_children;
UIWidgetList m_lockedChildren;
UIWidgetPtr m_focusedChild;
@@ -152,8 +154,6 @@ public:
UIWidgetList recursiveGetChildrenByMarginPos(const Point& childPos);
UIWidgetPtr backwardsGetWidgetById(const std::string& id);
UIWidgetPtr asUIWidget() { return std::static_pointer_cast<UIWidget>(shared_from_this()); }
private:
Boolean<false> m_updateEventScheduled;
Boolean<false> m_loadingStyle;
@@ -248,7 +248,7 @@ public:
bool containsPoint(const Point& point) { return m_rect.contains(point); }
std::string getId() { return m_id; }
UIWidgetPtr getParent() { return m_parent.lock(); }
UIWidgetPtr getParent() { return m_parent; }
UIWidgetPtr getFocusedChild() { return m_focusedChild; }
UIWidgetList getChildren() { return m_children; }
UIWidgetPtr getFirstChild() { return getChildByIndex(1); }