Creator(3U)
β¨ Creator(3U) β¨
okay so bestie, this is Creator from the InterViews Reference Manual β it's a 3U page, so like, library-level stuff, and it's literally the girl who recreates catalog-managed objects from disk and instantiates component views from their class identifiers. she does a LOT. π
πΈ NAME πΈ
Creator β recreates catalog-managed objects from disk and instantiates component views from their class identifiers. no cap, that's the whole job description. π
π¦ SYNOPSIS π¦
#include <Unidraw/creator.h>
that's it, that's the include. go get her π
π DESCRIPTION π
so a creator object has two whole talents, and honestly? main character energy:
- it can reconstruct a catalog-managed object from disk π
- it can instantiate a component view given a class identifier β¨
ngl, it's generally only the Catalog class that uses the creator to reconstruct objects from disk. but β plot twist β it may be useful for other classes (like, say, the Component base class, iykyk) to use the creator to create views of component subjects. so don't sleep on her.
and here's the thing: if your app derives new catalog-managed classes or component views, you must also derive a subclass of Creator that extends the base class operations to support those new classes. periodt. the base class can't read your mind π
π PUBLIC OPERATIONS π
Creator()
Instantiate a new creator object. (yes, the manpage says "an new", we are not fixing it, we are simply β¨acknowledgingβ¨ it π«Ά)
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. so you gotta hand her one.
virtual void* Create(ClassId, istream& in, ObjectMap* objmap, int objid)
Create an instance of the class corresponding to the given class identifier. π
normally this operation will be used by the Catalog class exclusively β she's kind of a one-catalog girl.
here's the vibe: 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. and bestie, it is not important to understand how the macro uses these arguments β we said what we said π
for example, the entry for the LineComp line component subject class is:
case LINE_COMP: CREATE(LineComp, in, objmap, objid);
and for the derived girlies: 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. do not forget the default case. she will not work. π
virtual void* Create(ClassId id)
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 == <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;
and again, for the derived besties: 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. (yes, the original says "classes's". iconic. we keep it. π
)
π₯ SEE ALSO π₯
Catalog(3U)classes(3U)globals(3U)
go read those too, bestie, it's giving β¨well-roundedβ¨
so yeah β that's the whole page, brought to you by Unidraw, dated 12 June 1990. she's been slaying since the nineties and she's still out here reconstructing objects from disk. happy creating, angel π§π
π¦ where this page comes from
- debian bookworm: ivtools-dev 2.0.11d.a1-1+b4
- debian trixie: ivtools-dev 2.0.11d.a1-3+b4
- ubuntu jammy: ivtools-dev 2.0.11d.a1-1build1
- ubuntu noble: ivtools-dev 2.0.11d.a1-3build1
- ubuntu questing: ivtools-dev 2.0.11d.a1-3build7
- ubuntu resolute: ivtools-dev 2.0.11d.a1-3build9
- ubuntu stonking: ivtools-dev 2.1.1+git.2025.07.26.a1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms