JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::ActionBroadcaster Class Reference

Manages a list of ActionListeners, and can send them messages. More...

#include <juce_ActionBroadcaster.h>

Collaboration diagram for juce::ActionBroadcaster:

Public Member Functions

 ActionBroadcaster ()
 Creates an ActionBroadcaster. More...
 
virtual ~ActionBroadcaster ()
 Destructor. More...
 
void addActionListener (ActionListener *listener)
 Adds a listener to the list. More...
 
void removeActionListener (ActionListener *listener)
 Removes a listener from the list. More...
 
void removeAllActionListeners ()
 Removes all listeners from the list. More...
 
void sendActionMessage (const String &message) const
 Broadcasts a message to all the registered listeners. More...
 

Private Attributes

CriticalSection actionListenerLock
 
SortedSet< ActionListener * > actionListeners
 

Friends

class ActionMessage
 

Detailed Description

Manages a list of ActionListeners, and can send them messages.

To quickly add methods to your class that can add/remove action listeners and broadcast to them, you can derive from this.

See also
ActionListener, ChangeListener

{Events}

Constructor & Destructor Documentation

◆ ActionBroadcaster()

juce::ActionBroadcaster::ActionBroadcaster ( )

Creates an ActionBroadcaster.

◆ ~ActionBroadcaster()

virtual juce::ActionBroadcaster::~ActionBroadcaster ( )
virtual

Destructor.

Member Function Documentation

◆ addActionListener()

void juce::ActionBroadcaster::addActionListener ( ActionListener listener)

Adds a listener to the list.

Trying to add a listener that's already on the list will have no effect.

◆ removeActionListener()

void juce::ActionBroadcaster::removeActionListener ( ActionListener listener)

Removes a listener from the list.

If the listener isn't on the list, this won't have any effect.

◆ removeAllActionListeners()

void juce::ActionBroadcaster::removeAllActionListeners ( )

Removes all listeners from the list.

◆ sendActionMessage()

void juce::ActionBroadcaster::sendActionMessage ( const String message) const

Broadcasts a message to all the registered listeners.

See also
ActionListener::actionListenerCallback

Friends And Related Function Documentation

◆ ActionMessage

friend class ActionMessage
friend

Member Data Documentation

◆ actionListenerLock

CriticalSection juce::ActionBroadcaster::actionListenerLock
private

◆ actionListeners

SortedSet<ActionListener*> juce::ActionBroadcaster::actionListeners
private

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