SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWTCounter< Mutex > Class Template Reference

Deprecated. Maintains a reference count. More...

#include <rw/pointer/RWTCounter.h>

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

Public Member Functions

 RWTCounter (const RWTCounter< Mutex > &second)
 
 RWTCounter (RWStaticCtor)
 
 RWTCounter (unsigned initCount=0)
 
RWTCounter< Mutex > & operator= (const RWTCounter< Mutex > &second)
 
- Public Member Functions inherited from RWTCountingBody< Mutex >
 ~RWTCountingBody (void)
 
unsigned addReference (void)
 
unsigned references (void) const
 
unsigned removeReference (void)
 

Additional Inherited Members

- Protected Types inherited from RWTCountingBody< Mutex >
typedef RWTLockGuard< RWTMonitor< Mutex > > LockGuard
 
typedef RWTTryLockGuard< RWTMonitor< Mutex > > TryLockGuard
 
typedef RWTUnlockGuard< RWTMonitor< Mutex > > UnlockGuard
 
- Protected Types inherited from RWTMonitor< Mutex >
typedef RWTLockGuard< RWTMonitor< Mutex > > LockGuard
 
typedef RWTTryLockGuard< RWTMonitor< Mutex > > TryLockGuard
 
typedef RWTUnlockGuard< RWTMonitor< Mutex > > UnlockGuard
 
- Protected Member Functions inherited from RWTCountingBody< Mutex >
 RWTCountingBody (const RWTCountingBody< Mutex > &second)
 
 RWTCountingBody (RWStaticCtor)
 
 RWTCountingBody (unsigned initCount=0)
 
RWTCountingBody< Mutex > & operator= (const RWTCountingBody< Mutex > &second)
 
- Protected Member Functions inherited from RWTMonitor< Mutex >
 RWTMonitor (const RWTMonitor< Mutex > &second)
 
 RWTMonitor (RWStaticCtor)
 
 RWTMonitor (void)
 
 ~RWTMonitor (void)
 
void acquire (void)
 
bool isAcquired (void) const
 
RWTMonitor< Mutex > & monitor (void) const
 
Mutex & mutex (void)
 
RWTMonitor< Mutex > & operator= (const RWTMonitor< Mutex > &)
 
void release (void)
 
bool tryAcquire (void)
 

Detailed Description

template<class Mutex>
class RWTCounter< Mutex >
Deprecated
As of SourcePro 11.1, 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 and provides thread-safe reference counting. RWUnsafeCounter is a typedef for RWTCounter and can be used for greater efficiency when thread safety is not required.

See also
RWSafeCounter, RWUnsafeCounter, RWTCountingPointer

Constructor & Destructor Documentation

◆ RWTCounter() [1/3]

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

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

◆ RWTCounter() [2/3]

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

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

◆ RWTCounter() [3/3]

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

◆ operator=()

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.

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