SourcePro® API Reference Guide

Product Documentation:
   SourcePro
Documentation Home
Classes | Typedefs

Module Description

The Smart Pointer package includes a generic singleton template class, a simple pointer wrapper, and two varieties of thread-safe reference-counted pointers. The Smart Pointer package also provides the Threads Module with the base classes for handle-body implementation.

See the Threads Module User's Guide for complete information on how to use the Smart Pointer package.

Classes

class  RWAtomicCounter
 Maintains a reference count safely in a multithreaded environment. More...
 
class  RWBodyBase
 Base class for body classes. More...
 
class  RWHandleBase
 Base class for all handle classes. Increments a reference count for each class instance that is bound to an instance of the RWBodyBase class. More...
 
class  RWTCountedPointer< Body >
 A smart pointer handle to a reference-counting body. More...
 
class  RWTCounter< Mutex >
 Deprecated. Maintains a reference count. More...
 
class  RWTCountingBody< Mutex >
 Base class for classes that must maintain a reference count. More...
 
class  RWTCountingPointer< Body, Counter >
 Defines a reference-counted pointer that provides reference counting semantics for types that do not directly support reference counting. More...
 
class  RWTOnlyPointer< Body >
 Simplifies the use of pointers that refer to objects on the heap, automatically destroying the object when the pointer object is itself destroyed. More...
 
class  RWTPointer< Body >
 Base class for smart-pointer classes. More...
 
class  RWTSingleton< T >
 Ensures that a class has only one instance and provides a global point of access to it. More...
 

Typedefs

typedef RWTCounter< RWMutexLockRWSafeCounter
 
typedef RWTCounter< RWNullMutexLockRWUnsafeCounter
 

Typedef Documentation

Deprecated:
As of SourcePro 11.1, use RWAtomicCounter instead.
Header File
1 #include <rw/pointer/RWSafeCounter.h>

The typedef RWSafeCounter implements the multithread-safe reference counter, which can be used as the Counter template parameter for RWTCountingPointer.

Example
1 RWTCountingPointer<int, RWSafeCounter> pointer = new int(10);
See also
RWTCounter, RWUnsafeCounter, RWTCountingPointer
Deprecated:
As of SourcePro 11.1, use RWAtomicCounter.
Header File
1 #include <rw/pointer/RWUnsafeCounter.h>

A typedef that implements an unsafe counter that can be used for greater efficiency in reference counting in situations where multithread safety is not required. This typedef can be used as the Counter template parameter for RWTCountingPointer.

Example
1 RWTCountingPointer<int, RWUnsafeCounter> pointer = new int(10);
See also
RWTCounter, RWSafeCounter, RWTCountingPointer

Copyright © 2021 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.