Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

kprocctrl.h

00001 /* This file is part of the KDE libraries
00002     Copyright (C) 1997 Christian Czezakte (e9025461@student.tuwien.ac.at)
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library 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 GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to
00016     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017     Boston, MA 02111-1307, USA.
00018 */
00019 //
00020 //  KPROCESSCONTROLLER -- A helper class for KProcess
00021 //
00022 //  version 0.3.1, Jan 8th 1997
00023 //
00024 //  (C) Christian Czezatke
00025 //  e9025461@student.tuwien.ac.at
00026 //
00027 
00028 #ifndef __KPROCCTRL_H__
00029 #define __KPROCCTRL_H__
00030 
00031 #include <qvaluelist.h>
00032 #include <qtimer.h>
00033 
00034 #include "kprocess.h"
00035 
00036 class KProcessControllerPrivate;
00037 class QSocketNotifier;
00038 
00050 class KProcessController : public QObject
00051 {
00052   Q_OBJECT
00053 
00054 public:
00055   KProcessController();
00056   ~KProcessController(); 
00057   //CC: WARNING! Destructor Not virtual (but you don't derive classes from this anyhow...)
00058 
00059 public:
00060     
00065   static KProcessController *theKProcessController;
00066 
00075   static void theSigCHLDHandler(int signal);
00076   // handler for sigchld
00077   
00081   static void setupHandlers();
00085   static void resetHandlers();
00089   void addKProcess( KProcess* );
00093   void removeKProcess( KProcess* );
00094  public slots:
00098  void slotDoHousekeeping(int socket);
00099 
00100  private slots:
00101  void delayedChildrenCleanup();
00102 private:
00103   int fd[2];
00104   QSocketNotifier *notifier;
00105   static struct sigaction oldChildHandlerData;
00106   static bool handlerSet;
00107   QValueList<KProcess*> processList;
00108   QTimer delayedChildrenCleanupTimer;
00109 
00110   // Disallow assignment and copy-construction
00111   KProcessController( const KProcessController& );
00112   KProcessController& operator= ( const KProcessController& );
00113 
00114   KProcessControllerPrivate *d;
00115 };
00116 
00117 
00118 
00119 #endif
00120 

Generated on Sat Jul 26 04:23:40 2003 by doxygen1.2.18