#include <mitkMessage.h>
Public Member Functions | |
MessageDelegate1 (R *object, A(R::*memberFunctionPointer)(T)) | |
virtual | ~MessageDelegate1 () |
virtual A | Execute (T t) |
bool | operator== (const MessageAbstractDelegate1< T, A > *c) |
MessageAbstractDelegate1< T, A > * | Clone () const |
This class essentially wraps a function pointer with signature A(R::*function)(T). A is the return type of your callback function, R the type of the class implementing the function and T the type of the argument.
Use this class to add a callback function to messages with one parameter.
If you need more parameters, use MessageDelegate2 etc.
Definition at line 200 of file mitkMessage.h.
mitk::MessageDelegate1< R, T, A >::MessageDelegate1 | ( | R * | object, |
A(R::*)(T) | memberFunctionPointer | ||
) | [inline] |
Definition at line 206 of file mitkMessage.h.
Referenced by mitk::MessageDelegate1< R, T, A >::Clone().
:m_Object(object),
m_MemberFunctionPointer(memberFunctionPointer)
{
}
virtual mitk::MessageDelegate1< R, T, A >::~MessageDelegate1 | ( | ) | [inline, virtual] |
Definition at line 212 of file mitkMessage.h.
{ }
MessageAbstractDelegate1<T,A>* mitk::MessageDelegate1< R, T, A >::Clone | ( | ) | const [inline, virtual] |
Implements mitk::MessageAbstractDelegate1< T, A >.
Definition at line 232 of file mitkMessage.h.
References mitk::MessageDelegate1< R, T, A >::MessageDelegate1().
{ return new MessageDelegate1(m_Object, m_MemberFunctionPointer); }
virtual A mitk::MessageDelegate1< R, T, A >::Execute | ( | T | t ) | [inline, virtual] |
Implements mitk::MessageAbstractDelegate1< T, A >.
Definition at line 217 of file mitkMessage.h.
References QuadProgPP::t().
{ return (m_Object->*m_MemberFunctionPointer)(t); // execute member function }
bool mitk::MessageDelegate1< R, T, A >::operator== | ( | const MessageAbstractDelegate1< T, A > * | c ) | [inline, virtual] |
Implements mitk::MessageAbstractDelegate1< T, A >.
Definition at line 222 of file mitkMessage.h.
{ const MessageDelegate1<R,T,A>* cmd = dynamic_cast<const MessageDelegate1<R,T,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; }