SourcePro® 2023.1 |
SourcePro® API Reference Guide |
A guard class that acquires write access to its resource upon creation and releases it upon destruction. More...
#include <rw/sync/RWTWriteLockGuard.h>
Public Member Functions | |
RWTWriteLockGuard (Resource &resource) | |
~RWTWriteLockGuard () | |
Public Member Functions inherited from RWTWriteLockGuardBase< Resource > | |
~RWTWriteLockGuardBase () | |
Public Member Functions inherited from RWTWriteGuardBase< Resource > | |
~RWTWriteGuardBase () | |
void | acquire () |
bool | isAcquired () const |
void | release () |
Private Member Functions | |
RWTWriteLockGuard (const RWTWriteLockGuard< Resource > &second) | |
RWTWriteLockGuard< Resource > & | operator= (const RWTWriteLockGuard< Resource > &second) |
Additional Inherited Members | |
Protected Member Functions inherited from RWTWriteLockGuardBase< Resource > | |
RWTWriteLockGuardBase (Resource &resource) | |
RWTWriteLockGuardBase (Resource &resource, bool acquired) | |
Protected Member Functions inherited from RWTWriteGuardBase< Resource > | |
RWTWriteGuardBase (Resource &resource) | |
RWTWriteGuardBase (Resource &resource, bool acquired) | |
Resource & | resource () const |
RWTWriteLockGuard is a guard class that acquires write access on its resource upon creation and releases it upon destruction. Guard objects work in conjunction with block statements to establish an appropriate state upon creation, maintain that state for the duration of the block, and restore the original state upon destruction. For example, a guard may acquire write access on a mutex when created and release it when destructed.
The class used as the actual template parameter for Resource
must provide acquireWrite
() and release
() methods, such as the synchronization classes in this module.
|
inline |
Destructor.
|
inline |
Constructs an instance with the given resource and acquires write access on that resource. The resource is released in the destructor of the base class.
|
private |
Copy constructor prohibited.
|
private |
Assignment prohibited.
Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |