#include <string>
#include <vector>
#include <sigc++/signal.h>
+#include <msp/time/timedelta.h>
+#include <msp/time/timestamp.h>
#include "libbuilder_api.h"
class FileTarget;
protected:
std::vector<const FileTarget *> targets;
bool unlink = false;
+ Msp::Time::TimeStamp start_time;
+ Msp::Time::TimeDelta duration;
Task() = default;
public:
started. */
void set_unlink(bool = true);
+ const std::vector<const FileTarget *> &get_targets() const { return targets; }
+
/** Returns the command being executed for this task. Only makes sense if
an external command is involved. */
virtual std::string get_command() const = 0;
/// Ensures that the output directory exists and removes files if necessary.
void prepare();
+ void finished(bool);
+
public:
/// Checks the status of the task and immediately returns.
virtual Status check() = 0;
/// Waits for the task to finish and returns its final status.
virtual Status wait() = 0;
+
+ /** Returns the amount of time completing the task took. Only available
+ after the task has finished. */
+ const Msp::Time::TimeDelta &get_duration() const { return duration; }
};
#endif