Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / apps / JAWS2 / JAWS / Waiter.h
blobb96be4ab302917b48a43a362ca90f4cd88861234
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 ();
27 ~JAWS_Waiter ();
29 JAWS_Waiter_Base_Iterator &iter ();
30 // Returns an iterator to the headers container.
32 int index ();
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_;
44 typedef ACE_Singleton<JAWS_Waiter, ACE_SYNCH_MUTEX> JAWS_Waiter_Singleton;
46 #endif /* JAWS_WAITER_H */