Rogue Wave Views
Application Framework Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions
IlvDvSerializable Class Reference

Application Framework serializable objects base class. More...

#include <ilviews/appframe/serializ.h>

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

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:
More...
 

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 IlvDvDocument, IlvDvDocTemplate, IlvDvProjectDocument, IlvDvDocViewInterface, IlvDvFileInfo, IlvDvGrapherDocument, IlvDvManagerDocument, and IlvDvTextDocument.


© Copyright 2016, 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.