NAME

ACE_Future_Rep - ACE_Future_RepT

SYNOPSIS

#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); };

DESCRIPTION

An ACE_Future_RepT 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.

Encapsulate reference count and object lifetime of instances.

These methods must go after the others to work around a bug with Borland's C++ Builder...
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_;

= Condition variable and mutex that protect the value_.

ACE_Condition_Thread_Mutex value_ready_;

ACE_Thread_Mutex value_ready_mutex_;

Constructor and destructor private.

ACE_Future_Rep (void);

~ACE_Future_Rep (void);

AUTHOR (S)

Andres Kruse Andres.Kruse@cern.ch, Douglas C. Schmidt schmidt@cs.wustl.edu, Per Andersson Per.Andersson@hfera.ericsson.se, and John Tucker jtucker@infoglide.com

LIBRARY

ace