/** * testproxy.cpp */ #include "proxy.h" void main() { /** * Create the objects. */ RealSubject* subject = new RealSubject(); Proxy* proxy = new Proxy(); /** * Configure the proxy. In reality, proxy may get * its subject from the system server or other * mechanism not visible to this process. */ proxy -> setSubject( subject ); /** * Use the proxy to access the subject. */ proxy -> request(); /** * Clean-up. */ delete proxy; delete subject; }