JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce_WeakReference.h File Reference
This graph shows which files directly or indirectly include this file:

Classes

class  juce::WeakReference< ObjectType, ReferenceCountingType >
 This class acts as a pointer which will automatically become null if the object to which it points is deleted. More...
 
class  juce::WeakReference< ObjectType, ReferenceCountingType >::Master
 This class is embedded inside an object to which you want to attach WeakReference pointers. More...
 
class  juce::WeakReference< ObjectType, ReferenceCountingType >::SharedPointer
 This class is used internally by the WeakReference class - don't use it directly in your code! More...
 

Namespaces

 juce
 

Macros

#define JUCE_DECLARE_WEAK_REFERENCEABLE(Class)
 Macro to easily allow a class to be made weak-referenceable. More...
 

Macro Definition Documentation

◆ JUCE_DECLARE_WEAK_REFERENCEABLE

#define JUCE_DECLARE_WEAK_REFERENCEABLE (   Class)
Value:
struct WeakRefMaster : public juce::WeakReference<Class>::Master { ~WeakRefMaster() { this->clear(); } }; \
WeakRefMaster masterReference; \
friend class juce::WeakReference<Class>; \
This class acts as a pointer which will automatically become null if the object to which it points is...
Definition: juce_WeakReference.h:77

Macro to easily allow a class to be made weak-referenceable.

This can be inserted in a class definition to add the requisite weak-ref boilerplate to that class. e.g.

class MyObject
{
public:
MyObject();
~MyObject();
private:
};
See also
WeakReference, WeakReference::Master

Referenced by juce::ValueWithDefault::delimitedStringToVarArray(), VideoComponent::Pimpl::MediaSession::getAudioAttributes(), CameraDevice::Pimpl::CaptureSession::getTimeOfFirstRecordedFrame(), VideoComponent::Pimpl::PlayerControllerBase< Derived >::PlayerAsyncInitialiser::notifyOwnerPreparationFinished(), VideoComponent::Pimpl::PlayerControllerBase< PlayerController >::playbackStopped(), juce::CachedValue< Type >::valueTreeParentChanged(), and CameraDevice::Pimpl::~Pimpl().