Listing 6
std::vector<std::string> get_titles(const std::string & author) { std::vector<std::string> retval; if (author == "Koenig") { retval.push_back("Accelerated C++"); retval.push_back("C Traps and Pitfalls"); retval.push_back("Ruminations on C++"); } else if (author == "Alexandrescu") { retval.push_back("Modern C++ Design"); } else if (author == "Jagger") { retval.push_back("Microsoft Visual C# .NET Step by Step"); } return retval; } std::string get_website() { return "www.bugbrowser.com"; } int main() { HANDLE os_handle = create_named_pipe("\\\\.\\pipe\\p1"); // Create a transport buffer using OS handle marshal::handle_buffer_t transport(os_handle); // Create an encoder (using a buffer) marshal::raw_iostream encoder(transport); // Create configured proxy object proxy_t<marshal::callee, marshal::raw_iostream> proxy; // Bind the proxy object to specific encoding stream(s) proxy.bind(encoder); // Ready to use the proxy, wait for incoming calls, // dispatch calls until link is closed while (proxy.dispatch_call()) {} return EXIT_SUCCESS; }