IStreamPersist

C++
struct IStreamPersist {
};
File

IStreamPersist.h

Description

This interface must be implemented by all objects that must be serialized through the network or file.

Remarks

The main purpose of the serialization is reproduce the game remotely or saving and restoring.This mean that the object must not save everything but only what really need to be restored correctly.

IStreamPersist::IsDirty Method
C++
virtual bool IsDirty() = 0;
Returns

True must be serialized, false the object didn't change.

Description

Checks if the object must be synchronized since the last serialization.

IStreamPersist::Load Method
C++
virtual bool Load(CStream & stm, IScriptObject * pStream = NULL) = 0;
Parameters
Parameters
Description
CStream & stm
The stream class that store the bitstream.
IScriptObject * pStream = NULL
script wrapper for the stream(optional).
Returns

True if succeeded,false failed.

Description

Reads the object from a stream(file persistence).

See Also

CStream

IStreamPersist::Read Method
C++
virtual bool Read(CStream&) = 0;
Parameters
Parameters
Description
stm
The stream class that store the bitstream.
Returns

True if succeeded,false failed.

Description

Reads the object from a stream(network)

See Also

CStream

IStreamPersist::Save Method
C++
virtual bool Save(CStream & stm) = 0;
Parameters
Parameters
Description
CStream & stm
The stream class that will store the bitstream.
Returns

True if succeeded,false failed

Description

Serializes the object to a bitstream(file persistence)

See Also

CStream

IStreamPersist::Write Method
C++
virtual bool Write(CStream&) = 0;
Parameters
Parameters
Description
stm
the stream class that will store the bitstream
Returns

True if succeded,false failed

Description

Serializes the object to a bitstream(network)

See Also

CStream