PureMVC::Observer< T > Class Template Reference

A base IObserver implementation. More...

#include <pmvcpp.h>

Inheritance diagram for PureMVC::Observer< T >:
Inheritance graph
[legend]
Collaboration diagram for PureMVC::Observer< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Observer (NotifyMethod method, NotifyContext context)
 Constructor.
void setNotifyMethod (NotifyMethod method)
 Set the notification method.
void setNotifyContext (NotifyContext context)
 Set the notification context.
NotifyMethod getNotifyMethod ()
 Get the notification method.
NotifyContext getNotifyContext ()
 Get the notification context.
void notifyObserver (INotification *notification)
 Notify the interested object.
bool compareNotifyContext (intptr_t compareContextMemoryAddress)
 Compare the given memory address with the stored context's address.
virtual void setNotifyMethod (void(T::*fptr)(INotification *))=0
 Set the notification method.

Detailed Description

template<class T>
class PureMVC::Observer< T >

A base IObserver implementation.

An Observer is an object that encapsulates information about an interested object with a method that should be called when a particular INotification is broadcast.

In PureMVC, the Observer class assumes these responsibilities:

See also:
View
Notification

Constructor & Destructor Documentation

template<class T>
PureMVC::Observer< T >::Observer ( NotifyMethod  method,
NotifyContext  context 
) [inline]

Constructor.

The notification method on the interested object should take one parameter of type INotification

Parameters:
method the notification method of the interested object
context the notification context of the interested object

Member Function Documentation

template<class T>
bool PureMVC::Observer< T >::compareNotifyContext ( intptr_t  compareContextMemoryAddress  )  [inline, virtual]

Compare the given memory address with the stored context's address.

Parameters:
compareContextMemoryAddress the object to compare's memory address
Returns:
boolean indicating if the object and the notification context are the same

Implements PureMVC::IObserverRestricted.

template<class T>
NotifyContext PureMVC::Observer< T >::getNotifyContext (  )  [inline]

Get the notification context.

Returns:
the notification context (this) of the interested object.
template<class T>
NotifyMethod PureMVC::Observer< T >::getNotifyMethod (  )  [inline]

Get the notification method.

Returns:
the notification (callback) method of the interested object.
template<class T>
void PureMVC::Observer< T >::notifyObserver ( INotification notification  )  [inline, virtual]

Notify the interested object.

Parameters:
notification the INotification to pass to the interested object's notification method.

Implements PureMVC::IObserverRestricted.

template<class T>
void PureMVC::Observer< T >::setNotifyContext ( NotifyContext  context  )  [inline, virtual]

Set the notification context.

Parameters:
context the notification context (this) of the interested object.

Implements PureMVC::IObserverTemplated< T >.

template<class T >
virtual void PureMVC::IObserverTemplated< T >::setNotifyMethod ( void(T::*)(INotification *)  fptr  )  [pure virtual, inherited]

Set the notification method.

The notification method should take one parameter of type INotification

Parameters:
notifyMethod the notification (callback) method of the interested object
template<class T>
void PureMVC::Observer< T >::setNotifyMethod ( NotifyMethod  method  )  [inline]

Set the notification method.

The notification method should take one parameter of type INotification.

Parameters:
method the notification (callback) method of the interested object.

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables

Generated on Wed Feb 17 17:11:32 2010 for PureMVC++ by  doxygen 1.6.1