IStreamModule

IStreamModules are used with streaming (IDataStreams). They provide a name-space like facility to help avoid conflicts between the names of classes that may be written to a stream.

Class name ambiguity becomes an issue with polymorphic streaming (::writeObject() and ::readObject()). WriteToStream() puts a representation of the class type on the stream in addition to the class data, and readFromStream picks up the class name and instantiates an object of that type which then receives data from the stream.

For example:

// // Declare a streamable class, probably in a header file // class myClass: public virtual IMStreamable { ... }

// // Implementation for the above class, in a .cpp file. //

// the stream module into which myClass will be scoped. IStreamModule gMyStreamModule("my_product_name_and_my_company_name");

// associate myClass with this stream module StreamableDefinitionsMacro(myClass, gMyStreamModule);

// implementation of the member functions of myClass... myClass::myClass() {

Do not derive from this class.

This class is not thread aware.


IStreamModule - Member Functions and Data by Group

Constructors & Destructor

The constructor and destructor for this class.


[view class]
~IStreamModule
public:
virtual ~IStreamModule()

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IStreamModule
public:
IStreamModule(const char* moduleName)
Construct a named IStreamModule. Instances are always static (or global) variables.
moduleName
The name that is used, together with the C++ class name, to uniquely identify types on a stream.

Choose the name such that other developers will not inadvertantly pick the same one.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IStreamModule - Inherited Member Functions and Data

Inherited Public Functions

Inherited Public Data

Inherited Protected Functions

Inherited Protected Data