Module: Threads Package: Smart Pointer
Does not inherit
#include <rw/pointer/RWTCounter.h>
A class for maintaining a reference count. Uses the template type as a lock for atomicity.
Generally, you will use one of two typedefs provided by the Smart Pointer package. RWSafeCounter is a typedef for RWTCounter<RWMutexLock> and provides thread-safe reference counting. RWUnsafeCounter is a typedef for RWTCounter<RWNullMutexLock> and can be used for greater efficiency when thread-safety is not required.
RWTCounter(RWStaticCtor);
Constructs a static instance (does not initialize the reference count). Throws no exceptions.
RWTCounter(unsigned initCount = 0);
Constructs a default instance (initializes the reference count). Throws no exceptions.
RWTCounter(const RWTCounter<Mutex>& second);
Does not copy the internal count. This method is provided as a convenience to derived classes.
RWTCounter<Mutex>& operator=(const RWTCounter<Mutex>& second);
Does not assign the internal count. This method is provided as a convenience to derived classes.
RWSafeCounter, RWUnsafeCounter, RWTCountingPointer
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.