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>
79#define ML_REFCOUNTED_PTR(CLASSNAME) \
81 typedef ::boost::intrusive_ptr<CLASSNAME> CLASSNAME##Ptr; \
82 typedef ::boost::intrusive_ptr<const CLASSNAME> CLASSNAME##ConstPtr;
Class representing general ML objects that support import/export via strings (setPersistentState() an...
EventSourceBase class adds event listener handling to Base.
RefCountedBase class adds intrusive reference counting support to the Base class.
virtual void incRefCount() const
Increase reference count.
~RefCountedBase() override
Macro for the declaration of the runtime type system methods, defined in mlRuntimeSubClass....
static void updateReferenceCountingIfSupported(Base *oldValue, Base *newValue, bool &isRefCountedBase)
Helper method that handles inc/dec of ref count if base instances support it.
virtual void decRefCount() const
Decrease ref count (object will be deleted if ref count is decremented to 0)
RefCountedBase(const RefCountedBase &)
Explicit copy constructor.
bool isRefCountedBase() const override
Returns if the instance is derived from RefCountedBase.
MLint32 _refCount
Reference count.
RefCountedBase()
Constructor.
#define ML_ABSTRACT_CLASS_HEADER(className)
Same like ML_ABSTRACT_CLASS_HEADER_EXPORTED with a non existing export symbol.
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)
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
#define ML_REFCOUNTED_PTR(CLASSNAME)
Macro that defines convenience Ptr/ConstPtr typedefs to be used instead of intrusive_ptr templates.
#define ML_UTILS_EXPORT
Defines platform dependent DLL export macro for mlUtils.