]> git.tdb.fi Git - builder.git/blobdiff - source/lib/task.h
Associate targets with FileTargets instead of paths
[builder.git] / source / lib / task.h
index 915ffe12a9e774f27adc9caede2736b59779492e..3520a91ae04ab3fe584a873ec6e56123d7f8e8ae 100644 (file)
@@ -2,15 +2,18 @@
 #define TASK_H_
 
 #include <string>
+#include <vector>
 #include <sigc++/signal.h>
-#include <msp/fs/path.h>
+#include "libbuilder_api.h"
+
+class FileTarget;
 
 /**
 Tasks are used to manage other programs and worker threads involved in the
 build process.  They are run asynchronously by default, but a wait() method is
 provided should it be necessary to wait for a task to finish.
 */
-class Task
+class LIBBUILDER_API Task
 {
 public:
        enum Status
@@ -23,15 +26,15 @@ public:
        sigc::signal<void, bool> signal_finished;
 
 protected:
-       std::vector<Msp::FS::Path> files;
+       std::vector<const FileTarget *> targets;
        bool unlink = false;
 
        Task() = default;
 public:
        virtual ~Task() { }
 
-       /** Associate the task with a file. */
-       void add_file(const Msp::FS::Path &);
+       /** Associate the task with a target. */
+       void add_target(const FileTarget &);
 
        /** If set to true, the associated files are removed before the task is
        started. */