资源简介
其实就只是对网络底层的一个封装,将一些回调全部都已经封装好,直接指定相应的回调函数就可以对收到的数据包进行处理。
个人觉得该网络库比较方便的地方就是可以直接将所有自定义及C++标准库容器直接发送到服务端,而原始的C函数发送时连续存储的内存。
注意,该库使用C11编译,所以客户端必须支持C11,压缩包里面有demo。
代码片段和文件信息
/*
Copyright (c) 2014 Randolph Voorhies Shane Grant
All rights reserved.
Redistribution and use in source and binary forms with or without
modification are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of cereal nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS“ AND
ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL RANDOLPH VOORHIES AND SHANE GRANT BE LIABLE FOR ANY
DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES
(INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable : 4244 4267)
#endif
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include se_object.hpp>
#include
#include
#include
#include
//! Runs serialization to save data to an ostringstream
/*! Used to time how long it takes to save data to an ostringstream.
Everything that happens within the save function will be timed including
any set-up necessary to perform the serialization.
@param data The data to save
@param saveFunction A function taking in an ostringstream and the data and returning void
@return The ostringstream and the time it took to save the data */
template
std::chrono::nanoseconds
saveData( T const & data std::function saveFunction std::ostringstream & os )
{
auto start = std::chrono::high_resolution_clock::now();
saveFunction( os data );
return std::chrono::duration_cast( std::chrono::high
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-07-29 18:04 libSocket\
目录 0 2015-07-29 18:05 libSocket\include\
目录 0 2015-07-29 18:05 libSocket\include\cereal-1.1.2\
文件 469 2015-06-09 02:13 libSocket\include\cereal-1.1.2\.gitignore
文件 1212 2015-06-09 02:13 libSocket\include\cereal-1.1.2\.travis.yml
文件 1158 2015-06-09 02:13 libSocket\include\cereal-1.1.2\CMakeLists.txt
目录 0 2015-07-29 18:05 libSocket\include\cereal-1.1.2\doc\
文件 80164 2015-06-09 02:13 libSocket\include\cereal-1.1.2\doc\doxygen.in
文件 6115 2015-06-09 02:13 libSocket\include\cereal-1.1.2\doc\DoxygenLayout.xm
文件 1139 2015-06-09 02:13 libSocket\include\cereal-1.1.2\doc\footer.html
文件 1847 2015-06-09 02:13 libSocket\include\cereal-1.1.2\doc\mainpage.dox
目录 0 2015-07-29 18:05 libSocket\include\cereal-1.1.2\include\
目录 0 2015-07-29 18:05 libSocket\include\cereal-1.1.2\include\cereal\
文件 18158 2015-07-17 19:58 libSocket\include\cereal-1.1.2\include\cereal\access.hpp
目录 0 2015-07-29 18:05 libSocket\include\cereal-1.1.2\include\cereal\archives\
文件 6034 2015-06-09 02:13 libSocket\include\cereal-1.1.2\include\cereal\archives\adapters.hpp
文件 6682 2015-06-09 02:13 libSocket\include\cereal-1.1.2\include\cereal\archives\binary.hpp
文件 39748 2015-06-09 02:13 libSocket\include\cereal-1.1.2\include\cereal\archives\json.hpp
文件 10813 2015-06-09 02:13 libSocket\include\cereal-1.1.2\include\cereal\archives\portable_binary.hpp
文件 35871 2015-06-09 02:13 libSocket\include\cereal-1.1.2\include\cereal\archives\xm
文件 39966 2015-07-20 17:08 libSocket\include\cereal-1.1.2\include\cereal\cereal.hpp
目录 0 2015-07-29 18:05 libSocket\include\cereal-1.1.2\include\cereal\details\
文件 13221 2015-07-17 19:58 libSocket\include\cereal-1.1.2\include\cereal\details\helpers.hpp
文件 19156 2015-06-09 02:13 libSocket\include\cereal-1.1.2\include\cereal\details\polymorphic_impl.hpp
文件 3720 2015-06-09 02:13 libSocket\include\cereal-1.1.2\include\cereal\details\static_ob
文件 91251 2015-07-17 19:58 libSocket\include\cereal-1.1.2\include\cereal\details\traits.hpp
文件 2931 2015-06-09 02:13 libSocket\include\cereal-1.1.2\include\cereal\details\util.hpp
目录 0 2015-07-29 18:05 libSocket\include\cereal-1.1.2\include\cereal\external\
文件 4035 2015-06-09 02:13 libSocket\include\cereal-1.1.2\include\cereal\external\ba
目录 0 2015-07-29 18:05 libSocket\include\cereal-1.1.2\include\cereal\external\rapidjson\
文件 28679 2015-06-09 02:13 libSocket\include\cereal-1.1.2\include\cereal\external\rapidjson\document.h
............此处省略152个文件信息
- 上一篇:C++图书信息管理系统
- 下一篇:C++图像处理几何校正可运行工程
相关资源
- C++图像处理几何校正可运行工程
- C++图书信息管理系统
- Qt5教程-传智播客C++学院
- c++流程图生成器 自动生成源代码的流
- C++聊天室(MFC实现)
- 用C++编写图像缩放程序,采用双线性
- libstdc++.so.6.0.17 和libstdc++.so.6.0.20
- Visual C++课程设计 屏幕保护程序的开发
- 空间前方交回Qt c++程序
- 数据库课程设计---超市收银系统
- c++库存管理系统源码
- LZ77算法 C++实现
- 挖金子工程源代码C++
- C++ 秒余额快捷马0.1完美版
- vc++ 动态创建故障树
- C++.How.to.Program8th.Edition 答案源代码
- 数字水印的(LSB算法)嵌入和提取V
- 家庭理财系统C++
- Seam Carving的C++实现代码
- c++获得硬盘信息
- 微软编程标准规范(含C++/VC/C#)
- 大学最新C++题库及答案
- LeetCode答案解析C++版本
- VC++6.0字符串小游戏扫雷
- C++ QQ农场源代码程序
- C++编程练习题大全(带答案)
- 万有引力搜索算法 c++代码
- c++写的一个简单的银行管理系统
- 模板:基于OpenCV的车辆速度检测c++
- 2013最新C++远程控制木马源代码
评论
共有 条评论