
C++
凭栏观雨_远
这个作者很懒,什么都没留下…
展开
-
C C++ redis pipeline读写数据
pipeline (流水线)允许 Redis 客户端一次向 Redis 发送多个命令,避免了多条指令发送多次网络请求。影响处理速度。在C,C++中,Hiredis 提供了redisAppendCommand()函数来实现流水线的命令发送方案redisAppendCommand()会先将命令缓存起来,在调用redisGetReply()方法后一次性将命令发送给redis,并取得第一个命令的返回结果。性能提升在作者使用过程中,需要将原有匹配的数据scan出来,再发请求获取对应key的value,然后替换原创 2020-08-12 21:08:46 · 2494 阅读 · 1 评论 -
C++两个栈实现一个队列
#include using namespace std;#include class Queue{public: stack myStack1; stack myStack2; void push(int t){ myStack1.push(t); } int pop(){ if (myStac原创 2016-12-08 00:14:02 · 452 阅读 · 0 评论 -
C++ 学校,班级,学生类的三级关系
学校类的属性包含班级类指针,班级类属性包含学生类指针班级类指针指向堆内存中的班级对象数组,班级类中的学生指针指向堆内存中的学生对象数组。 #include<iostream>#include <sstream>#include <string>using namespace std;class Student{public: s...原创 2016-12-09 13:03:55 · 3395 阅读 · 0 评论 -
C++动态二维对象数组
#include #include #include using namespace std;class Quota{public:string quotaName;int paramter;Quota(){}Quota(string quotaName,int paramter){this->quotaName=quotaName;this->para原创 2017-03-18 20:36:37 · 1145 阅读 · 0 评论 -
C++实现回调
#include #include #include #include using namespace std;class Lister{public:virtual void callBack(string str)const=0; };class Service{public:Service(){};void getSomething(Liste原创 2017-03-22 13:30:05 · 748 阅读 · 0 评论 -
设计模式之桥接模式C++实现
1.意图将抽象部分和与它的实现部分分离,使它们都可以独立地变化。原创 2017-05-31 21:14:15 · 851 阅读 · 0 评论