OpenShot Audio Library | OpenShotAudio 0.3.2
|
#include <juce_OptionalScopedPointer.h>
Holds a pointer to an object which can optionally be deleted when this pointer goes out of scope.
This acts in many ways like a std::unique_ptr, but allows you to specify whether or not the object is deleted.
Definition at line 37 of file juce_OptionalScopedPointer.h.
|
default |
Creates an empty OptionalScopedPointer.
|
inline |
Creates an OptionalScopedPointer to point to a given object, and specifying whether the OptionalScopedPointer will delete it.
If takeOwnership is true, then the OptionalScopedPointer will act like a std::unique_ptr, deleting the object when it is itself deleted. If this parameter is false, then the OptionalScopedPointer just holds a normal pointer to the object, and won't delete it.
Definition at line 51 of file juce_OptionalScopedPointer.h.
|
inline |
Takes ownership of the object that another OptionalScopedPointer holds.
Like a normal std::unique_ptr, the objectToTransferFrom object will become null, as ownership of the managed object is transferred to this object.
The flag to indicate whether or not to delete the managed object is also copied from the source object.
Definition at line 64 of file juce_OptionalScopedPointer.h.
|
inline |
The destructor may or may not delete the object that is being held, depending on the takeOwnership flag that was specified when the object was first passed into an OptionalScopedPointer constructor.
Definition at line 94 of file juce_OptionalScopedPointer.h.
|
inline |
Does the same thing as reset().
Definition at line 130 of file juce_OptionalScopedPointer.h.
|
inlinenoexcept |
Returns the object that this pointer is managing.
Definition at line 104 of file juce_OptionalScopedPointer.h.
Referenced by juce::OptionalScopedPointer< ObjectType >::set().
|
inlinenoexcept |
Returns the object that this pointer is managing.
Definition at line 101 of file juce_OptionalScopedPointer.h.
|
inlinenoexcept |
Returns the object that this pointer is managing.
Definition at line 107 of file juce_OptionalScopedPointer.h.
|
inlinenoexcept |
Lets you access methods and properties of the object that this pointer is holding.
Definition at line 110 of file juce_OptionalScopedPointer.h.
|
inline |
Takes ownership of the object that another OptionalScopedPointer holds.
Like a normal std::unique_ptr, the objectToTransferFrom object will become null, as ownership of the managed object is transferred to this object.
The ownership flag that says whether or not to delete the managed object is also copied from the source object.
Definition at line 78 of file juce_OptionalScopedPointer.h.
|
inlinenoexcept |
Removes the current object from this OptionalScopedPointer without deleting it. This will return the current object, and set this OptionalScopedPointer to a null pointer.
Definition at line 116 of file juce_OptionalScopedPointer.h.
|
inline |
Resets this pointer to null, possibly deleting the object that it holds, if it has ownership of it.
Definition at line 121 of file juce_OptionalScopedPointer.h.
Referenced by juce::OptionalScopedPointer< ObjectType >::clear(), juce::OptionalScopedPointer< ObjectType >::operator=(), juce::OptionalScopedPointer< ObjectType >::set(), and juce::OptionalScopedPointer< ObjectType >::~OptionalScopedPointer().
|
inline |
Makes this OptionalScopedPointer point at a new object, specifying whether the OptionalScopedPointer will take ownership of the object.
If takeOwnership is true, then the OptionalScopedPointer will act like a std::unique_ptr, deleting the object when it is itself deleted. If this parameter is false, then the OptionalScopedPointer just holds a normal pointer to the object, and won't delete it.
Definition at line 139 of file juce_OptionalScopedPointer.h.
Referenced by juce::OptionalScopedPointer< ObjectType >::setNonOwned(), and juce::OptionalScopedPointer< ObjectType >::setOwned().
|
inline |
Makes this OptionalScopedPointer point at a new object, but will not take ownership of that object.
Definition at line 157 of file juce_OptionalScopedPointer.h.
|
inline |
Makes this OptionalScopedPointer point at a new object, and take ownership of that object.
Definition at line 151 of file juce_OptionalScopedPointer.h.
|
inlinenoexcept |
Swaps this object with another OptionalScopedPointer. The two objects simply exchange their states.
Definition at line 171 of file juce_OptionalScopedPointer.h.
|
inlinenoexcept |
Returns true if the target object will be deleted when this pointer object is deleted.
Definition at line 165 of file juce_OptionalScopedPointer.h.