WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
FileWriteAction.h
1 
10 #ifndef WRENCH_FILE_WRITE_ACTION_H
11 #define WRENCH_FILE_WRITE_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 FileWriteAction : public Action {
26 
27  public:
28  std::shared_ptr<DataFile>getFile() const;
29  std::shared_ptr<FileLocation> getFileLocation() const;
30  bool usesScratch() const override;
31 
32  protected:
33  friend class CompoundJob;
34 
35  FileWriteAction(const std::string& name, std::shared_ptr<CompoundJob> job,
36  std::shared_ptr<DataFile>file, std::shared_ptr<FileLocation> file_location);
37 
38 
39  void execute(std::shared_ptr<ActionExecutor> action_executor) override;
40  void terminate(std::shared_ptr<ActionExecutor> action_executor) override;
41 
42  private:
43  std::shared_ptr<DataFile>file;
44  std::shared_ptr<FileLocation> file_location;
45 
46  };
47 }
48 
49 #endif //WRENCH_FILE_WRITE_ACTION_H
wrench::FileWriteAction::execute
void execute(std::shared_ptr< ActionExecutor > action_executor) override
Method to execute the action.
Definition: FileWriteAction.cpp:60
wrench::FileWriteAction::terminate
void terminate(std::shared_ptr< ActionExecutor > action_executor) override
Method called when the action terminates.
Definition: FileWriteAction.cpp:71
wrench::FileWriteAction::FileWriteAction
FileWriteAction(const std::string &name, std::shared_ptr< CompoundJob > job, std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > file_location)
Constructor.
Definition: FileWriteAction.cpp:32
wrench::FileWriteAction::getFile
std::shared_ptr< DataFile > getFile() const
Returns the action's file.
Definition: FileWriteAction.cpp:43
wrench
Definition: Action.cpp:28
wrench::FileWriteAction::getFileLocation
std::shared_ptr< FileLocation > getFileLocation() const
Returns the action's file location.
Definition: FileWriteAction.cpp:51
wrench::FileWriteAction::usesScratch
bool usesScratch() const override
Determine whether the action uses scratch.
Definition: FileWriteAction.cpp:79
wrench::Action
An abstract class that implements the concept of an action.
Definition: Action.h:28
wrench::FileWriteAction
A class that implements a file write action.
Definition: FileWriteAction.h:25
wrench::CompoundJob
A compound job.
Definition: CompoundJob.h:47