Adds reference-counting to an object. More...
Inherited by PopupMenu::CustomComponent, and Value::ValueSource.
Public Member Functions | |
| void | incReferenceCount () noexcept |
| Increments the object's reference count. | |
| void | decReferenceCount () noexcept |
| Decreases the object's reference count. | |
| int | getReferenceCount () const noexcept |
| Returns the object's current reference count. | |
Protected Member Functions | |
| SingleThreadedReferenceCountedObject () | |
| Creates the reference-counted object (with an initial ref count of zero). | |
| virtual | ~SingleThreadedReferenceCountedObject () |
| Destructor. | |
Adds reference-counting to an object.
This is efectively a version of the ReferenceCountedObject class, but which uses a non-atomic counter, and so is not thread-safe (but which will be more efficient). For more details on how to use it, see the ReferenceCountedObject class notes.
|
protected |
Creates the reference-counted object (with an initial ref count of zero).
|
protectedvirtual |
Destructor.
References jassert.
|
noexcept |
Increments the object's reference count.
This is done automatically by the smart pointer, but is public just in case it's needed for nefarious purposes.
|
noexcept |
Decreases the object's reference count.
If the count gets to zero, the object will be deleted.
References jassert.
|
noexcept |
Returns the object's current reference count.