一:什么是st_asio_wrapper它是一个c/s网络编程框架,基于对boost.asio的包装(最低在boost-1.49.0上调试过),目的是快速的构建一个c/s系统;二:st_asio_wrapper的特点效率高、跨平台、完全异步,当然这是从boost.asio继承而来;自动重连,数据透明...
分类:
移动开发 时间:
2015-01-28 00:51:34
阅读次数:
328
=====================
template
class any
{
public:
T m_data;
};
void main()
{
any a;
}
缺点是 必须知道类型,有时我们并不知道某个对象的类型。
-------------
class any
{
public:
template
any...
分类:
其他好文 时间:
2015-01-27 18:21:59
阅读次数:
177
这一章首先通过一个封装简单的类来讲解如何封装类的constructor, method和data member.
#include
#include
using namespace boost::python;
class animal
{
public:
animal()
{
myLanguage="";
};
animal(std::string la...
分类:
编程语言 时间:
2015-01-26 15:17:13
阅读次数:
273
boost::asio::io_service
/// Provides core I/O functionality.
/**
* The io_service class provides the core I/O functionality for users of the
* asynchronous I/O objects, including:
* io_service...
分类:
其他好文 时间:
2015-01-26 00:04:23
阅读次数:
355
Visual Studio is being overly cautious. In debug mode, visual studio uses something called "Checked Iterators". Pointers are also iterators, but the c...
分类:
编程语言 时间:
2015-01-25 17:58:11
阅读次数:
448
网上介绍Boost signal原理的文章很多,这里不介绍原理,仅贴一些示例代码,这在初步接触Boost signal时能够有个较好的感性认识,深入了解需要去体会挖掘boost源码。代码基本上来自Boost turioal,其中有一些错误会导致编译不过,这里都做了更正:
1. 基本运用
#include
#include
#include
using namespace std;
u...
分类:
其他好文 时间:
2015-01-23 18:30:30
阅读次数:
374
bjaminstallstage--toolset=msvc-11.0--stagedir="C:\Boost\boost_vc_110"link=sharedruntime-link=sharedthreading=multidebugrelease当前boost最新版本为1.55,下载地址:ht...
boost::deadline_timer
定义
typedef basic_deadline_timer deadline_timer;
basic_deadline_timer是个模板类。
构造函数
deadline_timer有三个构造函数:
1 explicit basic_deadline_timer(boost::asio::io_service& io_servi...
分类:
其他好文 时间:
2015-01-22 21:55:34
阅读次数:
562
01.#include 02.#include 03.#include 04.05.typedef std::list list_any;06.07.//关键部分:能够存放随意类型的对象08.void fill_list(list_any& la)09.{10. la.push_back(1000)...
分类:
其他好文 时间:
2015-01-21 22:00:33
阅读次数:
335
先看一段能够正常执行的代码,但会造成内存泄漏:
deleteObject.h
实现删除一个CObjectItem的派生类的指针所指的内存
#pragma once
namespace smtlCheck
{
class CObjectItem;
class CDeleteObject
{
public:
CDeleteObject(void);
~CDeleteObje...
分类:
其他好文 时间:
2015-01-21 15:16:22
阅读次数:
176