OWLNext 7.0
Borland's Object Windows Library for the modern age
|
TStreamableClass is used by the private database class and pstream in the registration of streamable classes. More...
#include <owl/streambl.h>
Public Member Functions | |
TStreamableClass (LPCSTR n, BUILDER b, int d=NoDelta, ModuleId mid=GetModuleId()) | |
Creates a TStreamableClass object with the given name (n) and the given builder function (b), then registers the type. | |
~TStreamableClass () | |
int | operator== (const TStreamableClass &n) const |
int | operator< (const TStreamableClass &n) const |
Public Member Functions inherited from owl::ObjectBuilder | |
ObjectBuilder (BUILDER b, int d) | |
Additional Inherited Members | |
Public Types inherited from owl::ObjectBuilder | |
enum | { NoDelta = -1 } |
Public Attributes inherited from owl::ObjectBuilder | |
BUILDER | Builder |
int | Delta |
TStreamableClass is used by the private database class and pstream in the registration of streamable classes.
Definition at line 75 of file streambl.h.
owl::TStreamableClass::TStreamableClass | ( | LPCSTR | n, |
BUILDER | b, | ||
int | d = NoDelta, | ||
ModuleId | mid = GetModuleId() ) |
Creates a TStreamableClass object with the given name (n) and the given builder function (b), then registers the type.
For example, each streamable has a Build member function of type BUILDER. For type-safe object-stream I/O, the stream manager needs to access the names and the type information for each class. To ensure that the appropriate functions are linked into any application using the stream manager, you must provide a reference such as:
where TClassName is the name of the class for which objects need to be streamed. (Note that RegClassName is a single identifier.) This not only registers TClassName (telling the stream manager which Build function to use), it also automatically registers any dependent classes. You can register a class more than once without any harm or overhead. Invoke this function to provide raw memory of the correct size into which an object of the specified class can be read. Because the Build procedure invokes a special constructor for the class, all virtual table pointers are initialized correctly. The distance, in bytes, between the base of the streamable object and the beginning of the TStreamableBase component of the object is d. Calculate d by using the _ _DELTA macro. Example
Definition at line 184 of file objstrm.cpp.
References strnewdup().
owl::TStreamableClass::~TStreamableClass | ( | ) |
Definition at line 197 of file objstrm.cpp.
References CONST_CAST.
|
inline |
Definition at line 93 of file streambl.h.
|
inline |
Definition at line 85 of file streambl.h.