5 #include <sigc++/signal.h>
6 #include <msp/fs/path.h>
9 Tasks are used to manage other programs and worker threads involved in the
10 build process. They are run asynchronously by default, but a wait() method is
11 provided should it be necessary to wait for a task to finish.
23 sigc::signal<void, bool> signal_finished;
25 std::list<Msp::FS::Path> files;
33 /** Associate the task with a file. */
34 void add_file(const Msp::FS::Path &);
36 /** If set to true, the associated files are removed before the task is
38 void set_unlink(bool = true);
40 /** Returns the command being executed for this task. Only makes sense if
41 an external command is involved. */
42 virtual std::string get_command() const = 0;
45 virtual void start() = 0;
48 /// Ensures that the output directory exists and removes files if necessary.
52 /// Checks the status of the task and immediately returns.
53 virtual Status check() = 0;
55 /// Waits for the task to finish and returns its final status.
56 virtual Status wait() = 0;