Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

RWTIOUEscrow<Redeemable>


RWTIOUEscrow RWTEscrowHandle<Redeemable>

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Data Types

Member Functions

Package

Interthread Communication

Header File

#include <rw/itc/RWTIOUEscrow.h> 

Description

An RWTIOUEscrow<Redeemable> is a writable IOU handle. An IOU, also known as a future, is a promise for a value that is forthcoming-a placeholder for that value. Usually the writer of an IOU and the reader (or readers) of an IOU are in different threads of control. In this sense IOUs are a mechanism for interthread communication.

An IOU is a write once/read many structure. It may only be written to once, but may be read any number of times.

The template parameter Redeemable is the value type of IOU result. This type must provide a public copy-constructor and must allow dynamic allocation using operator new().

The RWTIOUEscrow<Redeemable> is the handle through which a value is eventually written to an underlying escrow object. One or more readers may redeem that value once it is available by using any RWTIOUResult<Redeemable> handle that is bound to the same escrow instance.

An RWTIOUEscrow<Redeemable> is a reference counted handle to an RWTEscrowImp<Redeemable>. It can be copied and passed by value. When the last handle to a given RWTEscrowImp<Redeemable> is destroyed, then the internal RWTEscrowImp<Redeemable> is destroyed.

An RWTIOUEscrow<Redeemable> can be initialized by or assigned to an RWTIOUResult<Redeemable>, and visa versa. Both are interfaces to the same underlying RWTIOUEscrowImp<Redeemable>. RWTIOUEscrow<Redeemable> is a write interface, and RWTIOUResult<Redeemable> is a read interface.

An exception may be set on an IOU by the holder of an RWTIOUEscrow<Redeemable>. This will cause the exception to be thrown when an attempt is made to redeem it.

Similarly, an IOU may be aborted by the holder of an RWTIOUResult<Redeemable>. This will cause an exception to be thrown if an attempt is made to redeem the IOU or to set its value.

An RWTIOUEscrow<Redeemable> is closable if a value has not been set, if it has not been aborted, and if an exception has not been set.

Example

Public Typedef

typedef Redeemable RedeemableType;

Public Constructors

RWTIOUEscrow(void);
RWTIOUEscrow(const RWTEscrowHandle<Redeemable>& escrowHandle);
RWTIOUEscrow(const RWTIOUEscrow<Redeemable>& second);

Public Destructor

~RWTIOUEscrow(void);

Public Member Operators

RWTIOUEscrow<Redeemable>&
operator=(const RWTIOUEscrow<Redeemable>& second);
void
operator=(Redeemable value)
void
operator()(Redeemable value)

Public Member Functions

RWBoolean
aborted(void) const;
void
close(RedeemableValue)
RWBoolean
closeable(void) const;
RWBoolean
closed(void);
inError(void);
RWTIOUEscrow<Redeemable>
newInstance(void) const;
RWBoolean
redeemed(void) const;
void
setException(const RWCString& msg);
void
setException(const RWTHRxmsg& xmsg);

See Also

RWTIOUResult<Redeemable>, RWTEscrowHandle<Redeemable>, RWTEscrowImp<Redeemable>, RWTThreadEscrowImp<Redeemable>, rwtMakeThreadIOU



Previous fileTop of DocumentContentsIndexNext file

©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.