Flylib.com

Books Software

 
 
 

The C In-Depth Series


The C++ In-Depth Series

Bjarne Stroustrup, Editor

"I have made this letter longer than usual, because I lack the time to make it short."

”B LAISE P ASCAL

The advent of the ISO/ANSI C++ standard marked the beginning of a new era for C++ programmers. The standard offers many new facilities and opportunities, but how can a real-world programmer find the time to discover the key nuggets of wisdom within this mass of information? The C++ In-Depth Series minimizes learning time and confusion by giving programmers concise , focused guides to specific topics.

Each book in this series presents a single topic, at a technical level appropriate to that topic. The Series' practical approach is designed to lift professionals to their next level of programming skills. Written by experts in the field, these short, in-depth monographs can be read and referenced without the distraction of unrelated material. The books are cross-referenced within the Series, and also reference The C++ Programming Language by Bjarne Stroustrup.

As you develop your skills in C++, it becomes increasingly important to separate essential information from hype and glitz, and to find the in-depth content you need in order to grow. The C++ In-Depth Series provides the tools, concepts, techniques, and new approaches to C++ that will give you a critical edge.


Titles in the Series

Accelerated C++: Practical Programming by Example , Andrew Koenig and Barbara E. Moo

Applied C++: Practical Techniques for Building Better Software , Philip Romanik and Amy Muntz

The Boost Graph Library: User Guide and Reference Manual , Jeremy G. Siek, Lie-Quan Lee, and Andrew Lumsdaine

C++ In-Depth Box Set , Bjarne Stroustrup, Andrei Alexandrescu, Andrew Koenig, Barbara E. Moo, Stanley B. Lippman, and Herb Sutter

C++ Network Programming, Volume 1: Mastering Complexity Using ACE and Patterns , Douglas C. Schmidt and Stephen D. Huston

C++ Network Programming, Volume 2: Systematic Reuse with ACE and Frameworks , Douglas C. Schmidt and Stephen D. Huston

Essential C++ , Stanley B. Lippman

Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions , Herb Sutter

Modern C++ Design: Generic Programming and Design Patterns Applied , Andrei Alexandrescu

More Exceptional C++: 40 New Engineering Puzzles, Programming Problems, and Solutions , Herb Sutter

For more information, check out the series Web site at http://www.awprofessional.com/series/indepth/


Preface

This book is about applying C++ to solve the problems inherent in building commercial software. Those of you who have worked on engineering teams building complex software will know exactly what we mean by calling it commercial software.

Commercial software is delivered to customers (internal or external) who will rely on the interface you provide. It may be in an embedded system, or it may be a software library or application for standard platforms. No matter where it ultimately runs, the software must be released at a particular time with all of the features it needs to be successful in the market. It is software that is built by one group of engineers and potentially extended and maintained by other engineers. The engineers who take over maintaining the software may not have been part of the original team, and they might have to add features or try to fix problems while visiting customer sites.

Getting a group of engineers to build a complex piece of software and deliver it on time with full functionality is one of software engineering's biggest challenges. An even bigger challenge is building that same software in such a way that it can be handed off to others to extend and maintain. The C++ techniques and practical tips we have compiled into this book have been used repeatedly to accomplish just this. In many cases, we draw a distinction between the ideal solution and the practical one. We try to provide discussions of the trade-offs so that you can make informed decisions, and we tell you what our criteria are when selecting one method over another. We leave it to you to determine what works best in your application. Our goal is to share practical techniques that we have found made our commercial software efforts much more successful than they otherwise would have been. We hope you will find them useful.

For those of you who prefer to learn by looking at the code, you will find plenty of examples. We illustrate all of the techniques by using a concrete example that runs throughout the book. Because it was our experiences with imaging software that prompted us to write this book, our example comes from the image processing domain, but the C++ techniques are applicable to any domain.

We start with a simple, although inadequate, application that generates thumbnail images. We use this application in our prototyping phases to experiment with different C++ design and implementation techniques. The application is simple to understand and the results of applying various C++ techniques are immediately obvious, making it a nice candidate for prototyping.

This simple thumbnail image generator has many of the same inherent problems that our final image framework will have to address. The application is:

  • Memory intensive . Working with images requires efficient use of memory, because images can get quite large and unwieldy. Managing memory becomes critical to the overall performance of the application.

  • Performance intensive. While generating thumbnails is a straightforward image processing technique, others that we introduce later in the book (such as edge sharpening and noise reduction) require thoughtful designs to make them usable. It's great to have cool image functions to manipulate your digital images, but they are useless if they take a really long time to run.

Upon completion, you will have an image processing framework for manipulating your digital images and a practical toolkit of C++ utilities. The framework will provide efficient image storage and memory usage, routines for manipulating your digital images (like edge sharpening, image resizing, noise reduction, edge detection, image subtraction, and more), interfaces to third-party software, and many performance optimizations. It will be a useful piece of software that has practical design and implementation features, so that you could even use it as the basis of a commercial software product.

The complete source code for the thumbnail generator application, the prototypes , and the final image framework can be found on the included CD-ROM. Any updates to the software can be found at the web site: http://www.appliedcpp.com.