Nebula
|
#include <messagecallbackhandler.h>
Handles asynchronous message callbacks.
Allows us to perform callbacks whenever a message has been handled. Is primarily used for knowing whenever a get-something-from-another-thread-message has been handled.
For example, if we send a FetchSkinList message and want to have a callback for whenever it's handled, we can simply bind the message object to a function using the macro.
Example:
Ptr<Graphics::FetchSkinList> msg = Graphics::FetchSkinList::Create(); __Send(modelEntity, msg);
__SingleFireCallback(ViewerApplication, OnFetchedSkinList, this, msg.upcast<Messaging::Message>());
Which, when msg is handled will call this->OnFetchedSkinList with the message as argument. It sets up a specific callback delegate, not a generic one based on message type.
(C) 2013 Gustav Sterbrant (C) 2013-2020 Individual contributors, see AUTHORS file
Static Public Member Functions | |
template<class CLASS , void(CLASS::*)(const Ptr< Messaging::Message > &) METHOD> | |
static void | AddCallback (const Ptr< Messaging::Message > &msg, CLASS *obj) |
setup a message callback | |
static void | AbortCallback (const Ptr< Messaging::Message > &msg) |
remove a single message callback | |
template<class CLASS > | |
static void | AbortCallbacks (CLASS *obj) |
remove all message callbacks related to a class | |
static void | Update () |
update messages | |
Static Private Attributes | |
static Util::Array< Ptr< Messaging::Message > > | Messages |
static Util::Array< Util::Delegate< void(const Ptr< Messaging::Message > &)> > | Callbacks |
|
static |
remove a single message callback
|
static |
remove all message callbacks related to a class
|
static |
setup a message callback
|
static |
update messages
|
staticprivate |
|
staticprivate |