Tools.h++ Manual

104011 Tandem Computers Incorporated 21-109
21
Public constructors
RWFactory();
Construct an
RWFactory
.
Public member functions
void addFunction(RWuserCreator uc,
RWClassID id);
Adds to the
RWFactory
the global function pointed to by
uc
, which creates an
instance of an object with
RWClassID id
.
RWCollectable* create(RWClassID id) const;
Allocates a new instance of the class with
RWClassID id
off the heap and
returns a pointer to it. Returns nil if
id
does not exist. Because this instance is
allocated off the heap, you are responsible for deleting it when done.
RWuserCreator getFunction(RWClassID id) const;
Returns from the
RWFactory
a pointer to the global function associated with
RWClassID id
. Returns nil if
id
does not exist.
void removeFunction(RWClassID id);
Removes from the
RWFactory
the global function associated with
RWClassID
id
. If
id
does not exist in the factory, no action is taken.
delete b;// then the bag itself
}