Creator()
Instantiate an new creator object. The Catalog constructor requires an instance of a creator
object, either an instance of the Creator base class or an instance of an application-specific
Creator subclass.
virtualvoid*Create(ClassId,istream&in,ObjectMap*objmap,intobjid)
Create an instance of the class corresponding to the given class identifier. Normally this
operation will be used by the Catalog class exclusively. This operation contains a switch
statement that calls a CREATE macro for each possible class identifier. The CREATE macro takes
the istream, ObjectMap, and int arguments as parameters; it is not important to understand how the
macro uses these arguments. For example, the entry for the LineComp line component subject class
is
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.
virtualvoid*Create(ClassIdid)
Create an instance of the view class corresponding to the given view class identifier. This
operation is implemented with a set of consecutive if statements of the form
if (id == <identifiername>) return new <classname>;
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.