]> git.tdb.fi Git - builder.git/blobdiff - source/internalaction.h
Add class InternalAction for actions that use a thread to do their work
[builder.git] / source / internalaction.h
diff --git a/source/internalaction.h b/source/internalaction.h
new file mode 100644 (file)
index 0000000..284db03
--- /dev/null
@@ -0,0 +1,38 @@
+/* $Id$
+
+This file is part of builder
+Copyright © 2007 Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+
+#ifndef INTERNALACTION_H_
+#define INTERNALACTION_H_
+
+#include <msp/core/thread.h>
+#include "action.h"
+
+class InternalAction: public Action
+{
+public:
+       virtual ~InternalAction();
+
+       virtual int check();
+protected:
+       class Worker: public Msp::Thread
+       {
+       public:
+               bool get_done() const  { return done; }
+               bool get_error() const { return error; }
+       protected:
+               bool done;
+               bool error;
+
+               Worker();
+       };
+
+       Worker *worker;
+
+       InternalAction(Builder &);
+};
+
+#endif