Publications

Templates & Marshaling C++ Function Calls
July 2004 C/C++ Users Journal
There are a myriad of ways to connect C++ code over process boundaries, but typically they are not truely native to C++, and most require an intermediate language. If however, you are in control of all the server and all the client code, and it is all written in C++ (regardless of platform) then marshal:: may be a better solution as it provides efficient and natural C++ mechansims. This article describes some of the issues with writing marshal:: and briefly how to use the library.
Download source code.

Encapsulating the Observer Pattern
October 1998 C/C++ Users Journal (now on Dr. Dobbs.com)
Event processing is a seemingly simple operation with a surprising number of perils. Hiding the details in a well-designed class or two can save the day. This code was written for Microsoft Visual C++ 5.0, and thus makes the best use of templates that it can but without exploding the compiler. It was probably the first published implementation that was type safe and did not require compiler extensions or macros.
Download source code.

Other implementations include:

libsigc++ (2000) typesafe callbacks LGPL
Andrei Alexandrescu (2001) has a superior policy based implementation (read Modern C++ Design).
Herb Sutter Generalizing Observer (2003) in C/C++ Users Journal Sept 2003 experts forum
Tutu at CodeProject (2004) – An easy to use Observer Implementation (no inheritance required)

Comments are closed.