]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/refptr.h
Add a refcount function to RefPtr
[libs/core.git] / source / core / refptr.h
index d245b34a7e90bab8fb14f5e26cc691a1385f761c..0328340eb242242b29fa614d0b7b815eddcc8f3b 100644 (file)
@@ -88,6 +88,8 @@ public:
        T *operator->() const { return data; }
        operator bool() const { return data!=0; }
 
+       unsigned refcount() const { return (data ? *count : 0); }
+
        template<typename U>
        static RefPtr<T> cast_dynamic(const RefPtr<U> &p)
        { return RefPtr<T>(dynamic_cast<T *>(p.data), p.count); }