JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::WeakReference< ObjectType, ReferenceCountingType >::Master Class Reference

This class is embedded inside an object to which you want to attach WeakReference pointers. More...

#include <juce_WeakReference.h>

Collaboration diagram for juce::WeakReference< ObjectType, ReferenceCountingType >::Master:

Public Member Functions

 Master () noexcept
 
 ~Master () noexcept
 
void clear () noexcept
 The object that owns this master pointer should call this before it gets destroyed, to zero all the references to this object that may be out there. More...
 
int getNumActiveWeakReferences () const noexcept
 Returns the number of WeakReferences that are out there pointing to this object. More...
 
SharedRef getSharedPointer (ObjectType *object)
 The first call to this method will create an internal object that is shared by all weak references to the object. More...
 

Private Attributes

SharedRef sharedPointer
 

Detailed Description

template<class ObjectType, class ReferenceCountingType = ReferenceCountedObject>
class juce::WeakReference< ObjectType, ReferenceCountingType >::Master

This class is embedded inside an object to which you want to attach WeakReference pointers.

See the WeakReference class notes for an example of how to use this class.

See also
WeakReference

Constructor & Destructor Documentation

◆ Master()

template<class ObjectType, class ReferenceCountingType = ReferenceCountedObject>
juce::WeakReference< ObjectType, ReferenceCountingType >::Master::Master ( )
inlinenoexcept

◆ ~Master()

template<class ObjectType, class ReferenceCountingType = ReferenceCountedObject>
juce::WeakReference< ObjectType, ReferenceCountingType >::Master::~Master ( )
inlinenoexcept

References jassert.

Member Function Documentation

◆ clear()

template<class ObjectType, class ReferenceCountingType = ReferenceCountedObject>
void juce::WeakReference< ObjectType, ReferenceCountingType >::Master::clear ( )
inlinenoexcept

The object that owns this master pointer should call this before it gets destroyed, to zero all the references to this object that may be out there.

See the WeakReference class notes for an example of how to do this.

◆ getNumActiveWeakReferences()

template<class ObjectType, class ReferenceCountingType = ReferenceCountedObject>
int juce::WeakReference< ObjectType, ReferenceCountingType >::Master::getNumActiveWeakReferences ( ) const
inlinenoexcept

Returns the number of WeakReferences that are out there pointing to this object.

◆ getSharedPointer()

template<class ObjectType, class ReferenceCountingType = ReferenceCountedObject>
SharedRef juce::WeakReference< ObjectType, ReferenceCountingType >::Master::getSharedPointer ( ObjectType *  object)
inline

The first call to this method will create an internal object that is shared by all weak references to the object.

References jassert, and juce::WeakReference< ObjectType, ReferenceCountingType >::SharedPointer::SharedPointer().

Member Data Documentation

◆ sharedPointer

template<class ObjectType, class ReferenceCountingType = ReferenceCountedObject>
SharedRef juce::WeakReference< ObjectType, ReferenceCountingType >::Master::sharedPointer
private

The documentation for this class was generated from the following file: