WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
FileReadAction.h
1 
10 #ifndef WRENCH_FILE_READ_ACTION_H
11 #define WRENCH_FILE_READ_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 FileReadAction : public Action {
26 
27  public:
28  std::shared_ptr<DataFile>getFile() const;
29  std::vector<std::shared_ptr<FileLocation>> getFileLocations() const;
30  std::shared_ptr<FileLocation> getUsedFileLocation() const;
31  bool usesScratch() const override;
32 
33  protected:
34  friend class CompoundJob;
35 
36  FileReadAction(const std::string& name, std::shared_ptr<CompoundJob> job,
37  std::shared_ptr<DataFile>file, std::vector<std::shared_ptr<FileLocation>> file_locations);
38 
39 
40  void execute(std::shared_ptr<ActionExecutor> action_executor) override;
41  void terminate(std::shared_ptr<ActionExecutor> action_executor) override;
42 
43 
44  private:
45  std::shared_ptr<DataFile>file;
46  std::vector<std::shared_ptr<FileLocation>> file_locations;
47  std::shared_ptr<FileLocation> used_location;
48 
49  };
50 }
51 
52 #endif //WRENCH_FILE_READ_ACTION_H
wrench::FileReadAction::terminate
void terminate(std::shared_ptr< ActionExecutor > action_executor) override
Method called when the action terminates.
Definition: FileReadAction.cpp:82
wrench::FileReadAction::getFileLocations
std::vector< std::shared_ptr< FileLocation > > getFileLocations() const
Returns the action's file locations.
Definition: FileReadAction.cpp:50
wrench::FileReadAction::execute
void execute(std::shared_ptr< ActionExecutor > action_executor) override
Method to execute the action.
Definition: FileReadAction.cpp:59
wrench
Definition: Action.cpp:28
wrench::FileReadAction::FileReadAction
FileReadAction(const std::string &name, std::shared_ptr< CompoundJob > job, std::shared_ptr< DataFile >file, std::vector< std::shared_ptr< FileLocation >> file_locations)
Constructor.
Definition: FileReadAction.cpp:32
wrench::FileReadAction
A class that implements a file read action.
Definition: FileReadAction.h:25
wrench::FileReadAction::getUsedFileLocation
std::shared_ptr< FileLocation > getUsedFileLocation() const
Return the file location used by the action (or nullptr if action has not started,...
Definition: FileReadAction.cpp:91
wrench::FileReadAction::getFile
std::shared_ptr< DataFile > getFile() const
Returns the action's file.
Definition: FileReadAction.cpp:42
wrench::FileReadAction::usesScratch
bool usesScratch() const override
Determine whether the action uses scratch.
Definition: FileReadAction.cpp:99
wrench::Action
An abstract class that implements the concept of an action.
Definition: Action.h:28