]> git.saurik.com Git - wxWidgets.git/blame - include/wx/private/gsocketiohandler.h
radically simplified declarations of wxUString-specific char buffers: there are no...
[wxWidgets.git] / include / wx / private / gsocketiohandler.h
CommitLineData
30c45bdd
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/private/gsocketiohandler.h
3// Purpose: class for registering GSocket in wxSelectDispatcher
4// Authors: Lukasz Michalski
30c45bdd
VZ
5// Created: December 2006
6// Copyright: (c) Lukasz Michalski
7// RCS-ID: $Id$
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef _WX_PRIVATE_GSOCKETIOHANDLER_H_
12#define _WX_PRIVATE_GSOCKETIOHANDLER_H_
13
14#include "wx/defs.h"
30c45bdd 15
2804f77d 16#if wxUSE_SOCKETS && wxUSE_SELECT_DISPATCHER
30c45bdd 17
2804f77d
VZ
18#include "wx/private/selectdispatcher.h"
19#include "wx/gsocket.h"
30c45bdd 20
2804f77d 21class WXDLLIMPEXP_BASE wxGSocketIOHandler : public wxFDIOHandler
30c45bdd
VZ
22{
23public:
2804f77d
VZ
24 wxGSocketIOHandler(GSocket* socket)
25 {
26 m_socket = socket;
27 m_flags = 0;
28 }
29
30 int GetFlags() const { return m_flags; }
31 void RemoveFlag(wxFDIODispatcherEntryFlags flag) { m_flags &= ~flag; }
32 void AddFlag(wxFDIODispatcherEntryFlags flag) { m_flags |= flag; }
30c45bdd 33
2804f77d
VZ
34 virtual void OnReadWaiting() { m_socket->Detected_Read(); }
35 virtual void OnWriteWaiting() { m_socket->Detected_Write(); }
36 virtual void OnExceptionWaiting() { m_socket->Detected_Read(); }
30c45bdd 37
b46b1d59 38private:
30c45bdd
VZ
39 GSocket* m_socket;
40 int m_flags;
41};
42
2804f77d 43#endif // wxUSE_SOCKETS && wxUSE_SELECT_DISPATCHER
30c45bdd
VZ
44
45#endif // _WX_PRIVATE_SOCKETEVTDISPATCH_H_