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_sp(void) const;
00142 saga::impl::cpr_job* get_impl (void) const;
00143 explicit job (saga::impl::cpr_job *);
00145
00146 public:
00151 job();
00152
00157 explicit job (saga::object const& o);
00158
00163 ~job();
00164
00169 job &operator= (saga::object const& o);
00170
00176 void checkpoint (saga::url u = saga::url ())
00177 {
00178 checkpointpriv (u, saga::task_base::Sync());
00179 }
00181 SAGA_CALL_PUB_1_DEF_1 (checkpoint, saga::url, saga::url ())
00183
00189 void recover (saga::url u = saga::url ())
00190 {
00191 recoverpriv (u, saga::task_base::Sync());
00192 }
00194 SAGA_CALL_PUB_1_DEF_1 (recover, saga::url, saga::url ())
00196
00202 void cpr_stage_in (saga::url u = saga::url ())
00203 {
00204 cpr_stage_inpriv (u, saga::task_base::Sync());
00205 }
00207 SAGA_CALL_PUB_1_DEF_1 (cpr_stage_in, saga::url, saga::url ())
00209
00215 void cpr_stage_out (saga::url u = saga::url ())
00216 {
00217 cpr_stage_outpriv (u, saga::task_base::Sync());
00218 }
00220 SAGA_CALL_PUB_1_DEF_1 (cpr_stage_out, saga::url, saga::url ())
00222
00228 std::vector <saga::url> cpr_list (void)
00229 {
00230 saga::task t = cpr_listpriv(saga::task_base::Sync());
00231 return t.get_result <std::vector <saga::url> > ();
00232 }
00234 SAGA_CALL_PUB_0_DEF_0 (cpr_list)
00236
00242 saga::url cpr_last (void)
00243 {
00244 saga::task t = cpr_lastpriv(saga::task_base::Sync());
00245 return t.get_result <saga::url> ();
00246 }
00248 SAGA_CALL_PUB_0_DEF_0 (cpr_last)
00250 };
00251
00252 }
00253 }
00254
00255 #if defined(__WAVE__) && defined(SAGA_CREATE_PREPROCESSED_FILES)
00256 #pragma wave option(output: null)
00257 #endif
00258
00259 #endif // !defined(SAGA_DEBUG)
00260
00261
00262 #if defined(BOOST_MSVC)
00263 #pragma warning(pop)
00264 #endif
00265
00266 #endif // !defined(SAGA_PACKAGES_CPR_CPRJOB_HPP)
00267