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
00065
00074 namespace metrics
00075 {
00078 char const* const checkpoint = "cpr_job.Checkpoint";
00079
00082 char const* const checkpointed = "cpr_job.Checkpointed";
00083
00086 char const* const recover = "cpr_job.Recover";
00087
00090 char const* const recovered = "cpr_job.Recovered";
00091 }
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102 enum state
00103 {
00104 Unknown = saga::job::Unknown,
00105 New = saga::job::New,
00106 Running = saga::job::Running,
00107 Failed = saga::job::Failed,
00108 Done = saga::job::Done,
00109 Canceled = saga::job::Canceled,
00110 Suspended = saga::job::Suspended,
00111 Checkpointing = 6,
00112 Recovering = 7
00113 };
00114
00115
00120 class SAGA_CPR_PACKAGE_EXPORT job
00121 : public saga::job::job
00122 {
00123 private:
00124 friend struct detail::attribute<job>;
00125 friend struct detail::permissions<job>;
00126
00127
00129
00130 SAGA_CALL_PRIV_1 (checkpoint, saga::url);
00131 SAGA_CALL_PRIV_1 (recover, saga::url);
00132
00133 SAGA_CALL_PRIV_1 (cpr_stage_in, saga::url);
00134 SAGA_CALL_PRIV_1 (cpr_stage_out, saga::url);
00135
00136 SAGA_CALL_PRIV_0 (cpr_last);
00137 SAGA_CALL_PRIV_0 (cpr_list);
00139
00140
00141 protected:
00143
00144 typedef detail::attribute<job> attribute_base;
00145 TR1::shared_ptr <saga::impl::cpr_job> get_impl (void) const;
00146 explicit job (saga::impl::cpr_job *);
00148
00149 public:
00154 job();
00155
00160 explicit job (saga::object const& o);
00161
00166 ~job();
00167
00172 job &operator= (saga::object const& o);
00173
00174
00180 void checkpoint (saga::url u = saga::url ())
00181 {
00182 checkpointpriv (u, saga::task_base::Sync());
00183 }
00185 SAGA_CALL_PUB_1_DEF_1 (checkpoint, saga::url, saga::url ());
00187
00193 void recover (saga::url u = saga::url ())
00194 {
00195 recoverpriv (u, saga::task_base::Sync());
00196 }
00198 SAGA_CALL_PUB_1_DEF_1 (recover, saga::url, saga::url ());
00200
00201
00207 void cpr_stage_in (saga::url u = saga::url ())
00208 {
00209 cpr_stage_inpriv (u, saga::task_base::Sync());
00210 }
00212 SAGA_CALL_PUB_1_DEF_1 (cpr_stage_in, saga::url, saga::url ());
00214
00220 void cpr_stage_out (saga::url u = saga::url ())
00221 {
00222 cpr_stage_outpriv (u, saga::task_base::Sync());
00223 }
00225 SAGA_CALL_PUB_1_DEF_1 (cpr_stage_out, saga::url, saga::url ());
00227
00228
00234 std::vector <saga::url> cpr_list (void)
00235 {
00236 saga::task t = cpr_listpriv(saga::task_base::Sync());
00237 return t.get_result <std::vector <saga::url> > ();
00238 }
00240 SAGA_CALL_PUB_0_DEF_0 (cpr_list);
00242
00248 saga::url cpr_last (void)
00249 {
00250 saga::task t = cpr_lastpriv(saga::task_base::Sync());
00251 return t.get_result <saga::url> ();
00252 }
00254 SAGA_CALL_PUB_0_DEF_0 (cpr_last);
00256
00257
00258 };
00259
00260 }
00261 }
00262
00263 #if defined(__WAVE__) && defined(SAGA_CREATE_PREPROCESSED_FILES)
00264 #pragma wave option(output: null)
00265 #endif
00266
00267 #endif // !defined(SAGA_DEBUG)
00268
00269
00270 #if defined(BOOST_MSVC)
00271 #pragma warning(pop)
00272 #endif
00273
00274 #endif // !defined(SAGA_PACKAGES_CPR_CPRJOB_HPP)
00275