摘要:
#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 阅读全文