JUCE  v5.1.1-3-g1a0b28c73
JUCE API
MessageListener Class Referenceabstract

MessageListener subclasses can post and receive Message objects. More...

#include <juce_MessageListener.h>

Collaboration diagram for MessageListener:

Public Member Functions

 MessageListener () noexcept
 
virtual ~MessageListener ()
 Destructor. More...
 
virtual void handleMessage (const Message &message)=0
 This is the callback method that receives incoming messages. More...
 
void postMessage (Message *message) const
 Sends a message to the message queue, for asynchronous delivery to this listener later on. More...
 

Private Attributes

WeakReference< MessageListener >::Master masterReference
 

Friends

class WeakReference< MessageListener >
 

Detailed Description

MessageListener subclasses can post and receive Message objects.

See also
Message, MessageManager, ActionListener, ChangeListener

Constructor & Destructor Documentation

◆ MessageListener()

MessageListener::MessageListener ( )
noexcept

◆ ~MessageListener()

virtual MessageListener::~MessageListener ( )
virtual

Destructor.

Member Function Documentation

◆ handleMessage()

virtual void MessageListener::handleMessage ( const Message message)
pure virtual

This is the callback method that receives incoming messages.

This is called by the MessageManager from its dispatch loop.

See also
postMessage

◆ postMessage()

void MessageListener::postMessage ( Message message) const

Sends a message to the message queue, for asynchronous delivery to this listener later on.

This method can be called safely by any thread.

Parameters
messagethe message object to send - this will be deleted automatically by the message queue, so make sure it's allocated on the heap, not the stack!
See also
handleMessage

Friends And Related Function Documentation

◆ WeakReference< MessageListener >

friend class WeakReference< MessageListener >
friend

Member Data Documentation

◆ masterReference

WeakReference<MessageListener>::Master MessageListener::masterReference
private

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