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

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

Public Member Functions

 MessageMethod (ObjectClass *instance, Method method)
 The constructor. More...
 
virtual Bool Execute (Message::AutoPtr &message)
 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. More...
 
Method mMethod
 The method pointer to call. More...
 

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>
virtual Bool Murl::Util::MessageMethod< MessageClass, ObjectClass >::Execute ( Message::AutoPtr message)
inlinevirtual

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::System::DemangleTypeName(), Murl::Debug::Error(), Murl::AutoPointer< Type1 >::Get(), and Murl::AutoPointer< Type1 >::Release().

Member Data Documentation

◆ mInstance

template<class MessageClass, class ObjectClass>
ObjectClass* Murl::Util::MessageMethod< MessageClass, ObjectClass >::mInstance
protected

The instance pointer of the class to call.

◆ mMethod

template<class MessageClass, class ObjectClass>
Method Murl::Util::MessageMethod< MessageClass, ObjectClass >::mMethod
protected

The method pointer to call.


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


Copyright © 2011-2018 Spraylight GmbH.