Public Member Functions

mitk::MessageDelegate< R, A > Class Template Reference

#include <mitkMessage.h>

Inheritance diagram for mitk::MessageDelegate< R, A >:
Inheritance graph
[legend]
Collaboration diagram for mitk::MessageDelegate< R, A >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MessageDelegate (R *object, A(R::*memberFunctionPointer)())
virtual ~MessageDelegate ()
virtual A Execute ()
bool operator== (const MessageAbstractDelegate< A > *c)
MessageAbstractDelegate< A > * Clone () const

Detailed Description

template<class R, typename A = void>
class mitk::MessageDelegate< R, A >

This class essentially wraps a function pointer with signature A(R::*function)(). A is the return type of your callback function and R the type of the class implementing the function.

Use this class to add a callback function to messages without parameters.

Definition at line 145 of file mitkMessage.h.


Constructor & Destructor Documentation

template<class R, typename A = void>
mitk::MessageDelegate< R, A >::MessageDelegate ( R *  object,
A(R::*)()  memberFunctionPointer 
) [inline]

Definition at line 151 of file mitkMessage.h.

Referenced by mitk::MessageDelegate< R, A >::Clone().

    :m_Object(object),
    m_MemberFunctionPointer(memberFunctionPointer)
    {
    }
template<class R, typename A = void>
virtual mitk::MessageDelegate< R, A >::~MessageDelegate (  ) [inline, virtual]

Definition at line 157 of file mitkMessage.h.

    {
    }

Member Function Documentation

template<class R, typename A = void>
MessageAbstractDelegate<A>* mitk::MessageDelegate< R, A >::Clone (  ) const [inline, virtual]

Implements mitk::MessageAbstractDelegate< A >.

Definition at line 177 of file mitkMessage.h.

References mitk::MessageDelegate< R, A >::MessageDelegate().

    {
      return new MessageDelegate(m_Object, m_MemberFunctionPointer);
    }
template<class R, typename A = void>
virtual A mitk::MessageDelegate< R, A >::Execute (  ) [inline, virtual]

Implements mitk::MessageAbstractDelegate< A >.

Definition at line 162 of file mitkMessage.h.

    {
      return (m_Object->*m_MemberFunctionPointer)();    // execute member function
    }
template<class R, typename A = void>
bool mitk::MessageDelegate< R, A >::operator== ( const MessageAbstractDelegate< A > *  c ) [inline, virtual]

Implements mitk::MessageAbstractDelegate< A >.

Definition at line 167 of file mitkMessage.h.

    {
      const MessageDelegate<R,A>* cmd = dynamic_cast<const MessageDelegate<R,A>* >(c);
      if (!cmd) return false;

      if ((void*)this->m_Object != (void*)cmd->m_Object) return false;
      if (this->m_MemberFunctionPointer != cmd->m_MemberFunctionPointer) return false;
      return true;
    }

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines