This paper presents a simple, general, and efficient solution to the old problem of ‘‘wrapping’’ calls to an object in pairs of prefix and suffix code. The solution is also non-intrusive, applies to existing classes, allows the use of several prefix/suffix pairs, and can be implemented in 15 simple lines of Standard C++. A robust version of the wrapper is also presented. The claim of efficiency is backed by measurement. The paper is organized around a series of examples evolving the basic idea into a final robust template class.
Related white papers
Designing Flexible Applications Using the Provider Model in ASP.NET 2.0-Level 400
This session is based on the Beta 1 version of ASP.NET 2.0. More and more times one needs a well-defined API, but the flexibility of switching between implementations. A perfect...
Creating Your First Windows Service Using .NET – Level 200
It was difficult, if not impossible, to create a Windows Service using Visual Basic 6.0. Using the .NET Framework, however, it is easy to create an application that runs outside...
Building Queries Visually
Oracle SQL Developer provides the SQL worksheet, a code-editor window where one can enter and run statements that include SQL*Plus commands, SQL, and PL/SQL code - either single statements or...
MSDN Webcast: Building WPF Applications in Visual Studio 2008 and Expression Blend (Level 100)
The attendee of this webcast will learn how to build Windows Presentation Foundation (WPF) applications with the help of the new WPF designer in Microsoft Visual Studio 2008. The focus...
MSDN Webcast: Overview of New Tools in Visual Studio 2008 (Level 200)
The presenter of this webcast takes a look at the new tools that come with the Microsoft Visual Studio 2008 development system and explains how they can impact developers' world....
MSDN Webcast: Overview of New Designers in Visual Studio 2008 (Level 200)
The presenter of this webcast takes a deeper look at some of the key new features in the Microsoft Visual Studio 2008 development system. The presenter looks at the many...
MSDN Webcast: Using LINQ With Relational Data (Level 100)
One of the most common forms of data used in applications today continues to be relational data that is stored in various database systems such as Microsoft SQL Server. The...

