9#include "helpers/formatstring.h"
37 std::cout << std::endl;
38 std::cout <<
"Proxy Exercise" << std::endl;
40 std::cout <<
" Getting proxy object..." << std::endl;
43 std::cout <<
" Calling Dowork() on proxy..." << std::endl;
44 std::string output = proxyObject->DoWork(
"Initial call");
47 std::cout <<
" Calling Dowork() on proxy..." << std::endl;
48 output = proxyObject->DoWork(
"Second call");
51 std::cout <<
" Calling Dowork() on proxy..." << std::endl;
52 output = proxyObject->DoWork(
"Third call");
55 std::cout <<
" Done." << std::endl;
Declaration of the IWorkByProxy interface and the Proxy_Classes_Container class used in the Proxy Pat...
static std::unique_ptr< IWorkByProxy > CreateProxy()
Retrieve a new instance of the proxy class.
Declaration of the Proxy_Exercise() function as used in the Proxy Pattern.
The namespace containing all Design Pattern Examples implemented in C++.
void Proxy_Exercise()
Example of using the Proxy design pattern.
std::string formatstring(const char *fmt,...)
Use the given string and arguments to return a buffer containing the formatted string....