]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/private/fdiohandler.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/private/fdiohandler.h
3 // Purpose: declares wxFDIOHandler class
4 // Author: Vadim Zeitlin
6 // RCS-ID: $Id: wxhead.h,v 1.11 2009-06-29 10:23:04 zeitlin Exp $
7 // Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_PRIVATE_FDIOHANDLER_H_
12 #define _WX_PRIVATE_FDIOHANDLER_H_
14 // ----------------------------------------------------------------------------
15 // wxFDIOHandler: interface used to process events on file descriptors
16 // ----------------------------------------------------------------------------
21 wxFDIOHandler() { m_regmask
= 0; }
23 // called when descriptor is available for non-blocking read
24 virtual void OnReadWaiting() = 0;
26 // called when descriptor is available for non-blocking write
27 virtual void OnWriteWaiting() = 0;
29 // called when there is exception on descriptor
30 virtual void OnExceptionWaiting() = 0;
32 // called to check if the handler is still valid, only used by
33 // wxSocketImplUnix currently
34 virtual bool IsOk() const { return true; }
37 // get/set the mask of events for which we're currently registered for:
38 // it's a combination of wxFDIO_{INPUT,OUTPUT,EXCEPTION}
39 int GetRegisteredEvents() const { return m_regmask
; }
40 void SetRegisteredEvent(int flag
) { m_regmask
|= flag
; }
41 void ClearRegisteredEvent(int flag
) { m_regmask
&= ~flag
; }
44 // virtual dtor for the base class
45 virtual ~wxFDIOHandler() { }
50 wxDECLARE_NO_COPY_CLASS(wxFDIOHandler
);
53 #endif // _WX_PRIVATE_FDIOHANDLER_H_