Creator(3U) | InterViews Reference Manual | Creator(3U) |
Creator - recreates catalog-managed objects from disk and instantiates component views from their class identifiers
#include <Unidraw/creator.h>
A creator object can reconstruct a catalog-managed object from disk and can instantiate a component view given a class identifier. Generally only the Catalog class uses the creator to reconstruct objects from disk, but it may be useful for other classes (e.g., the Component base class) to use the creator to create views of component subjects.
Applications that derive new catalog-managed classes or component views must also derive a subclass of Creator that extends the base class operations to support the new classes.
case LINE_COMP: CREATE(LineComp, in, objmap, objid);
Derived Creator classes must redefine this operation to include a switch statement for application-specific classes, with the default case calling the parent class's Create operation.
if (id == <identifier name>) return new <class name>;
For example, the entry for the PostScript external view class identifier for line components is
if (id == PS_LINE) return new PSLine;
Derived Creator classes must redefine this operation to include if statements for application-specific view classes, with the final statement being a call to the parent classes's Create operation.
Catalog(3U), classes(3U), globals(3U)
12 June 1990 | Unidraw |