Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

CStreamFilter.h

00001 /*
00002  * synergy -- mouse and keyboard sharing utility
00003  * Copyright (C) 2004 Chris Schoeneman
00004  * 
00005  * This package is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * found in the file COPYING that should have accompanied this file.
00008  * 
00009  * This package is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  */
00014 
00015 #ifndef CSTREAMFILTER_H
00016 #define CSTREAMFILTER_H
00017 
00018 #include "IStream.h"
00019 
00021 
00025 class CStreamFilter : public IStream {
00026 public:
00032     CStreamFilter(IStream* stream, bool adoptStream = true);
00033     ~CStreamFilter();
00034 
00035     // IStream overrides
00036     // These all just forward to the underlying stream except getEventTarget.
00037     // Override as necessary.  getEventTarget returns a pointer to this.
00038     virtual void        close();
00039     virtual UInt32      read(void* buffer, UInt32 n);
00040     virtual void        write(const void* buffer, UInt32 n);
00041     virtual void        flush();
00042     virtual void        shutdownInput();
00043     virtual void        shutdownOutput();
00044     virtual void*       getEventTarget() const;
00045     virtual bool        isReady() const;
00046     virtual UInt32      getSize() const;
00047 
00048 protected:
00050 
00053     IStream*            getStream() const;
00054 
00056 
00060     virtual void        filterEvent(const CEvent&);
00061 
00062 private:
00063     void                handleUpstreamEvent(const CEvent&, void*);
00064 
00065 private:
00066     IStream*            m_stream;
00067     bool                m_adopted;
00068 };
00069 
00070 #endif

Generated on Fri Nov 6 00:21:14 2009 for synergy-plus by  doxygen 1.3.9.1