Mobile API Reference  MicroStrategy 2019
MSerialization Namespace Reference

Classes

class  AutoReadBlockStreamCloser
 
class  DataStreamHeader
 
class  MultiReadStream
 
class  PolymorphicSerializableObject
 
class  ReadBlockStream
 
class  ReadBlockStreamImpl
 
class  ReadByteStream
 
class  ReadByteStreamImpl
 
class  ReadDataStream
 
class  ReadDataStreamImpl
 
class  ReadListStream
 
class  ReadStreamException
 the exception during read stream operations More...
 
class  ReservedPosition
 
class  SerializableObject
 
class  SerializationException
 the root class for all exceptions in Serialization namespace More...
 
class  StreamInt32Reserve
 
class  StreamInt32ReserveImpl
 
class  StreamInt64Reserve
 
class  StreamInt64ReserveImpl
 
class  WriteBlockStream
 
class  WriteBlockStreamImpl
 
class  WriteByteStream
 
class  WriteByteStreamFileImpl
 
class  WriteByteStreamImpl
 
class  WriteDataStream
 
class  WriteDataStreamImpl
 
class  WriteListStream
 
class  WriteStreamException
 the exception during write stream operations More...
 

Typedefs

typedef MBase::StrongPtr< ReadBlockStream, MBase::DeleteOperatorGeneric< ReadBlockStream > > ReadBlockStreamPtr
 
typedef MBase::StrongPtr< ReadByteStream, MBase::DeleteOperatorGeneric< ReadByteStream > > ReadByteStreamPtr
 
typedef MBase::StrongPtr< ReadDataStream, MBase::DeleteOperatorGeneric< ReadDataStream > > ReadDataStreamPtr
 Strong pointer to the ReadDataStream. More...
 
typedef MBase::StrongPtr< StreamInt64Reserve, MBase::DeleteOperatorGeneric< StreamInt64Reserve > > StreamInt64ReservePtr
 
typedef MBase::StrongPtr< StreamInt32Reserve, MBase::DeleteOperatorGeneric< StreamInt32Reserve > > StreamInt32ReservePtr
 
typedef MBase::StrongPtr< WriteBlockStream, MBase::DeleteOperatorGeneric< WriteBlockStream > > WriteBlockStreamPtr
 
typedef MBase::StrongPtr< WriteDataStream, MBase::DeleteOperatorGeneric< WriteDataStream > > WriteDataStreamPtr
 

Enumerations

enum  TYPE {
  T_INVALID =0, T_UTF8 =1, T_DOUBLE =2, T_BOOL =3,
  T_SHORT =4, T_USHORT =5, T_INT =6, T_UINT =7,
  T_INT64 =8, T_GUID =9, T_DATETIME =10, T_VARIANT =11,
  T_SAFEINT =12, T_BINARY =13, T_BLOCK =14, T_LIST =15,
  T_UTF8_CHAR =16, T_DYNAMIC_TIME =17, T_BYTE =18, T_RAWBINARY =19,
  T_FLOAT =20, T_CHAR =21, T_OBJECT =22, T_CELLFMTDATA = 23,
  T_ARRAY =0x80, T_SMALLARRAY =0x40
}
 
enum  StreamType { ST_MEMORY, ST_FILE, ST_SHM }
 Enumeration of different stream types. More...
 

Functions

bool MoreThan32Bit (Int64 iData)
 
WriteDataStreamCreateWriteDataStreamWithNoHeader (bool iRawFormat, unsigned short=1, MBase::MemoryContract *ipMemCon=0)
 
DLL_PDSERIALIZATION_EXIM ReadBlockStreamConvertBinary2ReadBlockStream (MDataType::Binary *ipBinary, MBase::MemoryContract *ipMemCon=0)
 
DLL_PDSERIALIZATION_EXIM ReadBlockStreamConvertBinaryCollection2ReadBlockStream (MDataType::BinaryCollection *ipBinaryCol, MBase::MemoryContract *ipMemCon=0)
 
DLL_PDSERIALIZATION_EXIM ReadBlockStreamConvertWriteBlockStream2ReadBlockStream (WriteBlockStream *ipWriteStream, MBase::MemoryContract *ipMemCon=0)
 
DLL_PDSERIALIZATION_EXIM ReadBlockStreamGetReadBlockStreamFromFile (MFileSystem::ReadableFile::Ptr &iFilePtr)
 
DLL_PDSERIALIZATION_EXIM ReadByteStreamCreateReadByteStreamFromSharedMem (MMultiProcess::SharedMemory *ipSharedMemPtr)
 
DLL_PDSERIALIZATION_EXIM ReadDataStreamConvertBinary2ReadDataStream (MDataType::Binary *ipB, MBase::MemoryContract *ipMemCon=0)
 
DLL_PDSERIALIZATION_EXIM ReadDataStreamConvertWriteDataStream2ReadDataStream (WriteDataStream *ipWriteStream, MBase::MemoryContract *ipMemCon=0)
 
DLL_PDSERIALIZATION_EXIM ReadDataStreamGetReadDataStreamFromFile (MFileSystem::ReadableFile::Ptr &iFilePtr)
 
DLL_PDSERIALIZATION_EXIM ReadDataStreamCreateReadDataStreamFromSharedMem (MMultiProcess::SharedMemory *ipSharedMemPtr, MBase::MemoryContract *ipMemCon)
 
DLL_PDSERIALIZATION_EXIM ReadDataStreamCreateReadDataStreamFromSharedMemByteStream (ReadByteStream *ipSharedMemReadBStreamPtr, MBase::MemoryContract *ipMemCon)
 
DLL_PDSERIALIZATION_EXIM WriteBlockStreamCreateWriteBlockStream (MBase::MemoryContract *ipMemCon=0, unsigned short iHeader=1)
 
DLL_PDSERIALIZATION_EXIM WriteBlockStreamCreateRawWriteBlockStream (MBase::MemoryContract *ipMemCon=0, unsigned short iHeader=1)
 
DLL_PDSERIALIZATION_EXIM WriteBlockStreamCreateSafeWriteBlockStream (MBase::MemoryContract *ipMemCon=0, unsigned short iHeader=1)
 
DLL_PDSERIALIZATION_EXIM WriteBlockStreamCreateSafeRawWriteBlockStream (MBase::MemoryContract *ipMemCon=0, unsigned short iHeader=1)
 
DLL_PDSERIALIZATION_EXIM WriteBlockStreamConvertBinaries2WriteBlockStream (MDataType::BinaryCollection *ipBinaries, MBase::MemoryContract *ipMemCon=0)
 
DLL_PDSERIALIZATION_EXIM WriteBlockStreamCreateWriteBlockStream (MFileSystem::WriteableFile::Ptr &iFilePtr, unsigned short header=1)
 
DLL_PDSERIALIZATION_EXIM WriteBlockStreamCreateRawWriteBlockStream (MFileSystem::WriteableFile::Ptr &iFilePtr, unsigned short header=1)
 
DLL_PDSERIALIZATION_EXIM WriteBlockStreamCreateSafeWriteBlockStream (MFileSystem::WriteableFile::Ptr &iFilePtr, unsigned short header=1)
 
DLL_PDSERIALIZATION_EXIM WriteBlockStreamCreateSafeRawWriteBlockStream (MFileSystem::WriteableFile::Ptr &iFilePtr, unsigned short header=1)
 
DLL_PDSERIALIZATION_EXIM WriteBlockStreamConvertFile2WriteBlockStream (MFileSystem::UpdateableFile::Ptr &iFilePtr, unsigned short header=1)
 
DLL_PDSERIALIZATION_EXIM WriteBlockStreamCreatePartialEncryptedSafeWriteBlockStream (MBase::MemoryContract *ipMemCon=0, unsigned short iHeader=1, MEncryptor::EncryptionVersion iEncryptionVersion=MEncryptor::AES, const char *ipcKey=NULL)
 
DLL_PDSERIALIZATION_EXIM WriteBlockStreamCreatePartialEncryptedSafeWriteBlockStream (MFileSystem::WriteableFile::Ptr &iFilePtr, unsigned short iHeader=1, MEncryptor::EncryptionVersion iEncryptionVersion=MEncryptor::AES, const char *ipcKey=NULL)
 
DLL_PDSERIALIZATION_EXIM WriteByteStream::ReturnPtr CreateWriteByteStream (MDataType::BinaryCollection *ipBins, unsigned Int32 iBlockSize=512, MBase::MemoryContract *ipMemoryContract=NULL)
 
DLL_PDSERIALIZATION_EXIM WriteByteStream::ReturnPtr CreateWriteByteStream (MFileSystem::WriteableFile::Ptr &iFilePtr)
 
DLL_PDSERIALIZATION_EXIM WriteByteStream::ReturnPtr CreateWriteByteStream (MMultiProcess::SharedMemory *ipSharedMemPtr, unsigned Int32 iBlockSize=1024)
 
DLL_PDSERIALIZATION_EXIM WriteDataStreamCreateWriteDataStream (MBase::MemoryContract *ipMemCon=0, unsigned short header=1)
 
DLL_PDSERIALIZATION_EXIM WriteDataStreamCreateRawWriteDataStream (MBase::MemoryContract *ipMemCon=0, unsigned short header=1)
 
DLL_PDSERIALIZATION_EXIM WriteDataStreamCreateSafeWriteDataStream (MBase::MemoryContract *ipMemCon=0, unsigned short header=1)
 
DLL_PDSERIALIZATION_EXIM WriteDataStreamCreateSafeRawWriteDataStream (MBase::MemoryContract *ipMemCon=0, unsigned short header=1)
 
DLL_PDSERIALIZATION_EXIM WriteDataStreamConvertBinaries2WriteDataStream (MDataType::BinaryCollection *ipBins, MBase::MemoryContract *ipMemCon=0)
 
DLL_PDSERIALIZATION_EXIM WriteDataStreamCreateWriteDataStream (MFileSystem::WriteableFile::Ptr &iFilePtr, unsigned short header=1)
 
DLL_PDSERIALIZATION_EXIM WriteDataStreamCreateRawWriteDataStream (MFileSystem::WriteableFile::Ptr &iFilePtr, unsigned short header=1)
 
DLL_PDSERIALIZATION_EXIM WriteDataStreamCreateSafeWriteDataStream (MFileSystem::WriteableFile::Ptr &iFilePtr, unsigned short header=1)
 
DLL_PDSERIALIZATION_EXIM WriteDataStreamCreateSafeRawWriteDataStream (MFileSystem::WriteableFile::Ptr &iFilePtr, unsigned short header=1)
 
DLL_PDSERIALIZATION_EXIM WriteDataStreamCreateWriteDataStreamToSharedMem (MMultiProcess::SharedMemory *ipSharedMemPtr, unsigned Int32 iBlockSize=1024)
 
DLL_PDSERIALIZATION_EXIM WriteDataStreamCreateWriteDataStreamToSharedMemByteStream (MSerialization::WriteByteStream *ipSharedMemWriteByteStreamPtr)
 

Variables

const unsigned char GN_Data_Stream_Flag = 0xBE
 
const unsigned short LONG_VERSION = 0x8000
 const value for specifying the safe version of WriteDataStream More...
 

Typedef Documentation

◆ ReadBlockStreamPtr

◆ ReadByteStreamPtr

◆ ReadDataStreamPtr

◆ StreamInt32ReservePtr

◆ StreamInt64ReservePtr

◆ WriteBlockStreamPtr

◆ WriteDataStreamPtr

Enumeration Type Documentation

◆ StreamType

Enumeration of different stream types.

Enumerator
ST_MEMORY 
ST_FILE 

!< Stream is serialized in memory

ST_SHM 

!< Stream is serialized into a file

!< Stream is serialized to shared memory

◆ TYPE

Enumerator
T_INVALID 
T_UTF8 
T_DOUBLE 
T_BOOL 
T_SHORT 
T_USHORT 
T_INT 
T_UINT 
T_INT64 
T_GUID 
T_DATETIME 
T_VARIANT 
T_SAFEINT 
T_BINARY 
T_BLOCK 
T_LIST 
T_UTF8_CHAR 
T_DYNAMIC_TIME 
T_BYTE 
T_RAWBINARY 
T_FLOAT 
T_CHAR 
T_OBJECT 
T_CELLFMTDATA 
T_ARRAY 
T_SMALLARRAY 

Function Documentation

◆ ConvertBinaries2WriteBlockStream()

DLL_PDSERIALIZATION_EXIM WriteBlockStream* MSerialization::ConvertBinaries2WriteBlockStream ( MDataType::BinaryCollection ipBinaries,
MBase::MemoryContract ipMemCon = 0 
)

Create a WriteBlockStream from a BinaryCollection. The stream header will be decided by the data in the BinaryCollection. If the stream header has safe stream flag, the stream will be serialized using safe format.

Any new writing operation wills start from the end of the stream The new WriteBlockStream will take the ownership of the BinaryCollection.
Parameters
ipBinsthe pointer to the BinaryCollection which will become the body of the WriteBlockStream. This BinaryCollection must contain header data. Otherwise, serialization exception will be thrown.
ipMemCona pointer to MemoryContract. Its default value is NULL.
Returns
a pointer to the created WriteBlockStream.
Exceptions
WriteStreamException.

◆ ConvertBinaries2WriteDataStream()

DLL_PDSERIALIZATION_EXIM WriteDataStream* MSerialization::ConvertBinaries2WriteDataStream ( MDataType::BinaryCollection ipBins,
MBase::MemoryContract ipMemCon = 0 
)

Create a WriteDataStream from a BinaryCollection. The stream header will be decided by the data in the BinaryCollection. If the stream header has safe stream flag, the stream will be serialized using safe format. The new WriteDataStream will take the ownership of the BinaryCollection.

Parameters
ipBinsthe pointer to the BinaryCollection. This BinaryCollection must contain header data. Otherwise, serialization exception will be thrown.
ipMemCona pointer to MemoryContract. Its default value is NULL.
Returns
a pointer to the created WriteDataStream.
Exceptions
WriteStreamException.

◆ ConvertBinary2ReadBlockStream()

DLL_PDSERIALIZATION_EXIM ReadBlockStream* MSerialization::ConvertBinary2ReadBlockStream ( MDataType::Binary ipBinary,
MBase::MemoryContract ipMemCon = 0 
)

Create a ReadBlockStream object from a Binary block. The ReadBlockStream TAKE OVER the ownership of the Binary, so if the caller want to retain the Binary for other purpose beyond the lifetime of the ReadDataStream, it must duplicate the Binary. This also means the caller should not try to delete the Binary once it is given to the ReadBlockStream.

If necessary, the caller can provide a MemoryContract to guard the memory allocation during the stream operation.
Parameters
ipBinaryThe pointer to the Binary.
ipMemConthe pointer to the memeory contractor. Its default value is NULL.
Returns
a pointer to the ReadBlockStream object.

◆ ConvertBinary2ReadDataStream()

DLL_PDSERIALIZATION_EXIM ReadDataStream* MSerialization::ConvertBinary2ReadDataStream ( MDataType::Binary ipB,
MBase::MemoryContract ipMemCon = 0 
)

The factory function to create ReadDataStream from a Binary. The returned ReadDataStream TAKE OVER the ownership of the Binary, so if the caller want to retain the Binary for other purpose beyond the lifetime of the ReadDataStream, it must duplicate the Binary. This also means the caller should not try to delete the Binary once it is given to the ReadDataStream.

If necessary, the caller can provide a MemoryContract to guard the memory allocation during the stream operation.
Parameters
ipBThe pointer to the Binary.
ipMemConthe pointer to the memeory contractor. Its default value is NULL.
Returns
the pointer to the created ReadDataStream.

◆ ConvertBinaryCollection2ReadBlockStream()

DLL_PDSERIALIZATION_EXIM ReadBlockStream* MSerialization::ConvertBinaryCollection2ReadBlockStream ( MDataType::BinaryCollection ipBinaryCol,
MBase::MemoryContract ipMemCon = 0 
)

Create a ReadBlockStream object from a BinaryCollection block. The ReadBlockStream TAKE OVER the ownership of the BinaryCollection, so if the caller want to retain the Binary for other purpose beyond the lifetime of the ReadDataStream, it must duplicate the Binary. This also means the caller should not try to delete the Binary once it is given to the ReadBlockStream.

If necessary, the caller can provide a MemoryContract to guard the memory allocation during the stream operation.
Parameters
ipBinaryColThe pointer to the BinaryCollection.
ipMemConthe pointer to the memeory contractor. Its default value is NULL.
Returns
a pointer to the ReadBlockStream object.

◆ ConvertFile2WriteBlockStream()

DLL_PDSERIALIZATION_EXIM WriteBlockStream* MSerialization::ConvertFile2WriteBlockStream ( MFileSystem::UpdateableFile::Ptr iFilePtr,
unsigned short  header = 1 
)

Create a WriteBlockStream from a BinaryCollection. The stream header will be decided by the data in the BinaryCollection. If the stream header has safe stream flag, the stream will be serialized using safe format. The new data is writen at the end of the file.

◆ ConvertWriteBlockStream2ReadBlockStream()

DLL_PDSERIALIZATION_EXIM ReadBlockStream* MSerialization::ConvertWriteBlockStream2ReadBlockStream ( WriteBlockStream ipWriteStream,
MBase::MemoryContract ipMemCon = 0 
)

Create a ReadBlockStream from a WriteBlockStream directly. The ReadBlockStream TAKE OVER the ownership of the underlying data in the WriteBlockStream, so the caller cannot use WriteBlockStream::GiveOutBinary() to get those data after calling this function.

If necessary, the caller can provide a MemoryContract to guard the memory allocation during the stream operation.
Parameters
ipWriteStreamThe pointer to the WriteBlockStream.
ipMemConthe pointer to the memeory contractor. Its default value is NULL.
Returns
a pointer to the ReadBlockStream object.

◆ ConvertWriteDataStream2ReadDataStream()

DLL_PDSERIALIZATION_EXIM ReadDataStream* MSerialization::ConvertWriteDataStream2ReadDataStream ( WriteDataStream ipWriteStream,
MBase::MemoryContract ipMemCon = 0 
)

The factory function to create ReadDataStream from a WriteDataStream. The returned ReadDataStream TAKE OVER the ownership of the WriteDataStream. This also means the caller should not try to delete the WriteDataStream once it is given to the ReadDataStream.

If necessary, the caller can provide a MemoryContract to guard the memory allocation during the stream operation.
Parameters
ipWriteStreamThe pointer to the WriteDataStream.
ipMemConthe pointer to the memeory contractor. Its default value is NULL.
Returns
the pointer to the created ReadDataStream.

◆ CreatePartialEncryptedSafeWriteBlockStream() [1/2]

DLL_PDSERIALIZATION_EXIM WriteBlockStream* MSerialization::CreatePartialEncryptedSafeWriteBlockStream ( MBase::MemoryContract ipMemCon = 0,
unsigned short  iHeader = 1,
MEncryptor::EncryptionVersion  iEncryptionVersion = MEncryptor::AES,
const char *  ipcKey = NULL 
)

Similar to CreateSafeWriteBlockStream except char* and wchar_t* type data will be encrypted with specified algorithm

◆ CreatePartialEncryptedSafeWriteBlockStream() [2/2]

DLL_PDSERIALIZATION_EXIM WriteBlockStream* MSerialization::CreatePartialEncryptedSafeWriteBlockStream ( MFileSystem::WriteableFile::Ptr iFilePtr,
unsigned short  iHeader = 1,
MEncryptor::EncryptionVersion  iEncryptionVersion = MEncryptor::AES,
const char *  ipcKey = NULL 
)

Overloaded method for writing blocks to files instead of memory

◆ CreateRawWriteBlockStream() [1/2]

DLL_PDSERIALIZATION_EXIM WriteBlockStream* MSerialization::CreateRawWriteBlockStream ( MBase::MemoryContract ipMemCon = 0,
unsigned short  iHeader = 1 
)

create a fast but platform-dependent WriteBlockStream, using the specified stream header. This stream won't convert the data type into platform-neutral format. So its usage must be restricted in the same machine.

Parameters
ipMemConthe pointer to the memeory contractor. Its default value is NULL.
iHeaderthe stream header, containing the stream version information.
Returns
a pointer to the WriteBlockStream object.

◆ CreateRawWriteBlockStream() [2/2]

DLL_PDSERIALIZATION_EXIM WriteBlockStream* MSerialization::CreateRawWriteBlockStream ( MFileSystem::WriteableFile::Ptr iFilePtr,
unsigned short  header = 1 
)

◆ CreateRawWriteDataStream() [1/2]

DLL_PDSERIALIZATION_EXIM WriteDataStream* MSerialization::CreateRawWriteDataStream ( MBase::MemoryContract ipMemCon = 0,
unsigned short  header = 1 
)

create a fast but platform-dependent WriteDataStream, using the specified stream header. This stream won't convert the data type into platform-neutral format. So its usage must be restricted in the same machine.

Parameters
ipMemCona pointer to MemoryContract. Its default value is NULL.
headerthe header of the data stream. Any stream version information should be passed by it. Its default value is 1.
Returns
a pointer to the created WriteDataStream.
Exceptions
WriteStreamException.

◆ CreateRawWriteDataStream() [2/2]

DLL_PDSERIALIZATION_EXIM WriteDataStream* MSerialization::CreateRawWriteDataStream ( MFileSystem::WriteableFile::Ptr iFilePtr,
unsigned short  header = 1 
)

◆ CreateReadByteStreamFromSharedMem()

DLL_PDSERIALIZATION_EXIM ReadByteStream* MSerialization::CreateReadByteStreamFromSharedMem ( MMultiProcess::SharedMemory ipSharedMemPtr)

◆ CreateReadDataStreamFromSharedMem()

DLL_PDSERIALIZATION_EXIM ReadDataStream* MSerialization::CreateReadDataStreamFromSharedMem ( MMultiProcess::SharedMemory ipSharedMemPtr,
MBase::MemoryContract ipMemCon 
)

The following method is used for reading serialized data from shared memory directly.

Parameters
ipSharedMemPtrraw pointer to shared memory instance.

◆ CreateReadDataStreamFromSharedMemByteStream()

DLL_PDSERIALIZATION_EXIM ReadDataStream* MSerialization::CreateReadDataStreamFromSharedMemByteStream ( ReadByteStream ipSharedMemReadBStreamPtr,
MBase::MemoryContract ipMemCon 
)

The following method is used for reading serialized data from shared memory based byte stream directly.

Parameters
ipSharedMemReadBStreamPtrraw pointer to shared memory based byte stream instance.

◆ CreateSafeRawWriteBlockStream() [1/2]

DLL_PDSERIALIZATION_EXIM WriteBlockStream* MSerialization::CreateSafeRawWriteBlockStream ( MBase::MemoryContract ipMemCon = 0,
unsigned short  iHeader = 1 
)

Create a WriteBlockStream with extra safety information, using the specified stream header. This stream will put extra information into the stream to make the stream read safer

This is a fast but platform-dependent WriteBlockStream, using the specified stream header. This stream won't convert the data type into platform-neutral format. So its usage must be restricted in the same machine.

Parameters
ipMemConthe pointer to the memeory contractor. Its default value is NULL.
iHeaderthe stream header, containing the stream version information.
Returns
a pointer to the WriteBlockStream object.

◆ CreateSafeRawWriteBlockStream() [2/2]

DLL_PDSERIALIZATION_EXIM WriteBlockStream* MSerialization::CreateSafeRawWriteBlockStream ( MFileSystem::WriteableFile::Ptr iFilePtr,
unsigned short  header = 1 
)

◆ CreateSafeRawWriteDataStream() [1/2]

DLL_PDSERIALIZATION_EXIM WriteDataStream* MSerialization::CreateSafeRawWriteDataStream ( MBase::MemoryContract ipMemCon = 0,
unsigned short  header = 1 
)

Create a WriteDataStream using the specified stream header. This stream will put extra information into the stream to make the stream more robust.

This is a fast but platform-dependent WriteDataStream, using the specified stream header. This stream won't convert the data type into platform-neutral format. So its usage must be restricted in the same machine.

Parameters
ipMemCona pointer to MemoryContract. Its default value is NULL.
headerthe header of the data stream. Any stream version information should be passed by it. Its default value is 1.
Returns
a pointer to the created WriteDataStream.
Exceptions
WriteStreamException.

◆ CreateSafeRawWriteDataStream() [2/2]

DLL_PDSERIALIZATION_EXIM WriteDataStream* MSerialization::CreateSafeRawWriteDataStream ( MFileSystem::WriteableFile::Ptr iFilePtr,
unsigned short  header = 1 
)

◆ CreateSafeWriteBlockStream() [1/2]

DLL_PDSERIALIZATION_EXIM WriteBlockStream* MSerialization::CreateSafeWriteBlockStream ( MBase::MemoryContract ipMemCon = 0,
unsigned short  iHeader = 1 
)

Create a WriteBlockStream with extra safety information, using the specified stream header. This stream will put extra information into the stream to make the stream read safer

Parameters
ipMemConthe pointer to the memeory contractor. Its default value is NULL.
iHeaderthe stream header, containing the stream version information.
Returns
a pointer to the WriteBlockStream object.

◆ CreateSafeWriteBlockStream() [2/2]

DLL_PDSERIALIZATION_EXIM WriteBlockStream* MSerialization::CreateSafeWriteBlockStream ( MFileSystem::WriteableFile::Ptr iFilePtr,
unsigned short  header = 1 
)

◆ CreateSafeWriteDataStream() [1/2]

DLL_PDSERIALIZATION_EXIM WriteDataStream* MSerialization::CreateSafeWriteDataStream ( MBase::MemoryContract ipMemCon = 0,
unsigned short  header = 1 
)

Create a WriteDataStream using the specified stream header. This stream will put extra information into the stream to make the stream more robust.

Parameters
ipMemCona pointer to MemoryContract. Its default value is NULL.
headerthe header of the data stream. Any stream version information should be passed by it. Its default value is 1.
Returns
a pointer to the created WriteDataStream.
Exceptions
WriteStreamException.

◆ CreateSafeWriteDataStream() [2/2]

DLL_PDSERIALIZATION_EXIM WriteDataStream* MSerialization::CreateSafeWriteDataStream ( MFileSystem::WriteableFile::Ptr iFilePtr,
unsigned short  header = 1 
)

◆ CreateWriteBlockStream() [1/2]

DLL_PDSERIALIZATION_EXIM WriteBlockStream* MSerialization::CreateWriteBlockStream ( MBase::MemoryContract ipMemCon = 0,
unsigned short  iHeader = 1 
)

create a WriteBlockStream, using the specified stream header.

Parameters
ipMemConthe pointer to the memeory contractor. Its default value is NULL.
iHeaderthe stream header, containing the stream version information.
Returns
a pointer to the WriteBlockStream object.

◆ CreateWriteBlockStream() [2/2]

DLL_PDSERIALIZATION_EXIM WriteBlockStream* MSerialization::CreateWriteBlockStream ( MFileSystem::WriteableFile::Ptr iFilePtr,
unsigned short  header = 1 
)

We don't have a CreateWriteListStream() function here, because there is no need for a list stream which is not a block stream. Every list stream is a blcok stream too. We separate the interface just for the purpose of clarity. The following are overloaded methods for writing blocks to files instead of memory. Useful when serializing large data.

Parameters
iFilePtrStrong pointer to a Writeable file. The caller opens a Writeable file and gives up ownership of the file pointer to the block stream. When all is done the block stream commits and closes the file.

◆ CreateWriteByteStream() [1/3]

DLL_PDSERIALIZATION_EXIM WriteByteStream::ReturnPtr MSerialization::CreateWriteByteStream ( MDataType::BinaryCollection ipBins,
unsigned Int32  iBlockSize = 512,
MBase::MemoryContract ipMemoryContract = NULL 
)

◆ CreateWriteByteStream() [2/3]

DLL_PDSERIALIZATION_EXIM WriteByteStream::ReturnPtr MSerialization::CreateWriteByteStream ( MFileSystem::WriteableFile::Ptr iFilePtr)

◆ CreateWriteByteStream() [3/3]

DLL_PDSERIALIZATION_EXIM WriteByteStream::ReturnPtr MSerialization::CreateWriteByteStream ( MMultiProcess::SharedMemory ipSharedMemPtr,
unsigned Int32  iBlockSize = 1024 
)

◆ CreateWriteDataStream() [1/2]

DLL_PDSERIALIZATION_EXIM WriteDataStream* MSerialization::CreateWriteDataStream ( MBase::MemoryContract ipMemCon = 0,
unsigned short  header = 1 
)

Create a WriteDataStream using the specified stream header.

Parameters
ipMemCona pointer to MemoryContract. Its default value is NULL.
headerthe header of the data stream. Any stream version information should be passed by it. Its default value is 1.
Returns
a pointer to the created WriteDataStream.
Exceptions
WriteStreamException.

◆ CreateWriteDataStream() [2/2]

DLL_PDSERIALIZATION_EXIM WriteDataStream* MSerialization::CreateWriteDataStream ( MFileSystem::WriteableFile::Ptr iFilePtr,
unsigned short  header = 1 
)

The following are overloaded methods for writing data to file instead of memory. Useful when serializing large data.

Parameters
iFilePtrStrong pointer to a Writeable file. The caller opens a Writeable file and gives up ownership of the file pointer to the data stream. When all is done the data stream commits and closes the file.

◆ CreateWriteDataStreamToSharedMem()

DLL_PDSERIALIZATION_EXIM WriteDataStream* MSerialization::CreateWriteDataStreamToSharedMem ( MMultiProcess::SharedMemory ipSharedMemPtr,
unsigned Int32  iBlockSize = 1024 
)

Create a write data stream which writes directly to the shared memory

◆ CreateWriteDataStreamToSharedMemByteStream()

DLL_PDSERIALIZATION_EXIM WriteDataStream* MSerialization::CreateWriteDataStreamToSharedMemByteStream ( MSerialization::WriteByteStream ipSharedMemWriteByteStreamPtr)

Create a write data stream which writes directly to the shared memory based byte stream

◆ CreateWriteDataStreamWithNoHeader()

WriteDataStream* MSerialization::CreateWriteDataStreamWithNoHeader ( bool  iRawFormat,
unsigned  short = 1,
MBase::MemoryContract ipMemCon = 0 
)

◆ GetReadBlockStreamFromFile()

DLL_PDSERIALIZATION_EXIM ReadBlockStream* MSerialization::GetReadBlockStreamFromFile ( MFileSystem::ReadableFile::Ptr iFilePtr)

We don't have a ConvertBinary2ReadListStream here, because there is no need for a list stream which is not a block stream. Every list stream is a blcok stream too. We separate the interface just for the purpose of clarity. The following method is used for reading serialized data from a file.

Parameters
iFilePtrStrong pointer to a Readable file that contains a block stream. The caller opens a Readable file and gives up ownership of the file pointer to the block stream. When all is done the block stream commits and closes the file.

◆ GetReadDataStreamFromFile()

DLL_PDSERIALIZATION_EXIM ReadDataStream* MSerialization::GetReadDataStreamFromFile ( MFileSystem::ReadableFile::Ptr iFilePtr)

The following method is used for reading serialized data from a file.

Parameters
iFilePtrStrong pointer to a Readable file that contains a data stream. The caller opens a Readable file and gives up ownership of the file pointer to the data stream. When all is done the data stream commits and closes the file.

◆ MoreThan32Bit()

bool MSerialization::MoreThan32Bit ( Int64  iData)

Variable Documentation

◆ GN_Data_Stream_Flag

const unsigned char MSerialization::GN_Data_Stream_Flag = 0xBE

◆ LONG_VERSION

const unsigned short MSerialization::LONG_VERSION = 0x8000

const value for specifying the safe version of WriteDataStream