13#ifndef ML_REF_COUNTED_BASE_H
14#define ML_REF_COUNTED_BASE_H
20#include <ThirdPartyWarningsDisable.h>
21#include <boost/intrusive_ptr.hpp>
22#include <ThirdPartyWarningsRestore.h>
80#define ML_REFCOUNTED_PTR(CLASSNAME) \
82 typedef ::boost::intrusive_ptr<CLASSNAME> CLASSNAME##Ptr; \
83 typedef ::boost::intrusive_ptr<const CLASSNAME> CLASSNAME##ConstPtr;
virtual void incRefCount() const
Increases the reference count.
~RefCountedBase() override
Destructor.
static void updateReferenceCountingIfSupported(Base *oldValue, Base *newValue, bool &isRefCountedBase)
virtual void decRefCount() const
Decreases the reference count (object will be deleted if the reference count is decremented to 0).
RefCountedBase(const RefCountedBase &)
Explicit copy constructor.
bool isRefCountedBase() const override
Returns whether the instance is derived from RefCountedBase.
RefCountedBase()
Constructor.
std::atomic_int_least32_t _refCount
Reference count.
#define ML_ABSTRACT_CLASS_HEADER(className)
void intrusive_ptr_add_ref(const IntrusivePtrBase< Derived > *ptr)
Provide overloads for reference counting functions used by boost::intrusive_ptr.
void intrusive_ptr_release(const IntrusivePtrBase< Derived > *ptr)
#define ML_REFCOUNTED_PTR(CLASSNAME)
Macro that defines convenience Ptr/ConstPtr typedefs to be used instead of intrusive_ptr templates.