OpenShot Library | libopenshot-audio
0.1.9
|
A base class which provides methods for reference-counting. More...
#include <juce_ReferenceCountedObject.h>
Public Member Functions | |
void | incReferenceCount () noexcept |
Increments the object's reference count. More... | |
void | decReferenceCount () noexcept |
Decreases the object's reference count. More... | |
bool | decReferenceCountWithoutDeleting () noexcept |
Decreases the object's reference count. More... | |
int | getReferenceCount () const noexcept |
Returns the object's current reference count. More... | |
Protected Member Functions | |
ReferenceCountedObject ()=default | |
Creates the reference-counted object (with an initial ref count of zero). More... | |
ReferenceCountedObject (const ReferenceCountedObject &) noexcept | |
Copying from another object does not affect this one's reference-count. More... | |
ReferenceCountedObject (ReferenceCountedObject &&) noexcept | |
Copying from another object does not affect this one's reference-count. More... | |
ReferenceCountedObject & | operator= (const ReferenceCountedObject &) noexcept |
Copying from another object does not affect this one's reference-count. More... | |
ReferenceCountedObject & | operator= (ReferenceCountedObject &&) noexcept |
Copying from another object does not affect this one's reference-count. More... | |
virtual | ~ReferenceCountedObject () |
Destructor. More... | |
void | resetReferenceCount () noexcept |
Resets the reference count to zero without deleting the object. More... | |
Friends | |
struct | ContainerDeletePolicy< ReferenceCountedObject > |
A base class which provides methods for reference-counting.
To add reference-counting to a class, derive it from this class, and use the ReferenceCountedObjectPtr class to point to it.
e.g.
Once a new ReferenceCountedObject has been assigned to a pointer, be careful not to delete the object manually.
This class uses an Atomic<int> value to hold the reference count, so that the pointers can be passed between threads safely. For a faster but non-thread-safe version, use SingleThreadedReferenceCountedObject instead.
Definition at line 64 of file juce_ReferenceCountedObject.h.
|
protecteddefault |
Creates the reference-counted object (with an initial ref count of zero).
|
inlineprotectednoexcept |
Copying from another object does not affect this one's reference-count.
Definition at line 109 of file juce_ReferenceCountedObject.h.
|
inlineprotectednoexcept |
Copying from another object does not affect this one's reference-count.
Definition at line 111 of file juce_ReferenceCountedObject.h.
|
inlineprotectedvirtual |
Destructor.
Definition at line 118 of file juce_ReferenceCountedObject.h.
|
inlinenoexcept |
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.
Definition at line 73 of file juce_ReferenceCountedObject.h.
Referenced by juce::var::~var().
|
inlinenoexcept |
Decreases the object's reference count.
If the count gets to zero, the object will be deleted.
Definition at line 81 of file juce_ReferenceCountedObject.h.
|
inlinenoexcept |
Decreases the object's reference count.
If the count gets to zero, the object will not be deleted, but this method will return true, allowing the caller to take care of deletion.
Definition at line 93 of file juce_ReferenceCountedObject.h.
|
inlinenoexcept |
Returns the object's current reference count.
Definition at line 100 of file juce_ReferenceCountedObject.h.
|
inlineprotectednoexcept |
Copying from another object does not affect this one's reference-count.
Definition at line 113 of file juce_ReferenceCountedObject.h.
|
inlineprotectednoexcept |
Copying from another object does not affect this one's reference-count.
Definition at line 115 of file juce_ReferenceCountedObject.h.
|
inlineprotectednoexcept |
Resets the reference count to zero without deleting the object.
You should probably never need to use this!
Definition at line 127 of file juce_ReferenceCountedObject.h.