diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-11-01 22:17:39 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-11-01 22:17:39 +0000 |
commit | 53284e215e3d3351a7d7e9c4b68f14b427fb4377 (patch) | |
tree | 97236ece363cff48fd287c780db4290da39b02cb /ace/Future_Set.h | |
parent | 7b7c52ad2abd228138ba1a948d5e28bf6dc3b880 (diff) | |
download | ATCD-53284e215e3d3351a7d7e9c4b68f14b427fb4377.tar.gz |
ChangeLogTag:Wed Nov 1 14:11:48 2000 Carlos O'Ryan <coryan@uci.edu>
Diffstat (limited to 'ace/Future_Set.h')
-rw-r--r-- | ace/Future_Set.h | 90 |
1 files changed, 47 insertions, 43 deletions
diff --git a/ace/Future_Set.h b/ace/Future_Set.h index eaecada4dc3..17bda22c188 100644 --- a/ace/Future_Set.h +++ b/ace/Future_Set.h @@ -1,18 +1,15 @@ /* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// ace -// -// = FILENAME -// Future_Set.h -// -// = AUTHOR (S) -// John Tucker <jtucker@infoglide.com> -// -// ============================================================================ + +//============================================================================= +/** + * @file Future_Set.h + * + * $Id$ + * + * @author John Tucker <jtucker@infoglide.com> + */ +//============================================================================= + #ifndef ACE_FUTURE_SET_H #define ACE_FUTURE_SET_H @@ -29,50 +26,57 @@ #if defined (ACE_HAS_THREADS) +/** + * @class ACE_Future_Set + * + * @brief This class implements a mechanism which allows the values of + * a collections of <ACE_Future> objects to be accessed by + * reader threads as they become available. + */ template <class T> class ACE_Future_Set : public ACE_Future_Observer<T> { - // = TITLE - // This class implements a mechanism which allows the values of - // a collections of <ACE_Future> objects to be accessed by - // reader threads as they become available. public: // = Initialization and termination methods. + /// Constructor. ACE_Future_Set (ACE_Message_Queue<ACE_SYNCH> *future_notification_queue_ = 0); - // Constructor. + /// Destructor. ~ACE_Future_Set (void); - // Destructor. + /// Return 1 if their are no <ACE_Future> objects left on its queue and + /// 0 otherwise int is_empty (void) const; - // Return 1 if their are no <ACE_Future> objects left on its queue and - // 0 otherwise + /** + * Enqueus the given <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 insert (ACE_Future<T> &future); - // Enqueus the given <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. + /** + * Wait up to <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. + */ int next_readable (ACE_Future<T> &result, ACE_Time_Value *tv = 0); - // Wait up to <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. + /// Called by the <ACE_Future> subject in which we are subscribed to + /// when its value is written to. virtual void update (const ACE_Future<T> &future); - // Called by the <ACE_Future> subject in which we are subscribed to - // when its value is written to. + /// Declare the dynamic allocation hooks. ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. private: // = Disallow these operations. @@ -95,16 +99,16 @@ private: FUTURE_REP_COMPARE, ACE_Null_Mutex> FUTURE_HASH_MAP; + /// Map of <ACE_Futures>, subjects, which have not been written to by + /// client's writer thread. FUTURE_HASH_MAP future_map_; - // Map of <ACE_Futures>, subjects, which have not been written to by - // client's writer thread. + /// Message queue for notifying the reader thread of <ACE_Futures> which + /// have been written to by client's writer thread. ACE_Message_Queue<ACE_SYNCH> *future_notification_queue_; - // Message queue for notifying the reader thread of <ACE_Futures> which - // have been written to by client's writer thread. + /// Keeps track of whether we need to delete the message queue. int delete_queue_; - // Keeps track of whether we need to delete the message queue. }; #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) |