/** * testdecorator.cpp */ #include "decorator.h" void main() { /** * Create the objects. */ Decorator* decorator = new ConcreteDecoratorB(); Component* component = new ConcreteComponent(); /** * Configure the decorator. */ decorator -> setComponent( component ); decorator -> operation(); /** * Clean-up. */ delete component; delete decorator; }