make wxSelectDispatcher ctor public, it can be useful to create it in places other than wxFDIODispatcher
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52681 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -82,8 +82,8 @@ private:
|
|||||||
class WXDLLIMPEXP_BASE wxSelectDispatcher : public wxMappedFDIODispatcher
|
class WXDLLIMPEXP_BASE wxSelectDispatcher : public wxMappedFDIODispatcher
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// creates an instance of this class, the caller takes ownership of it
|
// default ctor
|
||||||
static wxSelectDispatcher *Create();
|
wxSelectDispatcher() { m_maxFD = -1; }
|
||||||
|
|
||||||
// implement pure virtual methods of the base class
|
// implement pure virtual methods of the base class
|
||||||
virtual bool RegisterFD(int fd, wxFDIOHandler *handler, int flags = wxFDIO_ALL);
|
virtual bool RegisterFD(int fd, wxFDIOHandler *handler, int flags = wxFDIO_ALL);
|
||||||
@@ -91,10 +91,6 @@ public:
|
|||||||
virtual bool UnregisterFD(int fd);
|
virtual bool UnregisterFD(int fd);
|
||||||
virtual void Dispatch(int timeout = TIMEOUT_INFINITE);
|
virtual void Dispatch(int timeout = TIMEOUT_INFINITE);
|
||||||
|
|
||||||
protected:
|
|
||||||
// ctor is not public, use Create()
|
|
||||||
wxSelectDispatcher();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// common part of RegisterFD() and ModifyFD()
|
// common part of RegisterFD() and ModifyFD()
|
||||||
bool DoUpdateFDAndHandler(int fd, wxFDIOHandler *handler, int flags);
|
bool DoUpdateFDAndHandler(int fd, wxFDIOHandler *handler, int flags);
|
||||||
|
@@ -54,7 +54,7 @@ wxFDIODispatcher *wxFDIODispatcher::Get()
|
|||||||
if ( !gs_dispatcher )
|
if ( !gs_dispatcher )
|
||||||
#endif // wxUSE_EPOLL_DISPATCHER
|
#endif // wxUSE_EPOLL_DISPATCHER
|
||||||
#if wxUSE_SELECT_DISPATCHER
|
#if wxUSE_SELECT_DISPATCHER
|
||||||
gs_dispatcher = wxSelectDispatcher::Create();
|
gs_dispatcher = new wxSelectDispatcher();
|
||||||
#endif // wxUSE_SELECT_DISPATCHER
|
#endif // wxUSE_SELECT_DISPATCHER
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -131,17 +131,6 @@ void wxSelectSets::Handle(int fd, wxFDIOHandler& handler) const
|
|||||||
// wxSelectDispatcher
|
// wxSelectDispatcher
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
/* static */
|
|
||||||
wxSelectDispatcher *wxSelectDispatcher::Create()
|
|
||||||
{
|
|
||||||
return new wxSelectDispatcher;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxSelectDispatcher::wxSelectDispatcher()
|
|
||||||
{
|
|
||||||
m_maxFD = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool wxSelectDispatcher::RegisterFD(int fd, wxFDIOHandler *handler, int flags)
|
bool wxSelectDispatcher::RegisterFD(int fd, wxFDIOHandler *handler, int flags)
|
||||||
{
|
{
|
||||||
if ( !wxMappedFDIODispatcher::RegisterFD(fd, handler, flags) )
|
if ( !wxMappedFDIODispatcher::RegisterFD(fd, handler, flags) )
|
||||||
|
Reference in New Issue
Block a user