摘要: #include <iostream> #include <memory> class SubsystemA { public: void show() { std::cout << "In SubsystemA show()." << std::endl; } }; class Subsystem 阅读全文
posted @ 2022-02-25 17:51 南乡水 阅读(13) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <memory> class Component { public: virtual void show() = 0; }; class ConcreteComponent : public Component { public: void 阅读全文
posted @ 2022-02-25 17:50 南乡水 阅读(19) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <memory> class Implementation { public: virtual void show() = 0; }; class ConcreteImplementation1 : public Implementation 阅读全文
posted @ 2022-02-25 17:49 南乡水 阅读(12) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <list> #include <memory> class Component { public: virtual void show() const = 0; virtual void add(const std::shared_ptr< 阅读全文
posted @ 2022-02-25 17:49 南乡水 阅读(20) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <memory> class Adaptee { public: void concreteShow() { std::cout << "In Adaptee concreteShow()." << std::endl; } }; class 阅读全文
posted @ 2022-02-25 17:48 南乡水 阅读(18) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> class Singleton { public: Singleton(const Singleton&) = delete; Singleton& operator = (const Singleton&) = delete; static Singleto 阅读全文
posted @ 2022-02-25 17:47 南乡水 阅读(4) 评论(0) 推荐(0) 编辑
摘要: #include <memory> #include <iostream> class Prototype { public: Prototype() {} Prototype(const Prototype& p) { this->data = p.data; } virtual std::uni 阅读全文
posted @ 2022-02-25 17:46 南乡水 阅读(13) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <memory> class Product { public: void setPartA(int partA) { this->partA = partA; } void setPartB(int partB) { this->partB 阅读全文
posted @ 2022-02-25 17:45 南乡水 阅读(24) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <memory> class ProductA { public: virtual void show() = 0; }; class ConcreteProductA1 : public ProductA { public: void sh 阅读全文
posted @ 2022-02-25 17:44 南乡水 阅读(16) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <memory> class Product { public: virtual void show() const { std::cout << "In Product show()." << std::endl; } }; class C 阅读全文
posted @ 2022-02-25 17:32 南乡水 阅读(27) 评论(0) 推荐(0) 编辑