1、实现多线程方法:其实就是多个线程同时调用io_service::run for (int i = 0; i != m_nThreads; ++i) { boost::shared_ptr pTh(new boost::thread( boost::bind(&...
分类:
编程语言 时间:
2014-08-12 00:34:33
阅读次数:
1592
一、命令行解析tprogram_options解析命令行参数示例代码:[cpp]view plaincopy#includeusingnamespacestd;#includenamespacepo=boost::program_options;intmain(intargc,char*argv[]...
分类:
其他好文 时间:
2014-08-12 00:32:53
阅读次数:
358
boost::property_tree读取解析ini文件[cpp]view plaincopy#include"stdafx.h"#include#include#includeintmain(){boost::property_tree::ptreept;boost::property_tree...
分类:
其他好文 时间:
2014-08-12 00:32:43
阅读次数:
293
boost::property_tree读取解析.xml文件1)read_xml 支持中文路径 boost::property_tree::wptree wpt; std::locale::global(std::locale("")); boost::property_tree::xml_pars...
分类:
其他好文 时间:
2014-08-12 00:32:33
阅读次数:
400
当使用xml_parser进行读xml时,如果遇到中文字符会出现解析错误。网上有解决方案说使用wptree来实现,但当使用wptree来写xml时也会出错。而使用ptree来写中文时不会出错。综合以上信息,尝试使用ptree来写xml,而用wptree来读。以一个demo来说明吧。1 //包含文件2...
分类:
其他好文 时间:
2014-08-12 00:22:23
阅读次数:
348
property_tree是专为配置文件而写,支持xml,ini和json格式文件ini比较简单,适合简单的配置,通常可能需要保存数组,这时xml是个不错的选择。使用property_tree也很简单,boost自带的帮助中有个5分钟指南http://www.boost.org/doc/libs/1...
分类:
其他好文 时间:
2014-08-12 00:20:43
阅读次数:
264
Five Minute TutorialThis tutorial uses XML. Note that the library is not specifically bound to XML, and any other supported format (such as INI or JSO...
分类:
其他好文 时间:
2014-08-12 00:20:33
阅读次数:
269
boost 官网http://www.boost.org/下载页面http://sourceforge.net/projects/boost/files/boost/1.53.0/我下载的是boost_1_53_0.tar.gz使用系统 ubuntu 12.10一、解压[plain]view pla...
分类:
编程语言 时间:
2014-08-12 00:18:23
阅读次数:
1607
智能指针的学习中文教程网站http://zh.highscore.de/cpp/boost/不过代码可能 由于BOOST 版本不同需要稍作修改scoped_ptr 离开作用域则自动调用类析构函数或者函数delete方法shared_ptr 使用率最高的指针 类似scoped_ptr 但是所有权可以转...
分类:
其他好文 时间:
2014-08-11 20:48:02
阅读次数:
270
发送端#include "DBProc1.h"#include #include #include using namespace boost::interprocess;PLUG_COMPONENT_AUTO_REG(DBProc1)//DO NOT EDIT THISstruct MyStruc...
分类:
其他好文 时间:
2014-08-10 15:29:30
阅读次数:
289