summaryrefslogtreecommitdiffstats
path: root/knights/io_engine.h
diff options
context:
space:
mode:
Diffstat (limited to 'knights/io_engine.h')
-rw-r--r--knights/io_engine.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/knights/io_engine.h b/knights/io_engine.h
new file mode 100644
index 0000000..3952d60
--- /dev/null
+++ b/knights/io_engine.h
@@ -0,0 +1,81 @@
+/***************************************************************************
+ io_engine.h - description
+ -------------------
+ begin : Sat Jun 30 2001
+ copyright : (C) 2003 by Troy Corbin Jr.
+ email : tcorbin@users.sourceforge.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef IO_ENGINE_H
+#define IO_ENGINE_H
+
+#include <qstring.h>
+#include <qvaluelist.h>
+#include "io_base.h"
+
+/**
+ *@author Troy Corbin Jr.
+ */
+
+class QFile;
+class KProcess;
+class resource;
+class proto_base;
+
+class io_engine : public io_base
+{
+ Q_OBJECT
+ public:
+ io_engine( QWidget *parent=NULL, resource *Rsrc=0 );
+ ~io_engine();
+
+ void Start( const int side );
+
+ public slots:
+ virtual void recvCMD( const Command& command );
+ void recvProtoCMD( const Command& command );
+ void SendClear( KProcess* );
+ void Recv( KProcess*, char*, int );
+
+ signals:
+ virtual void sendCMD(const Command& command);
+
+ protected slots:
+ void sendToChild( void );
+ void WriteFIFO( const QString &Data );
+
+ protected:
+ void Kill( void );
+
+ private:
+
+ engineList::Iterator IT;
+ proto_base *proto;
+
+ /* States */
+ bool SafeToSend;
+ bool SendSIGINT;
+ bool CleanBuffer;
+ bool Forced;
+
+ /* References */
+ QFile *Log;
+ int Protocol;
+ ChessMove Move;
+
+ /* Data */
+ KProcess *engine;
+ QString FIFO_In;
+ QString FIFO_Out;
+};
+
+#endif