Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZStd::IntrusivePtrCountPolicy< T > Struct Template Reference

#include <intrusive_ptr.h>

Static Public Member Functions

static AZ_FORCE_INLINE void add_ref (T *p)
 
static AZ_FORCE_INLINE void release (T *p)
 

Detailed Description

template<class T>
struct AZStd::IntrusivePtrCountPolicy< T >

By default we use object internal reference counting. We will call pObj->add_ref and pObj->release. The pointer will call class functions to do the reference counting. There is no need for ADL and you can implement your functions as you wish.

If you want external reference count (boost style), which is useful for structs or retrofitting in existing code (you don't want to change). To do so specialize IntrusivePtrCountPolicy for your object type. Example: template<> struct IntrusivePtrCountPolicy<MyObject> { static AZ_FORCE_INLINE void add_ref(MyObject* p) { your code to add a reference } static AZ_FORCE_INLINE void release(MyObject* p) { your code to remove a reference } }


The documentation for this struct was generated from the following file: