- 博客(10)
- 问答 (1)
- 收藏
- 关注
原创 Thrift TThread
Thrift TThread的使用[cpp] view plaincopy#include #include #include #include using namespace boost; using namespace apache::thrift::concurrency; c
2015-06-29 18:24:26 456
原创 CMake的CTest方法
参考:http://hahack.com/codes/cmake/Demo目录结构如下:Test/├── add.cpp└── CMakeLists.txtadd.cpp#include #include int main(int argc, char *argv[]){ if (argc != 3) { std::cout << "pa
2015-06-26 17:28:35 12263 1
原创 nginx 内存池
nginx内存池测试了一下:#include #include "ngx_config.h"#include "ngx_conf_file.h"#include "nginx.h"#include "ngx_core.h"#include "ngx_string.h"#include "ngx_palloc.h"#include "ngx_array.h"volatile n
2015-06-25 19:02:04 259
原创 右值引用
我们写代码的时候,总会遇到下面的情况:class Obj {};Obj getObj() { Obj obj; // 创建临时变量 // some initialize code for obj return obj; // 返回一个临时变量}int main() { Obj obj = getObj(); // 这里会将返回值赋值给obj}
2015-06-24 16:31:47 256
原创 JsonCpp 使用
test.json{ "name":"huyanjie", "age":25, "peiou":{ "name":"guoran", "age":26 } }#include "json/json.h"#include #include const std::string jsonFile("test.
2015-06-17 10:33:27 252
原创 Thrift TServer
1. poll的使用#include #include #include #include #include #include int main(void) { struct pollfd fds[1]; int timeout_msecs = 10000; int ret; fds[0].fd = 0; fds[0].events =
2015-06-16 11:19:51 269
原创 thrift TProcessor
TProcessor Demo 如下:#include #include class TProcessorEventHandler { public: virtual ~TProcessorEventHandler() {} virtual void processingEvent() {}};class TProc
2015-06-11 18:29:43 832
原创 thrift 继承设计
thrift采用了NVI(Non-Virtual Interface)模式, 我写了一个demo如下: #include #include class Parent { public: void read() { read_virt();
2015-06-11 17:39:22 2289
原创 Thrift 线程池
thrift线程池使用如下:#include #include #include #include #include #include using namespace apache::thrift::concurrency;using namespace apache::thrift::server;class MyTask : public Runnable { p
2015-06-11 17:02:40 3958
空空如也
这样设计继承有什么好处?
2015-06-10
TA创建的收藏夹 TA关注的收藏夹
TA关注的人