Theron
6.00.02
|
template<typename ObjectType >
Sets the fallback message handler executed for unhandled messages. This method sets a 'blind' default handler which, when executed, is passed the unknown message as blind data. The blind data consists of the memory block containing the message, identified by a void pointer and a size. The fallback handler registered with the framework is run:
The handler function registered by this method overload is passed the unhandled message as 'blind' data represented by a void pointer and a message size in bytes. Handlers registered using this method must expose a handler method that accepts a void pointer identifying the message contents, a size indicating the size of the message data, and a 'from' address. A user-defined handler may be able to inspect the contents of the message and take appropriate action, such as reporting the contents of an unexpected message to help with debugging. class Handler
{
public:
{
printf("Caught undelivered or unhandled message of size %d sent from address '%d'\n", size, from.AsInteger());
}
};
Theron::Framework framework;
Handler handler;
framework.SetFallbackHandler(&handler, &Handler::Handle);
Users can call this method to replace the default fallback handler with their own implementation, for example for more sophisticated error reporting or logging. Passing 0 to this method clears any previously set fallback handler, or the default fallback handler if no user-defined handler has previously been set.
|