摘要:
class Component{public: virtual void Operation() = 0;};class ConcreteComponent : public Component{public: // Interface. virtual void Operation() override { cout Operation(); AddedBehavior(); }private: // logic. void AddedBehavior() { cout <<"ConcreteDecorator::AddedBehavior(... 阅读全文
摘要:
class A{public: // Interface. void foo() { cout foo(); m_b->bar(); m_c->baz(); }};int main(int argc, char *argv[]){ Facade f(new A, new B, new C); f.qux(); // TODO: Release memory. return 0;} 阅读全文