SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWTThreadEscrowImp< Redeemable > Class Template Reference

Multithread-safe implementation of RWTEscrowImp. More...

#include <rw/thread/RWTThreadEscrowImp.h>

Inheritance diagram for RWTThreadEscrowImp< Redeemable >:
RWTEscrowImp< Redeemable > RWEscrowImpBase RWBodyBase RWTCountingBody< RWMutexLock > RWTMonitor< RWMutexLock >

Public Types

typedef Redeemable RedeemableType
 
- Public Types inherited from RWTEscrowImp< Redeemable >
typedef Redeemable RedeemableType
 
typedef RWTFunctor< void(RWTEscrowHandle< Redeemable >)> RWTIOUResultCallback
 

Public Member Functions

virtual ~RWTThreadEscrowImp ()
 
- Public Member Functions inherited from RWTEscrowImp< Redeemable >
virtual ~RWTEscrowImp (void)
 
void abort (void)
 
bool aborted (void) const
 
void addCallback (const RWTIOUResultCallback &iouResultCallback)
 
void close (const Redeemable &value)
 
bool closeable (void) const
 
bool closed (void) const
 
bool inError (void) const
 
RWTEscrowHandle< Redeemable > newInstance (void) const
 
const Redeemable & redeem (void) const
 
bool redeemable (void) const
 
bool redeemed (void) const
 
void removeCallback (const RWTIOUResultCallback &iouResultCallback)
 
void setException (const RWTHRxmsg &xmsg)
 

Static Public Member Functions

static RWTEscrowHandle< Redeemable > make ()
 
static RWTEscrowHandle< Redeemable > make (const Redeemable &immediateValue)
 

Protected Member Functions

 RWTThreadEscrowImp ()
 
- Protected Member Functions inherited from RWTEscrowImp< Redeemable >
 RWTEscrowImp (void)
 
- Protected Member Functions inherited from RWEscrowImpBase
 RWEscrowImpBase (void)
 
virtual ~RWEscrowImpBase (void)
 
- Protected Member Functions inherited from RWBodyBase
 RWBodyBase (const RWBodyBase &second)
 
 RWBodyBase (RWStaticCtor)
 
 RWBodyBase (void)
 
virtual ~RWBodyBase (void)
 
RWBodyBaseoperator= (const RWBodyBase &second)
 
- Protected Member Functions inherited from RWTCountingBody< RWMutexLock >
 RWTCountingBody (const RWTCountingBody< RWMutexLock > &second)
 
 RWTCountingBody (RWStaticCtor)
 
 RWTCountingBody (unsigned initCount=0)
 
RWTCountingBody< RWMutexLock > & operator= (const RWTCountingBody< RWMutexLock > &second)
 
 ~RWTCountingBody (void)
 
unsigned addReference (void)
 
unsigned references (void) const
 
unsigned removeReference (void)
 
- Protected Member Functions inherited from RWTMonitor< RWMutexLock >
 RWTMonitor (const RWTMonitor< RWMutexLock > &second)
 
 RWTMonitor (RWStaticCtor)
 
 RWTMonitor (void)
 
 ~RWTMonitor (void)
 
void acquire (void)
 
bool isAcquired (void) const
 
RWTMonitor< RWMutexLock > & monitor (void) const
 
RWMutexLockmutex (void)
 
RWTMonitor< RWMutexLock > & operator= (const RWTMonitor< RWMutexLock > &)
 
void release (void)
 
bool tryAcquire (void)
 

Private Member Functions

 RWTThreadEscrowImp (const RWTThreadEscrowImp &second)
 
RWTThreadEscrowImpoperator= (const RWTThreadEscrowImp &second)
 

Additional Inherited Members

- Protected Types inherited from RWTCountingBody< RWMutexLock >
typedef RWTLockGuard< RWTMonitor< RWMutexLock > > LockGuard
 
typedef RWTTryLockGuard< RWTMonitor< RWMutexLock > > TryLockGuard
 
typedef RWTUnlockGuard< RWTMonitor< RWMutexLock > > UnlockGuard
 
- Protected Types inherited from RWTMonitor< RWMutexLock >
typedef RWTLockGuard< RWTMonitor< RWMutexLock > > LockGuard
 
typedef RWTTryLockGuard< RWTMonitor< RWMutexLock > > TryLockGuard
 
typedef RWTUnlockGuard< RWTMonitor< RWMutexLock > > UnlockGuard
 

Detailed Description

template<class Redeemable>
class RWTThreadEscrowImp< Redeemable >

This is a concrete implementation of the RWTEscrowImp class. It is multithread-safe and uses condition variables to communicate between threads.

This class should not be used directly. It is intended to be used through the RWTIOUResult and RWTIOUEscrow interfaces. However, you may wish to use the static make() functions provided by this class to construct an escrow instance.

Example
#include <rw/thread/RWTThreadEscrowImp.h>
#include <rw/itc/RWTIOUEscrow.h>
#include <rw/itc/RWTIOUResult.h>
// Create a new RWTThreadEscrowImp<int> impl.,
// and use it to initialize RWTIOUResult<int>.
// Make an RWTIOUEscrow<int> handle that points
// to same RWTThreadEscrowImp<int> as intRes.
RWTIOUEscrow<int> intEsc = intRes;
// Create a new RWTThreadEscrowImp<RWCString>, and
// use it to initialize an RWTIOUEscrow<RWCString>
// Just for the sake of demonstration, make an
// RWTIOUResult<RWCString> that points to same
// RWTThreadEscrowImp<RWCString> as strEsc.
RWTIOUResult<RWCString> strRes = strEsc;
A writable IOU handle.
Definition RWTIOUEscrow.h:119
A readable IOU handle.
Definition RWTIOUResult.h:122
static RWTEscrowHandle< Redeemable > make()
See also
RWTIOUResult, RWTIOUEscrow, RWTEscrowImp

Member Typedef Documentation

◆ RedeemableType

template<class Redeemable >
typedef Redeemable RWTThreadEscrowImp< Redeemable >::RedeemableType

Public typedef.

Constructor & Destructor Documentation

◆ ~RWTThreadEscrowImp()

template<class Redeemable >
virtual RWTThreadEscrowImp< Redeemable >::~RWTThreadEscrowImp ( )
virtual

Virtual destructor.

◆ RWTThreadEscrowImp() [1/2]

template<class Redeemable >
RWTThreadEscrowImp< Redeemable >::RWTThreadEscrowImp ( )
protected

The constructor for this class is protected. You must use the static make() members to create instances.

◆ RWTThreadEscrowImp() [2/2]

template<class Redeemable >
RWTThreadEscrowImp< Redeemable >::RWTThreadEscrowImp ( const RWTThreadEscrowImp< Redeemable > & second)
private

Copy construction prohibited.

Member Function Documentation

◆ make() [1/2]

template<class Redeemable >
static RWTEscrowHandle< Redeemable > RWTThreadEscrowImp< Redeemable >::make ( )
static

Creates a new RWTThreadEscrowImp. Returns an RWTEscrowHandle handle that can be used to create an RWTIOUResult or RWTIOUEscrow handle to the newly-created escrow implementation.

◆ make() [2/2]

template<class Redeemable >
static RWTEscrowHandle< Redeemable > RWTThreadEscrowImp< Redeemable >::make ( const Redeemable & immediateValue)
static

Creates an RWTThreadEscrowImp and assigns it to an RWTEscrowHandle. The escrow is closed immediately with immediateValue. The returned RWTEscrowHandle can be used to initialize an RWTIOUEscrow or RWTIOUResult. Once the escrow is created it is immediately redeemable.

◆ operator=()

template<class Redeemable >
RWTThreadEscrowImp & RWTThreadEscrowImp< Redeemable >::operator= ( const RWTThreadEscrowImp< Redeemable > & second)
private

Assignment prohibited.

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