PureMVC::IObserverTemplated< T > Class Template Reference

The interface definition for a PureMVC Observer. More...

#include <pmvcpp.h>

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

List of all members.

Public Member Functions

virtual void setNotifyMethod (void(T::*fptr)(INotification *))=0
 Set the notification method.
virtual void setNotifyContext (T *notifyContext)=0
 Set the notification context.
virtual void notifyObserver (INotification *notification)=0
 A callback.
virtual bool compareNotifyContext (intptr_t memoryAddress)=0
 Compare an object's memory address to the notification context's memory address.

Detailed Description

template<class T>
class PureMVC::IObserverTemplated< T >

The interface definition for a PureMVC Observer.

In PureMVC, IObserver implementors assume these responsibilities:

PureMVC does not rely upon underlying event models such as the one provided with Flash, and ActionScript 3 does not have an inherent event model.

The Observer Pattern as implemented within PureMVC exists to support event driven communication between the application and the actors of the MVC triad.

An Observer is an object that encapsulates information about an interested object with a notification method that should be called when an INotification is broadcast. The Observer then acts as a proxy for notifying the interested object.

Observers can receive Notifications by having their notifyObserver method invoked, passing in an object implementing the INotification interface, such as a subclass of Notification.

See also:
IView
INotification

Member Function Documentation

virtual bool PureMVC::IObserverRestricted::compareNotifyContext ( intptr_t  memoryAddress  )  [pure virtual, inherited]

Compare an object's memory address to the notification context's memory address.

Parameters:
memoryAddress the object to compare
Returns:
boolean indicating if the object and the notification context are the same

Implemented in PureMVC::Observer< T >.

virtual void PureMVC::IObserverRestricted::notifyObserver ( INotification notification  )  [pure virtual, inherited]

A callback.

Call the Observer's callback function in the context of the Observer.

Implemented in PureMVC::Observer< T >.

template<class T >
virtual void PureMVC::IObserverTemplated< T >::setNotifyContext ( T *  notifyContext  )  [pure virtual]

Set the notification context.

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

Implemented in PureMVC::Observer< T >.

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

Set the notification method.

The notification method should take one parameter of type INotification

Parameters:
notifyMethod 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:26 2010 for PureMVC++ by  doxygen 1.6.1