摘要: 装饰器模式 #include <iostream> using namespace std; //抽象组件类 class Component{ public: virtual void move()=0; }; class ConreteComponentOne: public Component{ 阅读全文
posted @ 2021-12-03 20:38 海228 阅读(21) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; class Target{ //target接口 public: virtual void eat() = 0; virtual void sleep() = 0; }; class Adaptee{ public: 阅读全文
posted @ 2021-12-03 16:58 海228 阅读(33) 评论(0) 推荐(0)