summaryrefslogtreecommitdiff
path: root/ACE/apps/JAWS3/jaws3/Asynch_IO_Helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/apps/JAWS3/jaws3/Asynch_IO_Helpers.h')
-rw-r--r--ACE/apps/JAWS3/jaws3/Asynch_IO_Helpers.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/ACE/apps/JAWS3/jaws3/Asynch_IO_Helpers.h b/ACE/apps/JAWS3/jaws3/Asynch_IO_Helpers.h
new file mode 100644
index 00000000000..e82ab8189e5
--- /dev/null
+++ b/ACE/apps/JAWS3/jaws3/Asynch_IO_Helpers.h
@@ -0,0 +1,54 @@
+/* -*- c++ -*- */
+// $Id$
+
+#ifndef JAWS_ASYNCH_IO_HELPERS_H
+#define JAWS_ASYNCH_IO_HELPERS_H
+
+#include "ace/Asynch_IO.h"
+#include "ace/Singleton.h"
+
+#include "jaws3/IO.h"
+#include "jaws3/Event_Result.h"
+#include "jaws3/Event_Completer.h"
+
+class JAWS_Asynch_IO;
+
+class JAWS_EC_AH_Adapter : public ACE_Handler
+// = TITLE
+// A JAWS_Event_Completer - ACE_Handler adapter.
+//
+// = DESCRIPTION
+// This class will be conditionally #included by jaws3/Asynch_IO.cpp
+// if the given platform supports POSIX or WIN32 asynch IO.
+{
+public:
+
+ static JAWS_EC_AH_Adapter * make (JAWS_Event_Completer *);
+
+ void handle_read_stream (const ACE_Asynch_Read_Stream::Result &result);
+
+ void handle_write_stream (const ACE_Asynch_Write_Stream::Result &result);
+
+ void handle_transmit_file (const ACE_Asynch_Transmit_File::Result &result);
+
+private:
+
+ JAWS_EC_AH_Adapter (JAWS_Event_Completer *completer)
+ : completer_ (completer)
+ {
+ }
+
+protected:
+
+ JAWS_Event_Result make_io_result ( const ACE_Asynch_Result &result
+ , JAWS_Event_Result::JE_REASON reason_ok
+ , JAWS_Event_Result::JE_REASON reason_fail
+ );
+
+private:
+
+ JAWS_Event_Completer *completer_;
+
+};
+
+#endif /* JAWS_ASYNCH_IO_HELPERS_H */