LLVM 20.0.0git
|
Class you can specialize to provide custom retain/release functionality for a type. More...
#include "llvm/ADT/IntrusiveRefCntPtr.h"
Static Public Member Functions | |
static unsigned | useCount (const T *obj) |
static void | retain (T *obj) |
static void | release (T *obj) |
Class you can specialize to provide custom retain/release functionality for a type.
Usually specializing this class is not necessary, as IntrusiveRefCntPtr works with any type which defines Retain() and Release() functions – you can define those functions yourself if RefCountedBase doesn't work for you.
One case when you might want to specialize this type is if you have
Because Foo.h includes Bar.h, Bar.h can't include Foo.h in order to pull in the declaration of Foo. Without the declaration of Foo, normally Bar.h wouldn't be able to use IntrusiveRefCntPtr<Foo>, which wants to call T::Retain and T::Release.
To resolve this, Bar.h could include a third header, FooFwd.h, which forward-declares Foo and specializes IntrusiveRefCntPtrInfo<Foo>. Then Bar.h could use IntrusiveRefCntPtr<Foo>, although it still couldn't call any functions on Foo itself, because Foo would be an incomplete type.
Definition at line 161 of file IntrusiveRefCntPtr.h.
|
inlinestatic |
Definition at line 164 of file IntrusiveRefCntPtr.h.
|
inlinestatic |
Definition at line 163 of file IntrusiveRefCntPtr.h.
|
inlinestatic |
Definition at line 162 of file IntrusiveRefCntPtr.h.
Referenced by llvm::IntrusiveRefCntPtr< T >::useCount().