rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWTCounter< Mutex > Class Template Reference
[Smart Pointers]

Maintains a reference count. More...

#include <rw/pointer/RWTCounter.h>

Inheritance diagram for RWTCounter< Mutex >:
RWTCountingBody< Mutex > RWTMonitor< Mutex >

List of all members.

Public Member Functions

 RWTCounter (unsigned initCount=0)
 RWTCounter (RWStaticCtor)
 RWTCounter (const RWTCounter< Mutex > &second)
RWTCounter< Mutex > & operator= (const RWTCounter< Mutex > &second)

Detailed Description

template<class Mutex>
class RWTCounter< Mutex >

Deprecated:
RWTCounter is deprecated and is no longer supported. It may be removed from future releases. Please use RWAtomicCounter.

A class for maintaining a reference count that uses the template type as a lock for atomicity.

Generally, applications 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.

See also:
RWSafeCounter, RWUnsafeCounter, RWTCountingPointer

Constructor & Destructor Documentation

template<class Mutex >
RWTCounter< Mutex >::RWTCounter ( unsigned  initCount = 0  )  [inline]

Constructs a default instance (initializes the reference count). Throws no exceptions.

template<class Mutex >
RWTCounter< Mutex >::RWTCounter ( RWStaticCtor   )  [inline]

Constructs a static instance (does not initialize the reference count). Throws no exceptions.

template<class Mutex >
RWTCounter< Mutex >::RWTCounter ( const RWTCounter< Mutex > &  second  )  [inline]

Does not copy the internal count. This method is provided as a convenience to derived classes.


Member Function Documentation

template<class Mutex >
RWTCounter< Mutex > & RWTCounter< Mutex >::operator= ( const RWTCounter< Mutex > &  second  )  [inline]

Does not assign the internal count. This method is provided as a convenience to derived classes.

 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

© 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.