JUCE  v6.1.6 (6.0.8-1114)
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>; \

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
JUCE_DECLARE_WEAK_REFERENCEABLE
#define JUCE_DECLARE_WEAK_REFERENCEABLE(Class)
Macro to easily allow a class to be made weak-referenceable.
Definition: juce_WeakReference.h:234
juce::VariantHelpers::clear
void clear(VARIANT *variant)
Definition: juce_win32_UIAHelpers.h:31
juce::WeakReference
This class acts as a pointer which will automatically become null if the object to which it points is...
Definition: juce_WeakReference.h:77
Class