]> 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 20450f1b412462e60d10c92b0de7c72b858c6cca..0328340eb242242b29fa614d0b7b815eddcc8f3b 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspcore
-Copyright © 2006-2007, 2010-2011 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifndef MSP_CORE_REFPTR_H_
 #define MSP_CORE_REFPTR_H_
 
@@ -95,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); }