Update of /cvsroot/pclasses/pclasses2/include/pclasses/IO
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28526/include/pclasses/IO
Modified Files:
IODevice.h Makefile.am
Added Files:
IOListener.h
Log Message:
- Added beginning of async IOListeners
Index: IODevice.h
===================================================================
RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/IO/IODevice.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- IODevice.h 30 Jan 2005 17:08:48 -0000 1.7
+++ IODevice.h 29 May 2005 17:48:31 -0000 1.8
@@ -31,6 +31,7 @@
// forward declaration
class IOFilter;
+class IOListener;
//! I/O Device base class
/*!
@@ -197,9 +198,14 @@
IOFilter* filter() const throw();
protected:
+ friend class IOListener;
+
IODevice(const IODevice& dev) throw();
IODevice& operator=(const IODevice& dev) throw();
+ virtual void addListener(IOListener*) throw(IOError);
+ virtual void removeListener(IOListener*) throw();
+
//! Called when device should be closed
/*!
precondition: valid()==true
Index: Makefile.am
===================================================================
RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/IO/Makefile.am,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- Makefile.am 25 May 2005 08:02:56 -0000 1.8
+++ Makefile.am 29 May 2005 17:48:31 -0000 1.9
@@ -4,4 +4,4 @@
METASOURCES = AUTO
pclasses_io_include_HEADERS = IOError.h IODevice.h IOStream.h IOFilter.h \
URL.h ZLib.h ZLibIOFilter.h BZip2.h BZip2IOFilter.h IORequest.h \
- IOHandler.h IOManager.h
+ IOHandler.h IOManager.h IOListener.h
--- NEW FILE: IOListener.h ---
/***************************************************************************
* Copyright (C) 2004 by Christian Prochnow *
* cp...@se... *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Library General Public License as *
* published by the Free Software Foundation; either version 2 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef P_IO_IOListener_h
#define P_IO_IOListener_h
#include <pclasses/Export.h>
#include <pclasses/IO/IODevice.h>
namespace P {
namespace IO {
class PIO_EXPORT IOListener {
public:
//! Notify flags
enum NotifyFlags {
NotifyNone = 0x0,
NotifyRead = 0x1,
NotifyWrite = 0x2
};
IOListener(IODevice& dev, int flags = 0);
virtual ~IOListener();
virtual int flags() const = 0;
virtual void setFlags(int flags) = 0;
virtual void onRead() = 0;
virtual void onWrite() = 0;
private:
IODevice& _dev;
};
} // !namespace IO
} // !namespace P
#endif
|