]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/tracked_int_ptr: const variants
authorSage Weil <sage@redhat.com>
Tue, 17 Feb 2015 00:40:53 +0000 (16:40 -0800)
committerSage Weil <sage@redhat.com>
Tue, 17 Feb 2015 01:30:55 +0000 (17:30 -0800)
Signed-off-by: Sage Weil <sage@redhat.com>
src/common/tracked_int_ptr.hpp

index ba0900db6bd9676cb82c8e1aef0e759e4cbbc39c..e0e423835e7ab4f6c0e807aea13f0b544c75105e 100644 (file)
@@ -50,12 +50,21 @@ public:
     TrackedIntPtr o(rhs.ptr);
     swap(o);
   }
+  const T &operator*() const {
+    return *ptr;
+  }
   T &operator*() {
     return *ptr;
   }
+  const T *operator->() const {
+    return ptr;
+  }
   T *operator->() {
     return ptr;
   }
+  operator bool() const {
+    return ptr != NULL;
+  }
   bool operator<(const TrackedIntPtr &lhs) const {
     return ptr < lhs.ptr;
   }