ICF 3.0.5.47
Technical documentation of ICF Libraries
CMemoryReadArchive.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#pragma once
7
8
9// ICF includes
11
12
13namespace iser
14{
15
16
17class ISerializable;
18class CMemoryWriteArchive;
19
20
27{
28public:
30
32 const void* bufferPtr,
33 int bufferSize,
34 bool serializeHeader = true);
36 const CMemoryWriteArchive& writeArchive,
37 bool serializeHeader = true);
38
42 virtual void ResetPosition();
43
48 virtual bool IsValid() const;
49
50 // reimplemented (iser::IArchive)
51 virtual bool ProcessData(void* data, int size);
52
53 // static methods
57 static bool CloneByArchive(const ISerializable& object, ISerializable& result);
61 static bool CloneByArchive(const istd::IChangeable& object, istd::IChangeable& result);
65 static bool CompareByArchive(const istd::IChangeable& object1, const istd::IChangeable& object2);
66
67protected:
68 // reimplemented (iser::CArchiveBase)
69 virtual int GetMaxStringLength() const;
70
71 const quint8* m_bufferPtr;
75};
76
77
78} // namespace iser
79
80
Base class for archive implementations reading data based on its binary representation.
Implementation of archive using memory buffer to read the persistent objects.
virtual int GetMaxStringLength() const
Get maximal allowed string size.
static bool CompareByArchive(const istd::IChangeable &object1, const istd::IChangeable &object2)
Compare two objects using coparision of serialized streams.
CMemoryReadArchive(const void *bufferPtr, int bufferSize, bool serializeHeader=true)
static bool CloneByArchive(const istd::IChangeable &object, istd::IChangeable &result)
Try copy of two objects using of serialization.
CMemoryReadArchive(const CMemoryWriteArchive &writeArchive, bool serializeHeader=true)
static bool CloneByArchive(const ISerializable &object, ISerializable &result)
Clone serializable objects using iser::CMemoryWriteArchive and iser::CMemoryReadArchive archives.
virtual bool ProcessData(void *data, int size)
Process binary data block.
virtual bool IsValid() const
Returns true if the archive is in valid state and internal position cursor has not reached end of arc...
CBinaryReadArchiveBase BaseClass
virtual void ResetPosition()
Seeks internal cursor to the begin of data.
Implementation of archive using memory buffer to store the persistent objects.
Common class for all classes which objects can be archived or restored from archive.
Common interface for data model objects, which can be changed.
Definition IChangeable.h:32
Contains general persistence mechanism with basic archives implementations.

© Witold Gantzke and Kirill Lepskiy