--- /dev/null
+#ifndef CHAINEDTASK_H_
+#define CHAINEDTASK_H_
+
+#include <vector>
+#include "task.h"
+
+/**
+Runs multiple tasks as one unit, one after the other. Execution of the chain
+will stop if any of the component tasks terminates with an error.
+*/
+class ChainedTask: public Task
+{
+private:
+ std::vector<Task *> tasks;
+ unsigned current;
+ Status final_status;
+
+public:
+ ChainedTask(Task *);
+ ~ChainedTask();
+
+ void add_task(Task *);
+
+ virtual std::string get_command() const;
+ virtual void start();
+ virtual Status check();
+ virtual Status wait();
+private:
+ bool process(Status);
+};
+
+#endif