00001 #ifndef SAGA_PACKAGES_CPR_CPRJOB_HPP
00002 #define SAGA_PACKAGES_CPR_CPRJOB_HPP
00003
00004 #if defined(__WAVE__) && defined(SAGA_CREATE_PREPROCESSED_FILES)
00005 #pragma wave option(preserve: 2, line: 1, output: "preprocessed/cpr_job.hpp")
00006 #endif
00007
00008
00009
00010
00011
00012
00013
00014 #if defined(__WAVE__) && defined(SAGA_CREATE_PREPROCESSED_FILES)
00015 #pragma wave option(output: null)
00016 #endif
00017
00018 #include <string>
00019 #include <vector>
00020 #include <iosfwd>
00021
00022
00023 #include <saga/saga/util.hpp>
00024 #include <saga/saga/base.hpp>
00025 #include <saga/saga/types.hpp>
00026 #include <saga/saga/session.hpp>
00027 #include <saga/saga/call.hpp>
00028 #include <saga/saga/job.hpp>
00029
00030 #include <saga/saga/packages/cpr/config.hpp>
00031
00032 #include <saga/saga/detail/attribute.hpp>
00033 #include <saga/saga/detail/permissions.hpp>
00034
00035
00036 #if defined(BOOST_MSVC)
00037 #pragma warning(push)
00038 #pragma warning(disable: 4251 4231 4275 4660)
00039 #endif
00040
00041 #ifdef SAGA_DEBUG
00042 #include <saga/saga/packages/cpr/preprocessed/cpr_job.hpp>
00043 #else
00044
00045 #if defined(__WAVE__) && defined(SAGA_CREATE_PREPROCESSED_FILES)
00046 #pragma wave option(preserve: 2, line: 1, output: "preprocessed/cpr_job.hpp")
00047 #endif
00049 namespace saga
00050 {
00055 namespace cpr {
00056
00060 namespace attributes
00061 {
00062
00063 }
00064
00073 namespace metrics
00074 {
00077 char const* const checkpoint = "cpr_job.Checkpoint";
00078
00081 char const* const checkpointed = "cpr_job.Checkpointed";
00082
00085 char const* const recover = "cpr_job.Recover";
00086
00089 char const* const recovered = "cpr_job.Recovered";
00090 }
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101 enum state
00102 {
00103 Unknown = saga::job::Unknown,
00104 New = saga::job::New,
00105 Running = saga::job::Running,
00106 Failed = saga::job::Failed,
00107 Done = saga::job::Done,
00108 Canceled = saga::job::Canceled,
00109 Suspended = saga::job::Suspended,
00110 Checkpointing = 6,
00111 Recovering = 7
00112 };
00113
00118 class SAGA_CPR_PACKAGE_EXPORT job
00119 : public saga::job::job
00120 {
00121 private:
00122 friend struct saga::detail::attribute<job>;
00123 friend struct saga::detail::permissions<job>;
00124
00126
00127 SAGA_CALL_PRIV_1 (checkpoint, saga::url)
00128 SAGA_CALL_PRIV_1 (recover, saga::url)
00129
00130 SAGA_CALL_PRIV_1 (cpr_stage_in, saga::url)
00131 SAGA_CALL_PRIV_1 (cpr_stage_out, saga::url)
00132
00133 SAGA_CALL_PRIV_0 (cpr_last)
00134 SAGA_CALL_PRIV_0 (cpr_list)
00136
00137 protected:
00139
00140 typedef saga::detail::attribute<job> attribute_base;
00141 TR1::shared_ptr <saga::impl::cpr_job> get_impl (void) const;
00142 explicit job (saga::impl::cpr_job *);
00144
00145 public:
00150 job();
00151
00156 explicit job (saga::object const& o);
00157
00162 ~job();
00163
00168 job &operator= (saga::object const& o);
00169
00175 void checkpoint (saga::url u = saga::url ())
00176 {
00177 checkpointpriv (u, saga::task_base::Sync());
00178 }
00180 SAGA_CALL_PUB_1_DEF_1 (checkpoint, saga::url, saga::url ())
00182
00188 void recover (saga::url u = saga::url ())
00189 {
00190 recoverpriv (u, saga::task_base::Sync());
00191 }
00193 SAGA_CALL_PUB_1_DEF_1 (recover, saga::url, saga::url ())
00195
00201 void cpr_stage_in (saga::url u = saga::url ())
00202 {
00203 cpr_stage_inpriv (u, saga::task_base::Sync());
00204 }
00206 SAGA_CALL_PUB_1_DEF_1 (cpr_stage_in, saga::url, saga::url ())
00208
00214 void cpr_stage_out (saga::url u = saga::url ())
00215 {
00216 cpr_stage_outpriv (u, saga::task_base::Sync());
00217 }
00219 SAGA_CALL_PUB_1_DEF_1 (cpr_stage_out, saga::url, saga::url ())
00221
00227 std::vector <saga::url> cpr_list (void)
00228 {
00229 saga::task t = cpr_listpriv(saga::task_base::Sync());
00230 return t.get_result <std::vector <saga::url> > ();
00231 }
00233 SAGA_CALL_PUB_0_DEF_0 (cpr_list)
00235
00241 saga::url cpr_last (void)
00242 {
00243 saga::task t = cpr_lastpriv(saga::task_base::Sync());
00244 return t.get_result <saga::url> ();
00245 }
00247 SAGA_CALL_PUB_0_DEF_0 (cpr_last)
00249 };
00250
00251 }
00252 }
00253
00254 #if defined(__WAVE__) && defined(SAGA_CREATE_PREPROCESSED_FILES)
00255 #pragma wave option(output: null)
00256 #endif
00257
00258 #endif // !defined(SAGA_DEBUG)
00259
00260
00261 #if defined(BOOST_MSVC)
00262 #pragma warning(pop)
00263 #endif
00264
00265 #endif // !defined(SAGA_PACKAGES_CPR_CPRJOB_HPP)
00266