#include <ace/Future.h>
template<class T> class ACE_Future {
public:
ACE_Future (void);
ACE_Future (const ACE_Future<T> &r);
ACE_Future (const T &r);
~ACE_Future (void);
void operator = (const ACE_Future<T> &r);
int cancel (const T &r);
int cancel (void);
int operator == (const ACE_Future<T> &r) const;
int operator != (const ACE_Future<T> &r) const;
int set (const T &r);
int get (T &value, ACE_Time_Value *tv = 0);
operator T ();
int ready (void);
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE;
private:
void *operator new (size_t nbytes);
void operator delete (void *);
void operator &();
typedef ACE_Future_Rep<T> FUTURE_REP;
FUTURE_REP *future_rep_;
};
ACE_Future (void);
ACE_Future (const ACE_Future<T> &r);
this
and r
to the same
ACE_Future_Rep
. An ACE_Future_Rep
is created if necessary.
ACE_Future (const T &r);
ACE_Future
to point to the
result r
immediately.
~ACE_Future (void);
void operator = (const ACE_Future<T> &r);
this
and r
to the same
ACE_Future_Rep
. An ACE_Future_Rep
is created if necessary.
int cancel (const T &r);
ACE_Future
and assign the value r
. It is used if a
client does not want to wait for T
to be produced.
int cancel (void);
ACE_Future
. Put the future into its initial
state. Returns 0 on succes and -1 on failure. It is now possible
to reuse the ACE_FutureT
. But remember, the ACE_FutureT
is now bound to a new ACE_Future_RepT
.
int operator == (const ACE_Future<T> &r) const;
T
objects
point to the same ACE_Future_RepT
object. Attention: It also
returns 1 if both objects have just been instantiated and not
used yet.
int operator != (const ACE_Future<T> &r) const;
int set (const T &r);
int get (T &value, ACE_Time_Value *tv = 0);
tv
time to get the value
.
operator T ();
get
method should be
used instead since it separates the error value from the result,
and also permits timeouts.
int ready (void);
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE;
Andres.Kruse@cern.ch
, Douglas C. Schmidt
schmidt@cs.wustl.edu
, and Per Andersson
Per.Andersson@hfera.ericsson.se
.