struct IntrusiveRefCntPtrInfo

Declaration

template <typename T>
struct IntrusiveRefCntPtrInfo { /* full declaration omitted */ };

Description

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 - Foo.h defines type Foo and includes Bar.h, and - Bar.h uses IntrusiveRefCntPtr <Foo > in inline functions. 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.

Declared at: llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:157

Templates

T

Method Overview

  • public static void release(T * obj)
  • public static void retain(T * obj)

Methods

static void release(T* obj)

Declared at: llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:159

Parameters

T* obj

static void retain(T* obj)

Declared at: llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:158

Parameters

T* obj