From: Christian P. <cp...@us...> - 2005-05-29 17:48:40
|
Update of /cvsroot/pclasses/pclasses2/src/IO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28526/src/IO Modified Files: IODevice.cpp Makefile.am Added Files: IOListener.cpp Log Message: - Added beginning of async IOListeners --- NEW FILE: IOListener.cpp --- /*************************************************************************** * 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. * ***************************************************************************/ #include "pclasses/IO/IOListener.h" namespace P { namespace IO { IOListener::IOListener(IODevice& dev, int flags) : _dev(dev) { dev.addListener(this); } IOListener::~IOListener() { _dev.removeListener(this); } } } Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/IO/Makefile.am,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Makefile.am 25 May 2005 08:02:55 -0000 1.11 +++ Makefile.am 29 May 2005 17:48:31 -0000 1.12 @@ -6,7 +6,7 @@ libpclasses_io_la_SOURCES = IOError.cpp IODevice.cpp IOStream.cpp \ IOFilter.cpp URL.cpp ZLib.cpp ZLibIOFilter.cpp BZip2.cpp BZip2IOFilter.cpp \ - IORequest.cpp IOHandler.cpp IOManager.cpp + IORequest.cpp IOHandler.cpp IOManager.cpp IOListener.cpp libpclasses_io_la_LDFLAGS = -no-nundefined Index: IODevice.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/IO/IODevice.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- IODevice.cpp 30 Jan 2005 17:09:13 -0000 1.8 +++ IODevice.cpp 29 May 2005 17:48:31 -0000 1.9 @@ -197,6 +197,15 @@ return _filter; } +void IODevice::addListener(IOListener*) throw(IOError) +{ + throw IOError(0, "Listening on this device is not supported", P_SOURCEINFO); +} + +void IODevice::removeListener(IOListener*) throw() +{ +} + size_t IODevice::_peek(char* buffer, size_t count) throw(IOError) { return 0; |