摘要:
#include <iostream> #include <memory> class ConcreteComponent1; class ConcreteComponent2; class Visitor { public: virtual void visitconcretecomponent1 阅读全文
摘要:
#include <iostream> #include <memory> class AbstractClass { public: void show() { op1(); op2(); op3(); hook(); } protected: void op1() { std::cout << 阅读全文
摘要:
#include <iostream> #include <memory> class Strategy { public: virtual void show() = 0; }; class Context { public: void setStrategy(std::shared_ptr<St 阅读全文
摘要:
#include <iostream> #include <list> #include <memory> class AbstractObserver { public: virtual void update(std::string msg) = 0; }; class AbstractSubj 阅读全文
摘要:
#include <iostream> #include <memory> class Context; class State { public: virtual void handle1(Context *c) = 0; virtual void handle2(Context *c) = 0; 阅读全文
摘要:
#include <iostream> #include <memory> #include <vector> class Momento { public: Momento(std::string state) { this->state_ = state; } std::string state 阅读全文
摘要:
#include <iostream> #include <memory> class Mediator { public: virtual void Notify(std::string Msg) = 0; }; class BaseComponent { public: virtual void 阅读全文
摘要:
#include <iostream> #include <memory> #include <vector> template <typename T, typename U> class Iterator { public: virtual U cur() = 0; virtual void n 阅读全文
摘要:
#include <iostream> #include <memory> class Reciever { public: void op1() { std::cout << "In Reciever op1()." << std::endl; } void op2() { std::cout < 阅读全文
摘要:
#include <iostream> #include <memory> class Handler { public: virtual void handle(int data) = 0; virtual void setNextHandler(std::shared_ptr<Handler> 阅读全文
摘要:
#include <iostream> #include <memory> class Subject { public: virtual void show() = 0; }; class RealSubject : public Subject { public: void show() ove 阅读全文
摘要:
#include <iostream> #include <memory> #include <unordered_map> class Flyweight { public: Flyweight(int data) : data_(data) {} void show() { std::cout 阅读全文
摘要:
#include <iostream> #include <memory> class SubsystemA { public: void show() { std::cout << "In SubsystemA show()." << std::endl; } }; class Subsystem 阅读全文
摘要:
#include <iostream> #include <memory> class Component { public: virtual void show() = 0; }; class ConcreteComponent : public Component { public: void 阅读全文
摘要:
#include <iostream> #include <memory> class Implementation { public: virtual void show() = 0; }; class ConcreteImplementation1 : public Implementation 阅读全文
摘要:
#include <iostream> #include <list> #include <memory> class Component { public: virtual void show() const = 0; virtual void add(const std::shared_ptr< 阅读全文
摘要:
#include <iostream> #include <memory> class Adaptee { public: void concreteShow() { std::cout << "In Adaptee concreteShow()." << std::endl; } }; class 阅读全文
摘要:
#include <iostream> class Singleton { public: Singleton(const Singleton&) = delete; Singleton& operator = (const Singleton&) = delete; static Singleto 阅读全文
摘要:
#include <memory> #include <iostream> class Prototype { public: Prototype() {} Prototype(const Prototype& p) { this->data = p.data; } virtual std::uni 阅读全文
摘要:
#include <iostream> #include <memory> class Product { public: void setPartA(int partA) { this->partA = partA; } void setPartB(int partB) { this->partB 阅读全文