|
ML Reference
|
#include <mlRefCountedBase.h>
Public Member Functions | |
| RefCountedBase () | |
| Constructor. | |
| RefCountedBase (const RefCountedBase &) | |
| Explicit copy constructor. | |
| virtual void | incRefCount () const |
| Increases the reference count. | |
| virtual void | decRefCount () const |
| Decreases the reference count (object will be deleted if the reference count is decremented to 0). | |
| bool | isRefCountedBase () const override |
| Returns whether the instance is derived from RefCountedBase. | |
| Public Member Functions inherited from ml::EventSource | |
| EventSource () | |
| EventSource (const EventSource &evSource) | |
| ~EventSource () override | |
| void | addEventListener (BaseEventCallback *cb, void *userData) |
| void | removeEventListener (BaseEventCallback *cb, void *userData) |
| bool | hasEventListeners () const |
| Public Member Functions inherited from ml::Base | |
| Base () | |
| Constructor. | |
| virtual | ~Base () |
| Destructor. | |
| virtual Base * | deepCopy () const |
| bool | isOfAllowedType (const std::vector< const RuntimeType * > &types) const |
| virtual std::string | detailString () const |
| virtual bool | implementsPersistence (PersistenceInterface) const |
| virtual std::string | persistentState () const |
| Returns a string describing the object's internal state. | |
| virtual void | setPersistentState (const std::string &state) |
| virtual void | addStateToTree (TreeNode *) const |
| Attaches the object state as children of the given parent node. | |
| virtual void | readStateFromTree (TreeNode *) |
| Reads the object state from the children of the given parent node. | |
| virtual void | writeTo (AbstractPersistenceOutputStream *) const |
| virtual void | readFrom (AbstractPersistenceInputStream *, int) |
Static Public Member Functions | |
| static void | updateReferenceCountingIfSupported (Base *oldValue, Base *newValue, bool &isRefCountedBase) |
Protected Member Functions | |
| ~RefCountedBase () override | |
| Destructor. | |
| Protected Member Functions inherited from ml::EventSource | |
| void | sendEvent (BaseEvent *event, void *skipListener=nullptr) |
Protected Attributes | |
| std::atomic_int_least32_t | _refCount |
| Reference count. | |
Additional Inherited Members | |
| Public Types inherited from ml::Base | |
| enum | PersistenceInterface { PersistenceByString , PersistenceByTreeNode , PersistenceByStream } |
| This enum describes the different persistence interfaces available. More... | |
RefCountedBase class adds intrusive reference counting support to the Base class. It should be used together with boost::intrusive_ptr and the ML_REFCOUNTED_PTR macro.
Definition at line 30 of file mlRefCountedBase.h.
| ml::RefCountedBase::RefCountedBase | ( | ) |
Constructor.
Referenced by RefCountedBase(), and updateReferenceCountingIfSupported().
| ml::RefCountedBase::RefCountedBase | ( | const RefCountedBase & | ) |
Explicit copy constructor.
References RefCountedBase().
|
overrideprotected |
Destructor.
Macro for the declaration of the runtime type system methods, defined in mlRuntimeSubClass.h.
|
virtual |
Decreases the reference count (object will be deleted if the reference count is decremented to 0).
|
virtual |
Increases the reference count.
|
inlineoverridevirtual |
Returns whether the instance is derived from RefCountedBase.
Reimplemented from ml::Base.
Definition at line 46 of file mlRefCountedBase.h.
Referenced by updateReferenceCountingIfSupported().
|
static |
Helper method that handles incrementing/decrementing of the reference count if base instances support it. It decrements the reference count of oldValue if supported and not NULL. It increments the reference count of newValue if supported and not NULL. isRefCountedBase must indicate whether oldValue supported reference counting. isRefCountedBase will be set to true if the newValue supports reference counting.
References isRefCountedBase(), and RefCountedBase().
|
mutableprotected |
Reference count.
Definition at line 64 of file mlRefCountedBase.h.