summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 738d7f1)
raw | patch | inline | side by side (parent: 738d7f1)
author | mental <mental@users.sourceforge.net> | |
Thu, 15 May 2008 17:01:23 +0000 (17:01 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Thu, 15 May 2008 17:01:23 +0000 (17:01 +0000) |
src/lifecycle.h | patch | blob | history |
diff --git a/src/lifecycle.h b/src/lifecycle.h
index 7e37bd852b444608e2f1283baaf4d9e05fb84a17..e86697c74344879afb230d02fc4823724c1265bf 100644 (file)
--- a/src/lifecycle.h
+++ b/src/lifecycle.h
}
};
+// Wrapper for a simple pointer emulating the ManagedPtr interface
+template <typename T>
+class DumbPtr {
+public:
+ DumbPtr() : ptr(NULL) {}
+ DumbPtr(T *p) : ptr(p) {}
+ DumbPtr(DumbPtr const &other) : ptr(other.ptr) {}
+
+ operator T *() const { return ptr; }
+ T &operator*() const { return *ptr; }
+ T *operator->() const { return ptr; }
+ DumbPtr &operator=(T *p) {
+ ptr = p;
+ return *this;
+ }
+ DumbPtr &operator=(DumbPtr const &other) {
+ ptr = other.ptr;
+ return *this;
+ }
+
+private:
+ T *ptr;
+};
+
// Dummy implementation of AbstractManaged to ease migration
class DummyManaged : public virtual AbstractManaged {
protected: