summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2014-11-13 16:42:36 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2014-11-13 16:42:36 +0100
commita994f02d3c204731a0e811ce9454e6bb0f1dc1e8 (patch)
tree9af17530e887c59e1fe61d3fc3b70f93455b5e96
parent212ee73e4d810679388cf988f125c3e86c5806b3 (diff)
allow the Handle class to be converted to const pointers
-rw-r--r--src/core/dom/Managed.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/dom/Managed.hpp b/src/core/dom/Managed.hpp
index 4c8f951..aab18a5 100644
--- a/src/core/dom/Managed.hpp
+++ b/src/core/dom/Managed.hpp
@@ -372,11 +372,21 @@ public:
T *operator->() { return ptr; }
/**
+ * Provides access to the underlying managed object for immutable handles.
+ */
+ const T *operator->() const { return ptr; }
+
+ /**
* Provides access to the underlying managed object.
*/
T &operator*() { return *ptr; }
/**
+ * Provides access to the underlying managed object for immutable handles.
+ */
+ const T &operator*() const { return *ptr; }
+
+ /**
* Comparison operator between base Owned and base Owned.
*/
bool operator==(const Handle &h) const { return ptr == h.ptr; }
@@ -676,6 +686,7 @@ public:
*/
Managed *getOwner() const { return owner; }
};
+
}
}