C++ serialize giude
来源:互联网 发布:金山软件2017校园招聘 编辑:程序博客网 时间:2024/06/04 01:12
A practical guide to C++ serialization
原网址:http://www.ocoudert.com/blog/2011/07/09/a-practical-guide-to-c-serialization/
In a nutshell, serialization consists of writing data and objects on a support (a file, a buffer, a socket), so that they can be reconstructed later in the memory of the same or another computing host. The reconstruction process is also known as deserialization.
Serializing a primitive type like a bool, int, or float, is trivial: just write the data as it is (assuming that no compression is used). Serializing a pointer is different: the object it points to must be serialized first. That way deserializing the pointer simply consists of setting its value to the memory address at which the object has been reconstructed.
We can distinguish three levels of complexity in serialization, depending on how complex the pointer (and reference) graph is:
- The pointer graph is a forest (i.e., a set of trees). Data can simply be serialized bottom up with a depth first traversal of the trees.
- The pointer graph is a directed acyclic graph (DAG), i.e., a graph without loop. We can still serialize the data bottom up, making sure we write and restore shared data only once.
- The pointer graph is a general graph, i.e., it may have loops. We need to write and restore data with forward references so that loops are handled properly.
Having a binary archive that is portable between 32 and 64 bits is not trivial, because C++ does not specify exactly the size of primitive types. For instance a long is usually 4 bytes on a 32 bits machine, and 8 bytes on a 64 bits machine. In practice though it is pretty portable –there is a non-official version for a portable binary archive.
- C++ serialize giude
- serialize
- serialize()
- Serialize Your Deck with Positron [XML Serialization, XSD, C#]
- Serialize Data Structures in C —— stackoverflow.com
- serialize 方法
- $.Form.serialize
- metro serialize
- jquery serialize()
- serialize unserialize
- c# serialize
- js serialize()
- jquery serialize()
- objective-C中的序列化(serialize)与反序列化(deserialize)
- objective-C中的序列化(serialize)与反序列化(deserialize)
- [Interview] Serialize and De-serialize a tree
- 【语言-C#】c# 工程文件的保存(序列化Serialize)与打开(反序列化Deseriali)
- .net xml serialize
- [Qt教程] 第49篇 进阶(九) 多媒体应用简介
- MINA 简介
- 为什么我的程序编译后生成很多*$1.class文件?
- NEON
- 一个带有min函数的栈
- C++ serialize giude
- Android多媒体分析(三)通过MediaStore获取Audio信息
- 黑马程序员:File类、递归介绍(包含跨平台分隔符separator的介绍)
- C/C++静态变量
- switch default
- 外部中断(小结12)
- webrtc-android平台视频编解码分析
- U盘装系统图文教程(装机吧)
- 16.GUI【图形用户界面】