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

FXEventStream.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                  Base class of an event driven FXStream                       *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2003 by Mathew Robertson.   All Rights Reserved.                *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (at your option) any later version.            *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************/
00022 #ifndef FXEVENTSTREAM_H
00023 #define FXEVENTSTREAM_H
00024 
00025 #ifndef FXBASEOBJECT_H
00026 #include "FXBaseObject.h"
00027 #endif
00028 #ifndef FXSTREAM_H
00029 #include <fox/FXStream.h>
00030 using namespace FX;
00031 #endif
00032 namespace FXEX {
00033 
00034 /**
00035  * This is a base class for FXStream objects which generate events when new
00036  * data is available.  This allows FXStream-derived applications to call
00037  * getApp()->addInput().  Eg this may be useful for a socket stream...
00038  */
00039 class FXAPI FXEventStream : public FXBaseObject, public FXStream {
00040   FXDECLARE (FXEventStream)
00041 
00042   protected:
00043     // serialisation
00044     FXEventStream(){}
00045 
00046     /// tell the target that more data is available
00047     void signal(void *ptr=NULL);
00048 
00049     /// tell the target that more data is available, using a specific seltype
00050     void signal(FXuint seltype,void *ptr=NULL);
00051 
00052   public:
00053     /// Initialise the event driven stream, using a specified container
00054     FXEventStream(FXApp *a,FXObject *tgt=NULL,FXSelector sel=0,const FXObject *cont=NULL);
00055 
00056     /// dtor
00057     virtual ~FXEventStream();
00058   };
00059 
00060 } // namespace FXEX
00061 #endif // FXEVENTSTREAM_H