T
#include <ace/Future.h>
template<class T> class ACE_Future_Rep {
private:
friend class ACE_Future<T>;
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 set (const T &r);
int get (T &value, ACE_Time_Value *tv);
operator T ();
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE;
ACE_Future_Rep (void);
~ACE_Future_Rep (void);
int ready (void);
T *value_;
int ref_count_;
ACE_Condition_Thread_Mutex value_ready_;
ACE_Thread_Mutex value_ready_mutex_;
};
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.
ACE_Future_Rep (void);
~ACE_Future_Rep (void);
int ready (void);
T *value_;
int ref_count_;
= Condition variable and mutex that protect the value_
.
ACE_Condition_Thread_Mutex value_ready_;
ACE_Thread_Mutex value_ready_mutex_;
Andres.Kruse@cern.ch
, Douglas C. Schmidt
schmidt@cs.wustl.edu
, and Per Andersson
Per.Andersson@hfera.ericsson.se
.