T
#include <ace/Future.h>
template<class T> class ACE_Future_Rep {
private:friend class ACE_Future<T>;int set (const T &r, ACE_Future<T> &caller);int get (T &value, ACE_Time_Value *tv);int attach ( ACE_Future_Observer<T> *observer, ACE_Future<T> &caller );int detach (ACE_Future_Observer<T> *observer);operator T ();void dump (void) const;ACE_ALLOC_HOOK_DECLARE;static ACE_Future_Rep<T> *create (void);static ACE_Future_Rep<T> *attach (ACE_Future_Rep<T> *&rep);static void detach (ACE_Future_Rep<T> *&rep);static void assign ( ACE_Future_Rep<T> *&rep, ACE_Future_Rep<T> *new_rep );int ready (void);T *value_;int ref_count_;typedef ACE_Future_Observer<T> OBSERVER;typedef ACE_Unbounded_Set<OBSERVER *> OBSERVER_COLLECTION;OBSERVER_COLLECTION observer_collection_;ACE_Condition_Thread_Mutex value_ready_;ACE_Thread_Mutex value_ready_mutex_;ACE_Future_Rep (void);~ACE_Future_Rep (void);};
T object encapsules a pointer to an object
of class T which is the result of an asynchronous method
invocation. It is pointed to by ACE_FutureT object[s] and
only accessible through them.
static ACE_Future_Rep<T> *create (void);
T and initialize the reference count.
static ACE_Future_Rep<T> *attach (ACE_Future_Rep<T> *&rep);
Precondition (rep != 0).
static void detach (ACE_Future_Rep<T> *&rep);
Precondition (rep != 0)
static void assign (
ACE_Future_Rep<T> *&rep,
ACE_Future_Rep<T> *new_rep
);
Precondition (rep != 0 && new_rep != 0)
int ready (void);
T *value_;
int ref_count_;
typedef ACE_Future_Observer<T> OBSERVER;
typedef ACE_Unbounded_Set<OBSERVER *> OBSERVER_COLLECTION;
OBSERVER_COLLECTION observer_collection_;
= Condition variable and mutex that protect the value_.
ACE_Condition_Thread_Mutex value_ready_;
ACE_Thread_Mutex value_ready_mutex_;
ACE_Future_Rep (void);
~ACE_Future_Rep (void);
Andres.Kruse@cern.ch,
Douglas C. Schmidt schmidt@cs.wustl.edu,
Per Andersson Per.Andersson@hfera.ericsson.se, and
John Tucker jtucker@infoglide.com