GPL_ObjectFactory

GPL_ObjectFactory

gpl

1998 12-05


CLASS

GPL_ObjectFactory - C++ object factory


SYNOPSIS

GPL_ObjectFactory provides a factory to produce instances of GPL_Object from a string or numeric identifier. With this facility, objects may be passed between threads since they can be recreated from their identifier.


MEMBER FUNCTIONS


WARNING


Some linkers are overly aggressive in their optimization and will not include an object file in the executable if none of the functions in that file are used directly in the executable. Since the GPL_OBJECT_IMPLEMENTATION macro causes GPL_ObjectFactory to indirectly use the methods of a GPL_Object-derived class, these linkers may discard the entire object file as part of optimization if there is not another, explicit instance of that class. The most obvious symptom of this is when GPL_ObjectFactory has no knowledge of a class derived from GPL_Object and GPL_ObjectFactory::Create() returns a null pointer. Putting a static, possibly unused, instance of the class into the translation unit should solve the problem.


SEE ALSO

GPL_Object(3), GPL_Persistent(3)