Type information in shared libraries

Flattening an object typically causes its class name to be written to an output stream. Immediately after the class name, the streamer writes the name of the shared library containing the default constructor for objects of this class. Following the class name and library name, the streamer writes the instance data specific to the object being flattened. When a flattened object is resurrected from a stream, the streamer reads back the class name and shared library name. The class name is used to get a pointer to the constructor for the object inside of the shared library. This constructor is then called to create an empty instance of the class. The stream then reads the instance data remaining in the stream to fill in the instance fields of the object.

If the code resurrecting the object from the stream can't find the class or library specified by the stream an error is signaled: FindFunctionAddress/ CacheNotUsed. This always happens if the object is streamed inside a module containing a main function (a program or server module), as these modules do not retain type information about classes defined within the module. Without this extra type information, persistent objects cannot be resurrected from external streams.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker