PureMVC::Mediator Class Reference

Inheritance diagram for PureMVC::Mediator:
Inheritance graph
[legend]
Collaboration diagram for PureMVC::Mediator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Mediator (std::string mediatorName, void *viewComponent)
 Constructor.
 Mediator (std::string mediatorName)
 Mediator (void *viewComponent)
std::string getMediatorName ()
 Get the name of the Mediator.
void setViewComponent (void *viewComponent)
 Set the IMediator's view component.
void * getViewComponent ()
 Get the Mediator's view component.
virtual std::vector< int > listNotificationInterests ()=0
 List the INotification names this Mediator is interested in being notified of.
virtual void handleNotification (INotification *notification)=0
 Handle INotifications.
virtual void onRegister ()=0
 Called by the View when the Mediator is registered.
virtual void onRemove ()=0
 Called by the View when the Mediator is removed.
std::string getName ()
 Returns the name of the Mediator.
virtual void sendNotification (int notificationName, void *body, int notificationType)=0
 Send a INotification.
virtual void sendNotification (int notificationName, int notificationType)=0
 Send a INotification.
virtual void sendNotification (int notificationName, void *body)=0
 Send a INotification.
virtual void sendNotification (int notificationName)=0
 Send a INotification.
virtual void initializeNotifier (std::string key)=0
 Initialize this INotifier instance.
void sendNotification (int notificationName, void *body, int notificationType)
 Create and send an INotification.
void sendNotification (int notificationName, int notificationType)
 Send a INotification.
void sendNotification (int notificationName, void *body)
 Send a INotification.
void sendNotification (int notificationName)
 Send a INotification.
void initializeNotifier (std::string key)
 Initialize this INotifier instance.
virtual void setMultitonKey (std::string key)
 Set multiton key.
virtual std::string getMultitonKey ()
 Get multiton key.

Protected Member Functions

IFacadegetFacade ()

Protected Attributes

std::string mediatorName
void * viewComponent

Constructor & Destructor Documentation

PureMVC::Mediator::Mediator ( std::string  mediatorName,
void *  viewComponent 
) [inline]

Constructor.


Member Function Documentation

std::string PureMVC::Mediator::getMediatorName (  )  [inline, virtual]

Get the name of the Mediator.

Returns:
the Mediator name

Implements PureMVC::IMediator.

std::string MultitonKeyHeir::getMultitonKey (  )  [virtual, inherited]

Get multiton key.

Returns the multiton key.

Returns:
The string key name

Implements PureMVC::IMultitonKeyHeir.

std::string PureMVC::Mediator::getName (  )  [inline]

Returns the name of the Mediator.

Returns:
string the name
void* PureMVC::Mediator::getViewComponent (  )  [inline, virtual]

Get the Mediator's view component.

Additionally, an implicit getter will usually be defined in the subclass that casts the view object to a type, like this:

<listing> private function get comboBox : mx.controls.ComboBox { return viewComponent as mx.controls.ComboBox; } </listing>

Returns:
the view component

Implements PureMVC::IMediator.

virtual void PureMVC::Mediator::handleNotification ( INotification notification  )  [pure virtual]

Handle INotifications.

Typically this will be handled in a switch statement, with one 'case' entry per INotification the Mediator is interested in.

Implements PureMVC::INotificationHandler.

void Notifier::initializeNotifier ( std::string  key  )  [virtual, inherited]

Initialize this INotifier instance.

This is how a Notifier gets its multitonKey. Calls to sendNotification or to access the facade will fail until after this method has been called.

Mediators, Commands or Proxies may override this method in order to send notifications or access the Multiton Facade instance as soon as possible. They CANNOT access the facade in their constructors, since this method will not yet have been called.

Parameters:
key the multitonKey for this INotifier to use

Implements PureMVC::INotifier.

virtual void PureMVC::INotifier::initializeNotifier ( std::string  key  )  [pure virtual, inherited]

Initialize this INotifier instance.

This is how a Notifier gets its multitonKey. Calls to sendNotification or to access the facade will fail until after this method has been called.

Parameters:
key the multitonKey for this INotifier to use

Implemented in PureMVC::Notifier, and PureMVC::Facade.

virtual std::vector<int> PureMVC::Mediator::listNotificationInterests (  )  [pure virtual]

List the INotification names this Mediator is interested in being notified of.

Returns:
Array the list of INotification names

Implements PureMVC::IMediator.

virtual void PureMVC::Mediator::onRegister (  )  [pure virtual]

Called by the View when the Mediator is registered.

Implements PureMVC::IMediator.

virtual void PureMVC::Mediator::onRemove (  )  [pure virtual]

Called by the View when the Mediator is removed.

Implements PureMVC::IMediator.

void Notifier::sendNotification ( int  notificationName  )  [virtual, inherited]

Send a INotification.

Convenience method to prevent having to construct new notification instances in our implementation code.

Parameters:
notificationName the name of the notification to send

Implements PureMVC::INotifier.

void Notifier::sendNotification ( int  notificationName,
void *  body 
) [virtual, inherited]

Send a INotification.

Convenience method to prevent having to construct new notification instances in our implementation code.

Parameters:
notificationName the name of the notification to send
body the body of the notification (optional)

Implements PureMVC::INotifier.

void Notifier::sendNotification ( int  notificationName,
int  notificationType 
) [virtual, inherited]

Send a INotification.

Convenience method to prevent having to construct new notification instances in our implementation code.

Parameters:
notificationName the name of the notification to send
type the type of the notification (optional)

Implements PureMVC::INotifier.

void Notifier::sendNotification ( int  notificationName,
void *  body,
int  notificationType 
) [virtual, inherited]

Create and send an INotification.

Keeps us from having to construct new INotification instances in our implementation code.

Parameters:
notificationName the name of the notiification to send
body the body of the notification (optional)
type the type of the notification (optional)

Implements PureMVC::INotifier.

virtual void PureMVC::INotifier::sendNotification ( int  notificationName  )  [pure virtual, inherited]

Send a INotification.

Convenience method to prevent having to construct new notification instances in our implementation code.

Parameters:
notificationName the name of the notification to send

Implemented in PureMVC::Notifier, and PureMVC::Facade.

virtual void PureMVC::INotifier::sendNotification ( int  notificationName,
void *  body 
) [pure virtual, inherited]

Send a INotification.

Convenience method to prevent having to construct new notification instances in our implementation code.

Parameters:
notificationName the name of the notification to send
body the body of the notification (optional)

Implemented in PureMVC::Notifier, and PureMVC::Facade.

virtual void PureMVC::INotifier::sendNotification ( int  notificationName,
int  notificationType 
) [pure virtual, inherited]

Send a INotification.

Convenience method to prevent having to construct new notification instances in our implementation code.

Parameters:
notificationName the name of the notification to send
type the type of the notification (optional)

Implemented in PureMVC::Notifier, and PureMVC::Facade.

virtual void PureMVC::INotifier::sendNotification ( int  notificationName,
void *  body,
int  notificationType 
) [pure virtual, inherited]

Send a INotification.

Convenience method to prevent having to construct new notification instances in our implementation code.

Parameters:
notificationName the name of the notification to send
body the body of the notification (optional)
type the type of the notification (optional)

Implemented in PureMVC::Notifier, and PureMVC::Facade.

void MultitonKeyHeir::setMultitonKey ( std::string  key  )  [virtual, inherited]

Set multiton key.

Sets the multiton key.

Parameters:
key The name of the key

Implements PureMVC::IMultitonKeyHeir.

void PureMVC::Mediator::setViewComponent ( void *  viewComponent  )  [inline, virtual]

Set the IMediator's view component.

Parameters:
Object the view component

Implements PureMVC::IMediator.


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

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