OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TStreamableClass Class Reference

TStreamableClass is used by the private database class and pstream in the registration of streamable classes. More...

#include <owl/streambl.h>

Inheritance diagram for owl::TStreamableClass:
owl::ObjectBuilder

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
 

Detailed Description

TStreamableClass is used by the private database class and pstream in the registration of streamable classes.

Definition at line 75 of file streambl.h.

Constructor & Destructor Documentation

◆ TStreamableClass()

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:

TStreamableClass is used by the private database class and pstream in the registration of streamable ...
Definition streambl.h:75

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

TClassName::build, _ _DELTA(TClassName));
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),...
Definition objstrm.cpp:184

Definition at line 184 of file objstrm.cpp.

References strnewdup().

◆ ~TStreamableClass()

owl::TStreamableClass::~TStreamableClass ( )

Definition at line 197 of file objstrm.cpp.

References CONST_CAST.

Member Function Documentation

◆ operator<()

int owl::TStreamableClass::operator< ( const TStreamableClass & n) const
inline

Definition at line 93 of file streambl.h.

◆ operator==()

int owl::TStreamableClass::operator== ( const TStreamableClass & n) const
inline

Definition at line 85 of file streambl.h.


The documentation for this class was generated from the following files: