ACE_Future
objects to be accessed by
reader threads as they become available.
#include <ace/Future_Set.h>
template<class T> class ACE_Future_Set : public ACE_Future_Observer<T> {
public:
ACE_Future_Set ( ACE_Message_Queue<ACE_SYNCH> *future_notification_queue_ = 0 );
~ACE_Future_Set (void);
int is_empty (void) const;
int insert (ACE_Future<T> &future);
int next_readable (ACE_Future<T> &result, ACE_Time_Value *tv = 0);
virtual void update (const ACE_Future<T> &future);
ACE_ALLOC_HOOK_DECLARE;
private:
inline ACE_UNIMPLEMENTED_FUNC ( void operator= (const ACE_Future_Set<T> &) );
typedef ACE_Future<T> FUTURE;
typedef ACE_Future_Rep<T> FUTURE_REP;
typedef ACE_Future_Holder<T> FUTURE_HOLDER;
typedef ACE_Pointer_Hash<FUTURE_REP *> FUTURE_REP_HASH;
typedef ACE_Equal_To<FUTURE_REP *> FUTURE_REP_COMPARE;
typedef ACE_Hash_Map_Manager_Ex<FUTURE_REP *, FUTURE_HOLDER *, FUTURE_REP_HASH, FUTURE_REP_COMPARE, ACE_Null_Mutex> FUTURE_HASH_MAP;FUTURE_HASH_MAP future_map_;
ACE_Message_Queue<ACE_SYNCH> *future_notification_queue_;
int delete_queue_;
};
ACE_Future_Set (
ACE_Message_Queue<ACE_SYNCH> *future_notification_queue_ = 0
);
~ACE_Future_Set (void);
int is_empty (void) const;
ACE_Future
objects left on its queue and
0 otherwise
int insert (ACE_Future<T> &future);
ACE_Future
into this objects queue when it is
readable.
Returns 0 if the future is successfully inserted, 1 if the future is already inserted, and -1 if failures occur.
int next_readable (ACE_Future<T> &result, ACE_Time_Value *tv = 0);
tv
time to get the value
. Note that tv
must be
specified in absolute time rather than relative time.); get the
next ACE_Future
that is readable. If tv
= 0, the will block
forever.
If a readable future becomes available, then the input result will be assigned with it and 1 will will be returned. If the set is empty, then 0 is returned.
virtual void update (const ACE_Future<T> &future);
ACE_Future
subject in which we are subscribed to
when its value is written to.
ACE_ALLOC_HOOK_DECLARE;
inline ACE_UNIMPLEMENTED_FUNC (
void operator= (const ACE_Future_Set<T> &)
);
typedef ACE_Future<T> FUTURE;
typedef ACE_Future_Rep<T> FUTURE_REP;
typedef ACE_Future_Holder<T> FUTURE_HOLDER;
typedef ACE_Pointer_Hash<FUTURE_REP *> FUTURE_REP_HASH;
typedef ACE_Equal_To<FUTURE_REP *> FUTURE_REP_COMPARE;
typedef ACE_Hash_Map_Manager_Ex<FUTURE_REP *, FUTURE_HOLDER *, FUTURE_REP_HASH, FUTURE_REP_COMPARE, ACE_Null_Mutex> FUTURE_HASH_MAP;
FUTURE_HASH_MAP future_map_;
ACE_Futures
, subjects, which have not been written to by
client's writer thread.
ACE_Message_Queue<ACE_SYNCH> *future_notification_queue_;
ACE_Futures
which
have been written to by client's writer thread.
int delete_queue_;
jtucker@infoglide.com