59 activeMessage->shouldDeliver.set (0);
66 JUCE_ASSERT_MESSAGE_MANAGER_EXISTS
68 if (activeMessage->shouldDeliver.compareAndSetBool (1, 0))
69 if (! activeMessage->post())
76 activeMessage->shouldDeliver.set (0);
82 JUCE_ASSERT_MESSAGE_MANAGER_IS_LOCKED
84 if (activeMessage->shouldDeliver.exchange (0) != 0)
90 return activeMessage->shouldDeliver.value != 0;
void messageCallback() override
Called when the message is delivered.
Has a callback method that is triggered asynchronously.
bool isUpdatePending() const noexcept
Returns true if there's an update callback in the pipeline.
void handleUpdateNowIfNeeded()
If an update has been triggered and is pending, this will invoke it synchronously.
virtual void handleAsyncUpdate()=0
Called back to do whatever your class needs to do.
virtual ~AsyncUpdater()
Destructor.
void triggerAsyncUpdate()
Causes the callback to be triggered at a later time.
void cancelPendingUpdate() noexcept
This will stop any pending updates from happening.
AsyncUpdater()
Creates an AsyncUpdater object.
A message that invokes a callback method when it gets delivered.
static MessageManager * getInstanceWithoutCreating() noexcept
Returns the global instance of the MessageManager, or nullptr if it doesn't exist.
A simple wrapper around std::atomic.
bool compareAndSetBool(Type newValue, Type valueToCompare) noexcept
Atomically compares this value with a target value, and if it is equal, sets this to be equal to a ne...