Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Essential Tools Module Reference Guide


Module:  Essential Tools Module   Group:  Miscellaneous

Does not inherit

Local Index



#include <rw/model.h>
(abstract base class)


This abstract base class has been designed to implement the "Model" leg of a Model-View-Controller architecture. A companion class, RWModelClient, supplies the "View" leg.

It maintains a list of dependent RWModelClient objects. When member function changed(void*) is called, the list of dependents will be traversed, calling updateFrom(RWModel*, void*) for each one, with itself as the first argument. Subclasses of RWModelClient should be prepared to accept such a call.




This is an incomplete and somewhat contrived example in that it does not completely define the classes involved. "Dial" is assumed to be a graphical representation of the internal settings of "Thermostat." The essential point is that there is a dependency relationship between the "Thermostat" and the "Dial": when the setting of the thermostat is changed, the dial must be notified so that it can update itself to reflect the new setting of the thermostat.

Public Constructor


Public Member Functions

addDependent(RWModelClient* m);
virtual void
changed(void* d);
removeDependent(RWModelClient* m);

Previous fileTop of DocumentContentsIndex pageNext file

©2004 Copyright Quovadx, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.