2022年5月16日
摘要: class Service { public: int QueryData() { // 服务端,查询数据,订阅数据,修改数据等 cout << "this is service data" << endl; return 0; } }; class CProxy { private: CProxy 阅读全文
posted @ 2022-05-16 21:35 蜀山菜鸟 阅读(25) 评论(0) 推荐(0)
摘要: // 抽象部分, 外部接口,抽象化产品 // 当一个类存在两个独立变化的维度,且这两个维度都需要进行扩展时。 // 当一个系统不希望使用继承或因为多层次继承导致系统类的个数急剧增加时。 // 当一个系统需要在构件的抽象化角色和具体化角色之间增加更多的灵活性时。 // 例子1: 画图形 正方形, 圆形 阅读全文
posted @ 2022-05-16 20:18 蜀山菜鸟 阅读(36) 评论(0) 推荐(0)
摘要: 继承接口赋值的时候,需要采用引用的方式,需要在初始化列表里面初始化 class Parent { public: virtual void ShowEntry() { cout << " entry parent "<< endl; }; }; class Child : public Parent 阅读全文
posted @ 2022-05-16 20:16 蜀山菜鸟 阅读(35) 评论(0) 推荐(0)
摘要: 主目录CMakeLists.txt cmake_minimum_required(VERSION 3.20) project(CppTest) set(CMAKE_CXX_STANDARD 14) include("D:/platform/gtest.cmake") include("D:/plat 阅读全文
posted @ 2022-05-16 15:26 蜀山菜鸟 阅读(189) 评论(0) 推荐(0)