Loading...
Searching...
No Matches
juce::WeakReference< ObjectType, ReferenceCountingType >::Master Class Reference

## 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

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

- juce_core/memory/juce_WeakReference.h

## Public Member Functions

| Master ()=default
| ~Master () noexcept
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.
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.
int | getNumActiveWeakReferences () const noexcept
| Returns the number of WeakReferences that are out there pointing to this object.

## Constructors and Destructors

## Master()

template<class ObjectType, class ReferenceCountingType = ReferenceCountedObject>

juce::WeakReference< ObjectType, ReferenceCountingType >::Master::Master | ( |  | ) |

default

## ~Master()

template<class ObjectType, class ReferenceCountingType = ReferenceCountedObject>

juce::WeakReference< ObjectType, ReferenceCountingType >::Master::~Master | ( |  | ) |

inline noexcept

References jassert.

## Member Functions

## 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.

## clear()

template<class ObjectType, class ReferenceCountingType = ReferenceCountedObject>

void juce::WeakReference< ObjectType, ReferenceCountingType >::Master::clear | ( |  | ) |

inline 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.

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

inline noexcept

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

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited