Murl::Util::MessageMethod< MessageClass, ObjectClass > Class Template Reference

The MessageMethod class delivers a message of a specified type to a class method, see MessageThread. More...

#include "murl_util_message_callback.h"

Inheritance diagram for Murl::Util::MessageMethod< MessageClass, ObjectClass >:

Public Types

using Method = Bool(ObjectClass::*)(AutoPointer< MessageClass >)
 Definition of the method pointer to call.
 
- Public Types inherited from Murl::Util::MessageCallBack
using AutoPtr = AutoPointer< MessageCallBack >
 Definition of the MessageCallBack class auto pointer.
 

Public Member Functions

 MessageMethod (ObjectClass *instance, Method method)
 The constructor. More...
 
Bool Execute (Message::AutoPtr &message) override
 The callback to deliver a message. More...
 
- Public Member Functions inherited from Murl::Util::MessageCallBack
virtual ~MessageCallBack ()
 The destructor.
 

Protected Attributes

ObjectClass * mInstance
 The instance pointer of the class to call.
 
Method mMethod
 The method pointer to call.
 

Detailed Description

template<class MessageClass, class ObjectClass>
class Murl::Util::MessageMethod< MessageClass, ObjectClass >

The MessageMethod class delivers a message of a specified type to a class method, see MessageThread.

Constructor & Destructor Documentation

◆ MessageMethod()

template<class MessageClass , class ObjectClass >
Murl::Util::MessageMethod< MessageClass, ObjectClass >::MessageMethod ( ObjectClass *  instance,
Method  method 
)
inline

The constructor.

Template Parameters
MessageClassThe type of the message class.
ObjectClassThe type of the class to call the method.
Parameters
instanceThe instance pointer of the class to call the method.
methodThe method pointer to call.

Member Function Documentation

◆ Execute()

template<class MessageClass , class ObjectClass >
Bool Murl::Util::MessageMethod< MessageClass, ObjectClass >::Execute ( Message::AutoPtr message)
inlineoverridevirtual

The callback to deliver a message.

The method pointer of the ObjectClass instance which was passed to the constructor is called with the message parameter casted to the MessageClass type.

Parameters
messageThe message to deliver.
Returns
true if successful.

Implements Murl::Util::MessageCallBack.

References Murl::String::Begin(), Murl::System::DemangleTypeName(), Murl::Debug::Error(), Murl::Util::MessageMethod< MessageClass, ObjectClass >::mInstance, and Murl::Util::MessageMethod< MessageClass, ObjectClass >::mMethod.


The documentation for this class was generated from the following file:
  • murl_util_message_callback.h


Copyright © 2011-2024 Spraylight GmbH.