WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
FileCopyAction.h
1 
10 #ifndef WRENCH_FILE_COPY_ACTION_H
11 #define WRENCH_FILE_COPY_ACTION_H
12 
13 #include <string>
14 
15 #include "wrench/action/Action.h"
16 
17 namespace wrench {
18 
19  class DataFile;
20  class FileLocation;
21 
25  class FileCopyAction : public Action {
26 
27  public:
28  std::shared_ptr<DataFile>getFile() const;
29  std::shared_ptr<FileLocation> getSourceFileLocation() const;
30  std::shared_ptr<FileLocation> getDestinationFileLocation() const;
31 
32  bool usesScratch() const override;
33 
34  protected:
35  friend class CompoundJob;
36 
37  FileCopyAction(const std::string& name, std::shared_ptr<CompoundJob> job,
38  std::shared_ptr<DataFile>file,
39  std::shared_ptr<FileLocation> src_file_location,
40  std::shared_ptr<FileLocation> dst_file_location);
41 
42 
43  void execute(std::shared_ptr<ActionExecutor> action_executor) override;
44  void terminate(std::shared_ptr<ActionExecutor> action_executor) override;
45 
46  private:
47  std::shared_ptr<DataFile>file;
48  std::shared_ptr<FileLocation> src_file_location;
49  std::shared_ptr<FileLocation> dst_file_location;
50 
51  };
52 }
53 
54 #endif //WRENCH_FILE_COPY_ACTION_H
wrench::FileCopyAction::terminate
void terminate(std::shared_ptr< ActionExecutor > action_executor) override
Method called when the action terminates.
Definition: FileCopyAction.cpp:83
wrench::FileCopyAction
A class that implements a file copy action.
Definition: FileCopyAction.h:25
wrench::FileCopyAction::execute
void execute(std::shared_ptr< ActionExecutor > action_executor) override
Method to execute the action.
Definition: FileCopyAction.cpp:71
wrench::FileCopyAction::getSourceFileLocation
std::shared_ptr< FileLocation > getSourceFileLocation() const
Returns the action's source file location.
Definition: FileCopyAction.cpp:55
wrench::FileCopyAction::getFile
std::shared_ptr< DataFile > getFile() const
Returns the action's file.
Definition: FileCopyAction.cpp:47
wrench
Definition: Action.cpp:28
wrench::FileCopyAction::FileCopyAction
FileCopyAction(const std::string &name, std::shared_ptr< CompoundJob > job, std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > src_file_location, std::shared_ptr< FileLocation > dst_file_location)
Constructor.
Definition: FileCopyAction.cpp:33
wrench::FileCopyAction::usesScratch
bool usesScratch() const override
Determine whether the action uses scratch.
Definition: FileCopyAction.cpp:92
wrench::Action
An abstract class that implements the concept of an action.
Definition: Action.h:28
wrench::FileCopyAction::getDestinationFileLocation
std::shared_ptr< FileLocation > getDestinationFileLocation() const
Returns the action's destination file location.
Definition: FileCopyAction.cpp:63
wrench::CompoundJob
A compound job.
Definition: CompoundJob.h:47