faio_asyncio.hpp

00001 #line 93 "./lpsrc/flx_faio.pak"
00002 #ifndef __FLX_FAIO_ASYNCIO_H__
00003 #define __FLX_FAIO_ASYNCIO_H__
00004 #include <flx_faio_config.hpp>
00005 #include "pthread_sleep_queue.hpp"
00006 
00007 #include "demux_demuxer.hpp"        // sel_param, demuxer base
00008 #include "flx_rtl.hpp"
00009 
00010 namespace flx { namespace faio {
00011 
00012 struct FAIO_EXTERN finote_t
00013 {
00014   virtual void signal()=0;
00015   virtual ~finote_t(){}
00016 };
00017 
00018 class FAIO_EXTERN wakeup_fthread_t : public finote_t
00019 {
00020   rtl::fthread_t *f;
00021   pthread::sleep_queue_t *q;
00022 public:
00023   wakeup_fthread_t(pthread::sleep_queue_t *q_a, rtl::fthread_t *f_a) : f(f_a), q(q_a) {}
00024   void signal () { q->enqueue(f); }
00025 };
00026 
00027 
00028 class FAIO_EXTERN flx_driver_request_base {
00029     finote_t *fn;
00030     virtual bool start_async_op_impl() = 0;
00031 public:
00032     flx_driver_request_base() : fn(0) {}
00033     virtual ~flx_driver_request_base() {}       // so destructors work
00034 
00035     // returns finished flag (async may fail or immediately finish)
00036     void start_async_op(finote_t *fn_a);
00037     void notify_finished();
00038 };
00039 
00040 }} // namespace faio, flx
00041 #endif  // __ASYNCIO__
00042 
00043 

Generated on Mon Dec 24 04:04:21 2007 for Felix by  doxygen 1.5.4