]> git.tdb.fi Git - builder.git/blobdiff - source/copy.h
Refactor InternalTask to take a functor
[builder.git] / source / copy.h
index a5044d8ba50a58bfcf5c56866ab59c962ac556fd..c0a433996a9c0a14625ebf918c9c6092eac6d9e0 100644 (file)
@@ -1,9 +1,6 @@
 #ifndef COPY_H_
 #define COPY_H_
 
-#include <msp/core/thread.h>
-#include <msp/fs/path.h>
-#include "internaltask.h"
 #include "tool.h"
 
 class InstalledFile;
@@ -13,26 +10,14 @@ Copies a file to another place.  Used by the InstalledFile target.
 */
 class Copy: public Tool
 {
-private:
-       /**
-       A worker thread that actually does the data transfer.
-       */
-       class Worker: public InternalTask::Worker
-       {
-       private:
-               const InstalledFile &target;
-
-       public:
-               Worker(const InstalledFile &t): target(t) { }
-       private:
-               void main() override;
-       };
-
 public:
        Copy(Builder &b): Tool(b, "CP") { }
 
        Target *create_target(const std::vector<Target *> &, const std::string &) override;
        Task *run(const Target &) const override;
+
+private:
+       static bool _run(const InstalledFile &);
 };
 
 #endif