SAGA Adaptor CPI v.1.0
|
00001 // Copyright (c) 2005-2009 Hartmut Kaiser 00002 // Copyright (c) 2005-2007 Andre Merzky (andre@merzky.net) 00003 // Copyright (c) 2007 Ole Weidner (oweidner@cct.lsu.edu) 00004 // 00005 // Distributed under the Boost Software License, Version 1.0. (See accompanying 00006 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 00007 00008 #ifndef SAGA_SAGA_OBJECT_HPP 00009 #define SAGA_SAGA_OBJECT_HPP 00010 00011 #include <saga/saga/util.hpp> 00012 #include <saga/saga/base.hpp> 00013 #include <boost/mpl/bool.hpp> 00014 00015 // suppress warnings about dependent classes not being exported from the dll 00016 #if defined(BOOST_MSVC) 00017 #pragma warning(push) 00018 #pragma warning(disable: 4251 4231 4275 4660) 00019 #endif 00020 00022 // 00023 // SAGA spec: 00024 // 00025 // package saga.object 00026 // { 00027 // enum object_type 00028 // { 00029 // Exception = 1, 00030 // URL = 2, 00031 // Buffer = 3, 00032 // Session = 4, 00033 // Context = 5, 00034 // Task = 6, 00035 // TaskContainer = 7, 00036 // Metric = 8, 00037 // NSEntry = 9, 00038 // NSDirectory = 10, 00039 // IOVec = 11, 00040 // File = 12, 00041 // Directory = 13, 00042 // LogicalFile = 14, 00043 // LogicalDirectory = 15, 00044 // JobDescription = 16, 00045 // JobService = 17, 00046 // Job = 18, 00047 // JobSelf = 19, 00048 // StreamServer = 20, 00049 // Stream = 21, 00050 // Parameter = 22, 00051 // RPC = 23, 00052 // } 00053 // 00054 // interface object 00055 // { 00056 // get_id (out string id ); 00057 // get_type (out object_type type ); 00058 // get_session (out session session); 00059 // clone (out object clone ); 00060 // } 00061 // } 00062 00064 namespace saga 00065 { 00070 class SAGA_EXPORT object 00071 { 00072 public: 00073 00074 enum type 00075 { 00076 Unknown = -1, 00077 Exception = 1, 00078 URL = 2, 00079 Buffer = 3, 00080 Session = 4, 00081 Context = 5, 00082 Task = 6, 00083 TaskContainer = 7, 00084 Metric = 8, 00085 NSEntry = 9, 00086 NSDirectory = 10, 00087 IOVec = 11, 00088 File = 12, 00089 Directory = 13, 00090 LogicalFile = 14, 00091 LogicalDirectory = 15, 00092 JobDescription = 16, 00093 JobService = 17, 00094 Job = 18, 00095 JobSelf = 19, 00096 StreamServer = 20, 00097 Stream = 21, 00098 Parameter = 22, 00099 RPC = 23, 00100 00101 // SAGA Message API extension 00102 Msg = 24, 00103 Endpoint = 25, 00104 00105 // SAGA Information services extension 00106 Advert = 26, 00107 AdvertDirectory = 27, 00108 00109 // SAGA Service Discovery extension 00110 ServiceDescription = 28, 00111 ServiceDiscoverer = 29, 00112 ServiceData = 30, 00113 00114 // SAGA Checkpoint and Recovery extension 00115 CPRJobDescription = 31, 00116 CPRJobService = 32, 00117 CPRJob = 33, 00118 CPRJobSelf = 34, 00119 CPRCheckpoint = 35, 00120 CPRDirectory = 36, 00121 00122 // SAGA Information System Navigator extension 00123 EntityData = 37, 00124 EntityDataSet = 38, 00125 EntityNavigator = 39 00126 }; 00127 00128 private: 00130 00131 TR1::shared_ptr <saga::impl::object> impl_; 00132 00133 friend struct impl::runtime; 00134 friend class attribute; 00135 friend class adaptors::attribute; 00136 friend class monitorable; 00137 friend class permissions; 00139 00140 public: 00141 typedef saga::impl::object implementation_base_type; 00142 00143 protected: 00145 00146 TR1::shared_ptr<saga::impl::object> get_impl_sp (void) const 00147 { 00148 return impl_; 00149 } 00150 saga::impl::object* get_impl (void) const 00151 { 00152 return impl_.get(); 00153 } 00154 bool is_impl_valid() const 00155 { 00156 return impl_ ? true : false; 00157 } 00158 00159 explicit object (saga::impl::object * init); 00160 explicit object (TR1::shared_ptr<saga::impl::object> init); 00162 00163 public: 00168 object(); 00169 00174 saga::object::type get_type (void) const; 00175 00180 saga::uuid get_id (void) const; 00181 00186 saga::session& get_session(); 00187 saga::session const& get_session() const; 00188 00193 saga::object clone() const; 00194 00195 }; // object 00196 00198 00199 SAGA_EXPORT std::string get_object_type_name(saga::object::type t); 00201 00203 namespace detail 00204 { 00205 // meta function to tell whether T is a saga::object 00206 template <typename T> 00207 struct is_saga_object : TR1::is_base_of<saga::object, T> {}; 00208 00209 template <> 00210 struct is_saga_object<saga::object> : boost::mpl::true_ {}; 00211 } 00213 00214 } // namespace saga 00216 00217 // re-enable warnings about dependent classes not being exported from the dll 00218 #if defined(BOOST_MSVC) 00219 # pragma warning(pop) 00220 #endif 00221 00222 #endif // SAGA_SAGA_OBJECT_HPP 00223