VWLib REFERENCE MANUAL


NAME
vwMediator - An abstract base class for vwLib. vwMediator constitutes the Mediator Pattern of this library. vwMediator contains a pure virtual function (createWidgets()). The concrete mediator handles event routing and message passing between vwSubject and vwObserver.

HEADER FILE
#include <vwMediator.h>

FRIEND CLASSES
vwSubject, vwObserver

PUBLIC METHOD SUMMARY
vwMediator::vwMediator ( void);
virtual  vwMediator::~vwMediator ( void);

PROTECTED METHOD SUMMARY
virtual int vwMediator::createWidgets ( char *) = 0;

CLASS DESCRIPTION
vwMediator is the abstract mediator class of the Mediator Pattern on which this Liberia is based. A concrete mediator mediates the Observer Pattern of subjects (widgets) and their observers. Some widgets are both subjects and observers: see vwRadioButton. Since vwMediator has a pure virtual function, it must be sub-classed in order to be used. The resulting concrete mediator has a defined function createWidgets(char *string) where *string is presumably a pointer to the name of a configuration file for an interface to be built. All of the subjects and observers in this library know their mediator (i.e., the concrete mediator is passed to the constructor of all subjects and observers). Normally there will be only one concrete mediator per application which can handle multiple interfaces. However, vwMediator is not a singleton, so the possibility exists for applications with multiple concrete mediators.
 
METHOD DESCRIPTIONS

   vwMediator()
vwMediator ( void);

Construct a vwMediator.

   ~vwMediator()
virtual ~vwMediator ( void);

Destruct an instance. The destructor removes all subject pointer lists and their corresponding observer pointer lists.

   createWidgets() [Protected Pure Virtual]
virtual int createWidgets( char *) = 0;

This pure virtual method must be defined in the concrete mediator. As its name implies, it is intended to be the method which creates the interfaces used in the application. The char pointer would normally be used to point to a string path to an interface configuration file. An example implementation uses this type of configuration file.

vwWidget contains static functions and structures to facilitate the parsing of a particular type of widget configuration file. There are also static vwWidget functions to aid in intersection testing and event tracking. The widget parsing structure, vwWidget::wdgStruct, is defined in vwWidget.h. Static helper functions are vwWidget::parseWdgConfig(), vwWidget::isOver(), vwWidget::clean_wdgStruct(), and vwWidget::handleWidgets().

SEE ALSO
vwSubject, vwObserver, vwWidget

vrmedlab.jpg (7272 bytes)