Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

Phx::BaseMultiListener< Notifier, Listener, Selector > Class Template Reference

Similar to BaseListener, this class provides the foundation for a listener that can be installed in a multi-listener interface. More...

#include <PhxListeners.h>

Inheritance diagram for Phx::BaseMultiListener< Notifier, Listener, Selector >:

Phx::LockedPtrInterface< BaseMultiListener< Notifier, Listener, Selector > > List of all members.

Public Member Functions

virtual ~BaseMultiListener (void)
 Destructs the listener, removing it from its notifier if it has one.

Protected Member Functions

Notifier * notifier (void)
 Gets a raw pointer to the notifier this listener is installed in.
const Notifier * notifier (void) const

Friends

class Manager

Classes

class  Manager
 Like BaseListener::Manager, this class manages listeners on behalf of a notifier using BaseMultiListener. More...

Detailed Description

template<class Notifier, class Listener, class Selector>
class Phx::BaseMultiListener< Notifier, Listener, Selector >

Similar to BaseListener, this class provides the foundation for a listener that can be installed in a multi-listener interface.

A multi-listener interface is one that allows the installation of multiple listeners. Generally, these listeners are each from different clients. We try to avoid this by creating a single interface per client, but sometimes the only purpose of the interface is to provide a listener slot to the client. Thus, using a multi-listener interface is just an optimization of this approach, wherein we merge all of the interfaces into a single notifier object that has multiple listeners.

Todo:
A diagram of the single listener relationship and the "optimized" multi-listener relationship would be helpful here.
The primary difference between this class and BaseListener is in the BaseMultiListener::Manager class, not in the listener itself. The manager provides a collection-style listener attribute, rather than the singleton-attribute method like BaseListener::listener(). That is, the manager keeps a collection of listeners instead of a single listener.

Beyond this, this class is largely the same as BaseListener and should be used in an analagous fashion. The only substantially different portion is the notification phase.


Member Function Documentation

template<class Notifier, class Listener, class Selector>
Notifier* Phx::BaseMultiListener< Notifier, Listener, Selector >::notifier void   )  [inline, protected]
 

Gets a raw pointer to the notifier this listener is installed in.

This is only safe to access during a listener callback. You should not access it at other times.

Returns:
A Notifier* pointing to the notifier that is calling this listener.
See also:
BaseListener::notifier()


The documentation for this class was generated from the following file:
Generated on Wed Dec 21 22:05:39 2005 for Phoenix OSFS by  doxygen 1.4.2