rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Application Framework Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvDvSerializable Class Reference

Application Framework serializable objects base class. More...

Inheritance diagram for IlvDvSerializable:
IlvDvActionDescriptor IlvDvCommand IlvDvDocTemplate IlvDvDocument IlvDvDocViewInterface IlvDvFileInfo IlvDvActionGadgetItem IlvDvManagerDocument IlvDvProjectDocument IlvDvTextDocument IlvDvFormView IlvDvHierarchicalSheetView IlvDvListView IlvDvMatrixView IlvDvSheetView IlvDvTextView IlvDvTreeView IlvDvView

List of all members.

Public Member Functions

virtual void serialize (IlvDvStream &stream)
 Serializes the object in the stream stream.
Typically, the body of the method has the following form:
.

Detailed Description

Application Framework serializable objects base class.

Library: ilvappframe

IlvDvSerializable is a root base class shared by most Application Framework classes.
Application Framework provides a serialization mechanism that allows an object of a class inheriting from IlvDvSerializable class to be * saved in a stream and to be dynamically created and loaded from a stream.
To do this, the inheriting class must first use the macro IlvDvDeclareDynCreate(); in its header file and the following macros in the implementation file, in this order:

 IlvDvPreRegisterDynClass(<classname>, <superClassname>);
 IL_BEGINMODULEINITDEF(<moduleName>)
    IlvDvPostRegisterDynClass(<classname>, <superClassname>);
 IL_ENDMODULEINITDEF(<moduleName>)

Then, it must redefine the method serialize(IlvDvStream& stream) to serialize its data.


Member Function Documentation

virtual void IlvDvSerializable::serialize ( IlvDvStream stream  )  [virtual]

Serializes the object in the stream stream.
Typically, the body of the method has the following form:
.

 void
 MyClass::serialize(IlvDvStream& stream) {
     Superclass::serialize(stream);
        if (stream.isSaving()) {
            // Here, write your persistent data
        } else {
            // Here, read data from stream
        }
 }

There are two ways to load and save data.
One way is to use istream or ostream objects given by methods istream* getInStream() const and ostream* getOutStream() const from the IlvDvStream class directly.
The other way, which is usually easier, is to use specific serialization methods provided by the IlvDvStream class.
This class provides serialization operators for basic types (IlInt, IlBoolean, and so on), and provides methods that make it easy to save a string, a bitmap, an IlvDvSerializable object, and an array of IlvDvSerializable objects.

Reimplemented in IlvDvDocTemplate, IlvDvTextDocument, IlvDvDocument, IlvDvGrapherDocument, IlvDvManagerDocument, IlvDvFileInfo, IlvDvProjectDocument, and IlvDvDocViewInterface.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.