rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWTThreadEscrowImp< Redeemable > Class Template Reference
[Threading]

Multithread-safe implementation of RWTEscrowImp<Redeemable>. More...

#include <rw/thread/RWTThreadEscrowImp.h>

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

List of all members.

Public Types

typedef Redeemable RedeemableType

Public Member Functions

virtual ~RWTThreadEscrowImp ()

Static Public Member Functions

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

Protected Member Functions

 RWTThreadEscrowImp ()

Private Member Functions

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

Detailed Description

template<class Redeemable>
class RWTThreadEscrowImp< Redeemable >

This is a concrete implementation of the RWTEscrowImp<Redeemable> 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<Redeemable> and RWTIOUEscrow<Redeemable> interfaces. However, you may wish to use the static make() functions provided by this class, instead of the global rwtMakeThreadIOU() helper functions, to construct an escrow instance.

Examples

 #include <rw/thread/RWTThreadEscrowImp.h> // for
                                           // RWTThreadEscrowImp
 #include <rw/itc/RWTIOUResult.h>      // for RWTIOUResult
 #include <rw/itc/RWTIOUEscrow.h>      // for RWTIOUEscrow
 
 // Create a new RWTThreadEscrowImp<int> impl.,
 // and use it to initialize RWTIOUResult<int>.
 RWTIOUResult<int> intRes = RWTThreadEscrowImp<int>::make();
 
 // 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>
 RWTIOUEscrow<RWCString> strEsc =
   RWTThreadEscrowImp<RWCString>::make();
 
 // Just for the sake of demonstration, make an
 // RWTIOUResult<RWCString> that points to same
 // RWTThreadEscrowImp<RWCString> as strEsc.
 RWTIOUResult<int> strRes = strEsc;
See also:
RWTIOUResult<Redeemable>, RWTIOUEscrow<Redeemable>, RWTEscrowImp<Redeemable>

Member Typedef Documentation

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

Public typedef.

Reimplemented from RWTEscrowImp< Redeemable >.


Constructor & Destructor Documentation

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

Virtual destructor.

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

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

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

Copy construction prohibited.


Member Function Documentation

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

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

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

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

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

Assignment prohibited.

 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.