Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / ACE / apps / JAWS2 / JAWS / Waiter.h
blob613868e7f9e93f2f310c3673a3d899b8bbea7a67
1 /* -*- c++ -*- */
2 #ifndef JAWS_WAITER_H
3 #define JAWS_WAITER_H
5 #include "ace/Singleton.h"
7 #if !defined (ACE_LACKS_PRAGMA_ONCE)
8 # pragma once
9 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 #include "ace/Synch_Traits.h"
12 #include "JAWS/Assoc_Array.h"
13 #include "JAWS/Export.h"
15 class JAWS_IO_Handler;
17 typedef ACE_thread_t JAWS_Thread_ID;
19 typedef JAWS_Assoc_Array<JAWS_Thread_ID, JAWS_IO_Handler *> JAWS_Waiter_Base;
20 typedef JAWS_Assoc_Array_Iterator<JAWS_Thread_ID, JAWS_IO_Handler *>
21 JAWS_Waiter_Base_Iterator;
23 class JAWS_Export JAWS_Waiter : public JAWS_Waiter_Base
25 public:
26 JAWS_Waiter (void);
27 ~JAWS_Waiter (void);
29 JAWS_Waiter_Base_Iterator &iter (void);
30 // Returns an iterator to the headers container.
32 int index (void);
33 // Returns the index into the table associated with calling thread.
35 JAWS_IO_Handler * wait_for_completion (int i = -1);
36 // The entry point for this class, handles outstanding asynchronous
37 // events. Can optionally accept a parameter that points to which
38 // table entry to return.
40 private:
41 JAWS_Waiter_Base_Iterator iter_;
45 typedef ACE_Singleton<JAWS_Waiter, ACE_SYNCH_MUTEX> JAWS_Waiter_Singleton;
47 #endif /* JAWS_WAITER_H */