X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Frefptr.h;h=0328340eb242242b29fa614d0b7b815eddcc8f3b;hb=cc541830f00cc3238edb82ff2e14e8b9060645b6;hp=20450f1b412462e60d10c92b0de7c72b858c6cca;hpb=b56eb5ec1da675da0c66abc53c1e4f6c4e4cccbd;p=libs%2Fcore.git diff --git a/source/core/refptr.h b/source/core/refptr.h index 20450f1..0328340 100644 --- a/source/core/refptr.h +++ b/source/core/refptr.h @@ -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 static RefPtr cast_dynamic(const RefPtr &p) { return RefPtr(dynamic_cast(p.data), p.count); }