karazeh
A cross-platform software updating library.
operation.hpp
Go to the documentation of this file.
1 
21 #ifndef H_KARAZEH_OPERATION_H
22 #define H_KARAZEH_OPERATION_H
23 
24 #include "karazeh_export.h"
25 #include "karazeh/karazeh.hpp"
26 #include "karazeh/config.hpp"
27 #include "karazeh/downloader.hpp"
28 #include "karazeh/file_manager.hpp"
29 
30 namespace kzh {
31  struct release_manifest;
32 
33  enum STAGE_RC {
34  STAGE_OK = 0,
45 
48  };
49 
51  public:
52  inline operation(config_t const& config, release_manifest const& rm)
53  : config_(config),
54  rm_(rm)
55  {}
56 
57  inline virtual ~operation() {}
58 
69  virtual STAGE_RC stage() = 0;
70 
79  virtual STAGE_RC deploy() = 0;
80 
89  virtual void rollback() = 0;
90 
102  inline virtual void commit() {};
103 
105  inline virtual string_t tostring() { return ""; }
106 
107  protected:
110  };
111 
112 } // end of namespace kzh
113 
114 #endif
Definition: operation.hpp:44
STAGE_RC
Definition: operation.hpp:33
Definition: operation.hpp:36
Definition: operation.hpp:50
Definition: operation.hpp:34
Definition: operation.hpp:38
config_t const & config_
Definition: operation.hpp:108
virtual string_t tostring()
Definition: operation.hpp:105
std::string string_t
Definition: karazeh.hpp:55
Definition: config.hpp:32
operation(config_t const &config, release_manifest const &rm)
Definition: operation.hpp:52
release_manifest const & rm_
Definition: operation.hpp:109
Definition: release_manifest.hpp:32
Definition: operation.hpp:40
Definition: operation.hpp:42
virtual ~operation()
Definition: operation.hpp:57
virtual void commit()
Definition: operation.hpp:102
Definition: operation.hpp:47
Definition: config.hpp:27