一种C++的json序列化框架的设计与实现
首发时间:2018-03-13
摘要:本文描述了一种轻量级的JSON序列化框架。该框架使用C++11引入的enable_if和模板偏特化等C++元编程技术,实现了对象、基本类型、STL容器的统一序列化接口,同时框架还提供了类型安全性检测机制和便于扩展的模块化组件。框架底层利用JSON解析器Boost.property_tree高效地实现了IO流的序列化和反序列化操作。最后我们给出了在JSON-RPC中使用该框架的实例。
For information in English, please click here
Design and Implementation of a JSON Serialization Framework Based on C++
Abstract:In this paperwedescribes a lightweight JSON serialization framework. The framework uses the C ++ metaprogramming technique, such as enable_if introduced by C ++ 11and template partial specialization, to realize the uniform serialization interface of objects, basic types and STL containers. The framework also provides type-safety detection mechanism and easy extension Modular components, The use of JSON parser Boost.property_tree efficient IO stream serialization and deserialization operations. Finally, we give an example of how the framework is used by JSON-RPC and analyze the possibility of extending the framework as a generic C ++ serialization framework.
Keywords: computer application JSON Object serialization C++ Meta programming
基金:
引用
No.****
动态公开评议
共计0人参与
勘误表
一种C++的json序列化框架的设计与实现
评论
全部评论0/1000