WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
FileRegistryAction.h
1 
10 #ifndef WRENCH_FILE_REGISTRY_ACTION_H
11 #define WRENCH_FILE_REGISTRY_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  class FileRegistryService;
22 
26  class FileRegistryAction : public Action {
27 
28  public:
29  std::shared_ptr<DataFile>getFile() const;
30  std::shared_ptr<FileLocation> getFileLocation() const;
31  std::shared_ptr<FileRegistryService> getFileRegistryService() const;
32 
33  protected:
34  friend class CompoundJob;
35 
39  enum Type {
40  ADD,
41  DELETE
42  };
43 
45  const std::string& name,
46  std::shared_ptr<CompoundJob> job,
47  std::shared_ptr<FileRegistryService> file_registry_service,
48  std::shared_ptr<DataFile>file,
49  std::shared_ptr<FileLocation> file_location);
50 
51 
52  void execute(std::shared_ptr<ActionExecutor> action_executor) override;
53  void terminate(std::shared_ptr<ActionExecutor> action_executor) override;
54 
55  private:
57  std::shared_ptr<FileRegistryService> file_registry_service;
58  std::shared_ptr<DataFile>file;
59  std::shared_ptr<FileLocation> file_location;
60 
61  };
62 }
63 
64 #endif //WRENCH_FILE_REGISTRY_ACTION_H
wrench::FileRegistryAction::Type
Type
File registry action type enum.
Definition: FileRegistryAction.h:39
wrench::FileRegistryAction::execute
void execute(std::shared_ptr< ActionExecutor > action_executor) override
Method to execute the action.
Definition: FileRegistryAction.cpp:74
wrench::FileRegistryAction::terminate
void terminate(std::shared_ptr< ActionExecutor > action_executor) override
Method called when the action terminates.
Definition: FileRegistryAction.cpp:89
wrench
Definition: Action.cpp:28
wrench::FileRegistryAction::FileRegistryAction
FileRegistryAction(FileRegistryAction::Type type, const std::string &name, std::shared_ptr< CompoundJob > job, std::shared_ptr< FileRegistryService > file_registry_service, std::shared_ptr< DataFile >file, std::shared_ptr< FileLocation > file_location)
Constructor.
Definition: FileRegistryAction.cpp:35
wrench::FileRegistryAction::getFileRegistryService
std::shared_ptr< FileRegistryService > getFileRegistryService() const
Returns the action's file registry service.
Definition: FileRegistryAction.cpp:48
wrench::FileRegistryAction::getFileLocation
std::shared_ptr< FileLocation > getFileLocation() const
Returns the action's file locations.
Definition: FileRegistryAction.cpp:65
wrench::Action
An abstract class that implements the concept of an action.
Definition: Action.h:28
wrench::FileRegistryAction
A class that implements a file registry (abstract) action.
Definition: FileRegistryAction.h:26
wrench::CompoundJob
A compound job.
Definition: CompoundJob.h:47
wrench::FileRegistryAction::getFile
std::shared_ptr< DataFile > getFile() const
Returns the action's file.
Definition: FileRegistryAction.cpp:57