Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Threads Module User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

7.6 Smart Pointer Class Architecture

The Smart Pointer package includes handle-body, singleton, smart pointer, and helper classes.

In the smart pointer category are the generic template classes for pointer-like object creation. Using these classes, you can create objects that act like pointers but provide some special behavior, such as reference-counting.

All classes in the smart pointer category derive from the abstract template class RWTPointer, as shown in Figure 43. RWTPointer is an opaque pointer, a pointer wrapper without dereferencing operations. Dereferencing operations are implemented in the derived concrete types, so they can have specialized behavior. RWTPointer provides a minimal common set of operations, such as the isValid() function.

Figure 43: Smart pointer classes

Handle-body implementations built with the Smart Pointer package are based on the RWHandleBase and RWBodyBase classes (see Figure 44). These classes implement the basic functionality required for reference-counting. RWHandleBase provides constructors, destructor, assignment operator, equality and inequality operators, and the isValid() member, while RWBodyBase maintains the multithread-safe reference count.

Figure 44: Handle-body and singleton classes

The helper category contains accessory classes used by the smart pointer and handle-body classes (shown in Figure 45). For example, the implementation of reference counting falls in this category.

Figure 45: Helper classes



Previous fileTop of DocumentContentsIndex pageNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.