08 2017 档案

设计模式 策略模式2 c++11
摘要:根据需求的不同 选择不同的策略算法 之前是保存的各种策略类的指针 这里直接使用 function bind 选择对应的算法 代码 // 005.cpp: 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <functional> #include <ios 阅读全文

posted @ 2017-08-31 10:36 itdef 阅读(192) 评论(0) 推荐(0)

设计模式策略模式
摘要:参考http://blog.csdn.net/calmreason/article/details/51029285 定义一系列相同的算法 根据不同需求选择不同的算法策略 使用 bind function 见 设计模式 策略模式2 c++11 代码 // 004.cpp: 定义控制台应用程序的入口点 阅读全文

posted @ 2017-08-31 10:16 itdef 阅读(142) 评论(0) 推荐(0)

设计模式之桥接模式 c++11
摘要:参考http://blog.csdn.net/calmreason/article/details/50909321 桥接模式 实现与抽象之间由指针关联 调用sample类 实际是调用sample类保存的实现类的方法 代码: // 003.cpp: 定义控制台应用程序的入口点。 // #includ 阅读全文

posted @ 2017-08-31 10:10 itdef 阅读(199) 评论(0) 推荐(0)

设计模式 工厂模式 使用shared_ptr
摘要:参考http://blog.csdn.net/calmreason/article/details/50903729 所有产品继承同一基本类 由工厂保存基类指针 产生各类产品 代码 // 002.cpp: 定义控制台应用程序的入口点。 // #include "stdafx.h" #include 阅读全文

posted @ 2017-08-31 10:04 itdef 阅读(413) 评论(0) 推荐(0)

设计模式发布订阅
摘要:参考 http://blog.csdn.net/calmreason/article/details/50895191 主要是发布者存储订阅者的指针 发布时依次NOTIFY 发送信息 订阅者在订阅时将自己加入到发布者的容器中 使用C++11 的智能指针 需要注意智能指针的 weak shared的转 阅读全文

posted @ 2017-08-31 09:58 itdef 阅读(283) 评论(0) 推荐(0)

查表胡牌判断算法 c++
摘要:根据 日文胡牌算法资料 JAVA 此篇博文资料 改写的C++ 代码 tbl.h 1 #pragma once 2 #include <map> 3 #include <vector> 4 5 void init1(std::map<int, std::vector<int>>& tbl); 6 vo 阅读全文

posted @ 2017-08-26 14:43 itdef 阅读(1592) 评论(0) 推荐(0)

日文胡牌算法资料 JAVA
摘要:原地址: http://hp.vector.co.jp/authors/VA046927/mjscore/mjalgorism.html 阅读全文

posted @ 2017-08-25 11:17 itdef 阅读(811) 评论(0) 推荐(0)

学习计划
摘要:学习计划清单 放在这里 督促自己执行 近期任务 leetcode stl 源码学习 bttorrent编写 (优先BCODE解析) 分布式存储编写 json 解析(实战 大量测试 稳定和内存泄漏) leveldb 源码学习 muduo 源码学习 python csdn 11111Python编程实战 阅读全文

posted @ 2017-08-25 09:29 itdef 阅读(522) 评论(0) 推荐(0)

随机发牌 代码
摘要:// random.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include #include #include #include #include #include #include const int MAJIANG_GROUP_LENGTH = 84; const int POST_BLOCK_COUNT = 4; co... 阅读全文

posted @ 2017-08-15 14:13 itdef 阅读(285) 评论(0) 推荐(0)

网络传输 buf 封装 示例代码
摘要:网络传输 buf 封装 示例代码 使用boost库 asio 阅读全文

posted @ 2017-08-15 14:02 itdef 阅读(330) 评论(2) 推荐(0)

导航