ACE_Future_Set< T > Class Template Reference

This class implements a mechanism which allows the values of a collection of ACE_Future objects to be accessed by reader threads as they become available. The caller(s) provide the ACE_Future_Set (i.e. the observer...) with the collection of ACE_Future objects (i.e. the subjects...) that are to be observed using the the ACE_Future_Set::insert() method. The caller(s) may then iterate over the collection in the order in which they become readable using the ACE_Future_Set::next_readable() method. More...

#include <Future_Set.h>

Inheritance diagram for ACE_Future_Set< T >:

Inheritance graph
[legend]
Collaboration diagram for ACE_Future_Set< T >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ACE_Future_Set (ACE_Message_Queue< ACE_SYNCH > *future_notification_queue_=0)
 Constructor.
 ~ACE_Future_Set (void)
 Destructor.
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)

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.

Private Types

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

Private Member Functions

void operator= (const ACE_Future_Set< T > &)
 ACE_Future_Set (const ACE_Future_Set< T > &)

Private Attributes

FUTURE_HASH_MAP future_map_
ACE_Message_Queue< ACE_SYNCH > * future_notification_queue_
bool delete_queue_
 Keeps track of whether we need to delete the message queue.


Detailed Description

template<class T>
class ACE_Future_Set< T >

This class implements a mechanism which allows the values of a collection of ACE_Future objects to be accessed by reader threads as they become available. The caller(s) provide the ACE_Future_Set (i.e. the observer...) with the collection of ACE_Future objects (i.e. the subjects...) that are to be observed using the the ACE_Future_Set::insert() method. The caller(s) may then iterate over the collection in the order in which they become readable using the ACE_Future_Set::next_readable() method.

Member Typedef Documentation

template<class T>
typedef ACE_Future<T> ACE_Future_Set< T >::FUTURE [private]

template<class T>
typedef ACE_Future_Rep<T> ACE_Future_Set< T >::FUTURE_REP [private]

template<class T>
typedef ACE_Future_Holder<T> ACE_Future_Set< T >::FUTURE_HOLDER [private]

template<class T>
typedef ACE_Pointer_Hash<FUTURE_REP *> ACE_Future_Set< T >::FUTURE_REP_HASH [private]

template<class T>
typedef ACE_Equal_To<FUTURE_REP *> ACE_Future_Set< T >::FUTURE_REP_COMPARE [private]


Constructor & Destructor Documentation

template<class T>
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Future_Set< T >::ACE_Future_Set ( ACE_Message_Queue< ACE_SYNCH > *  future_notification_queue_ = 0  )  [inline]

Constructor.

template<class T>
ACE_Future_Set< T >::~ACE_Future_Set ( void   )  [inline]

Destructor.

template<class T>
ACE_Future_Set< T >::ACE_Future_Set ( const ACE_Future_Set< T > &   )  [private]


Member Function Documentation

template<class T>
int ACE_Future_Set< T >::is_empty ( void   )  const [inline]

Return 1 if their are no ACE_Future objects left on its queue and 0 otherwise.

When an ACE_Future_Set has no ACE_Future>subjects to observe it is empty. The ACE_Future_Set is in the empty state when either the caller(s) have retrieved every readable ACE_Future subject assigned the ACE_Future_Set via the ACE_Future_Set::next_readable() method, or when the ACE_Future_Set has not been assigned any subjects.

template<class T>
int ACE_Future_Set< T >::insert ( ACE_Future< T > &  future  )  [inline]

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.

template<class T>
int ACE_Future_Set< T >::next_readable ( ACE_Future< T > &  result,
ACE_Time_Value tv = 0 
) [inline]

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 ACE_Future object param will be assigned with it and 1 will be returned. If the ACE_Future_Set is empty (i.e. see definition of ACE_Future_Set::is_empty()), then 0 is returned.

When a readable ACE_Future object is retrieved via the ACE_Future_Set::next_readable() method, the ACE_Future_Set will remove that ACE_Future object from its list of subjects.

template<class T>
void ACE_Future_Set< T >::update ( const ACE_Future< T > &  future  )  [inline, virtual]

Called by the ACE_Future subject in which we are subscribed to when its value is written to.

Implements ACE_Future_Observer< T >.

template<class T>
void ACE_Future_Set< T >::operator= ( const ACE_Future_Set< T > &   )  [private]


Member Data Documentation

template<class T>
ACE_Future_Set< T >::ACE_ALLOC_HOOK_DECLARE

Declare the dynamic allocation hooks.

Reimplemented from ACE_Future_Observer< T >.

template<class T>
FUTURE_HASH_MAP ACE_Future_Set< T >::future_map_ [private]

Map of <ACE_Futures>, subjects, which have not been written to by client's writer thread.

template<class T>
ACE_Message_Queue<ACE_SYNCH>* ACE_Future_Set< T >::future_notification_queue_ [private]

Message queue for notifying the reader thread of <ACE_Futures> which have been written to by client's writer thread.

template<class T>
bool ACE_Future_Set< T >::delete_queue_ [private]

Keeps track of whether we need to delete the message queue.


The documentation for this class was generated from the following files:

Generated on Wed Apr 23 02:39:12 2008 for ACE by  doxygen 1.5.5