00001
00002
00003
00004
00005
00006
00007
00008 #ifndef SAGA_IMPL_ENGINE_BASE_HPP
00009 #define SAGA_IMPL_ENGINE_BASE_HPP
00010
00011 #include <cstdlib>
00012 #include <cstddef>
00013
00014 #include <saga/saga/export_definitions.hpp>
00015
00017 #define SAGA_CPIVERSION_1_0 0x0100
00018 #define SAGA_CPIVERSION_MINORMASK 0x000F
00019 #define SAGA_CPIVERSION_LATEST SAGA_CPIVERSION_1_0
00020
00022
00024
00025 namespace saga
00026 {
00027 namespace adaptors
00028 {
00029 class task;
00030 class attribute;
00031 class metric;
00032 class exception;
00033 }
00034
00035
00036 namespace impl
00037 {
00038 struct runtime;
00039 struct job_runtime;
00040
00041 class url;
00042 class uuid;
00043 class const_buffer;
00044 class buffer;
00045
00046 class object;
00047 class session;
00048 class context;
00049 class attribute;
00050 class permissions;
00051 struct permissions_interface;
00052
00053 struct task_interface;
00054 class task_base;
00055 class task_container;
00056 class adaptor_selector_state;
00057
00058 class namespace_entry;
00059 class namespace_dir;
00060
00061 class directory;
00062 class file;
00063 class const_iovec;
00064 class iovec;
00065
00066 class logical_directory;
00067 class logical_file;
00068
00069 class advert;
00070 class advert_directory;
00071
00072 class rpc;
00073 class parameter;
00074
00075 class stream;
00076 class server;
00077
00078 class job;
00079 class self;
00080 class job_service;
00081 class description;
00082 class istream_interface;
00083 class ostream_interface;
00084
00085 class service_description;
00086 class service_data;
00087 class discoverer;
00088
00089 class cpr_job;
00090 class cpr_job_service;
00091 class cpr_checkpoint;
00092 class cpr_directory;
00093 class cpr_job_description;
00094
00095 class metric;
00096
00097
00098
00099 class adaptor_selector;
00100
00101 class proxy;
00102
00103 namespace v1_0
00104 {
00105 class cpi;
00106 class cpi_info;
00107 class op_info;
00108 }
00109
00110
00111 class attribute;
00112 class monitorable;
00113 class steerable;
00114 struct task_interface;
00115
00116
00117 class exception_list;
00118
00119
00120 struct void_t {};
00121
00122 }
00123
00125
00126
00127
00129
00130 SAGA_EXPORT char* safe_getenv(const char *);
00132
00133 }
00134
00136
00138
00139
00140
00141
00142 #ifdef SAGA_LOG_FACILITY
00143 # define SAGA_VERBOSE_LOG_FACILITY SAGA_LOG_FACILITY
00144 #else
00145 # define SAGA_VERBOSE_LOG_FACILITY __FILE__
00146 #endif
00147
00149 #define SAGA_VERBOSE(x) \
00150 if ( NULL != saga::safe_getenv ("SAGA_VERBOSE") && \
00151 x <= atoi (saga::safe_getenv ("SAGA_VERBOSE")) ) \
00152
00153
00154 #define SAGA_LOG(level,msg) \
00155 SAGA_VERBOSE (level) \
00156 { \
00157 fprintf (stderr, "%-10s : %-25s : %s\n", \
00158 level ## _MSG, SAGA_VERBOSE_LOG_FACILITY, msg); \
00159 } \
00160
00161
00162 #define SAGA_LOG_ALWAYS(msg) \
00163 SAGA_LOG (SAGA_VERBOSE_LEVEL_ALWAYS,msg) \
00164
00165
00166 #define SAGA_LOG_CRITICAL(msg) \
00167 SAGA_LOG (SAGA_VERBOSE_LEVEL_CRITICAL,msg) \
00168
00169
00170 #define SAGA_LOG_ERROR(msg) \
00171 SAGA_LOG (SAGA_VERBOSE_LEVEL_ERROR,msg) \
00172
00173
00174 #define SAGA_LOG_WARN(msg) \
00175 SAGA_LOG (SAGA_VERBOSE_LEVEL_WARNING,msg) \
00176
00177
00178 #define SAGA_LOG_INFO(msg) \
00179 SAGA_LOG (SAGA_VERBOSE_LEVEL_INFO,msg) \
00180
00181
00182 #define SAGA_LOG_DEBUG(msg) \
00183 SAGA_LOG (SAGA_VERBOSE_LEVEL_DEBUG,msg) \
00184
00185
00186 #define SAGA_LOG_BLURB(msg) \
00187 SAGA_LOG (SAGA_VERBOSE_LEVEL_BLURB,msg) \
00188
00189
00190 char const* const SAGA_VERBOSE_LEVEL_ALWAYS_MSG = "LOG";
00191 char const* const SAGA_VERBOSE_LEVEL_CRITICAL_MSG = "CRITICAL";
00192 char const* const SAGA_VERBOSE_LEVEL_ERROR_MSG = "ERROR";
00193 char const* const SAGA_VERBOSE_LEVEL_WARNING_MSG = "WARNING";
00194 char const* const SAGA_VERBOSE_LEVEL_INFO_MSG = "INFO";
00195 char const* const SAGA_VERBOSE_LEVEL_DEBUG_MSG = "DEBUG";
00196 char const* const SAGA_VERBOSE_LEVEL_BLURB_MSG = "BLURB";
00197
00198 #define SAGA_VERBOSE_LEVEL_ALWAYS 0
00199 #define SAGA_VERBOSE_LEVEL_CRITICAL 1
00200 #define SAGA_VERBOSE_LEVEL_ERROR 2
00201 #define SAGA_VERBOSE_LEVEL_WARNING 3
00202 #define SAGA_VERBOSE_LEVEL_INFO 4
00203 #define SAGA_VERBOSE_LEVEL_DEBUG 5
00204 #define SAGA_VERBOSE_LEVEL_BLURB 6
00205
00207
00208
00209 #ifdef BOOST_NO_STRINGSTREAM
00210 # include <strstream>
00211 inline std::string SAGA_OSSTREAM_GETSTRING (std::ostrstream & ss)
00212 {
00213 ss << std::ends;
00214 std::string rval = ss.str ();
00215 ss.freeze (false);
00216 return (rval);
00217 }
00218 # define SAGA_OSSTREAM std::ostrstream
00219 # define SAGA_ISSTREAM std::istrstream
00220 #else
00221 # include <sstream>
00222 # define SAGA_OSSTREAM_GETSTRING(ss) ss.str()
00223 # define SAGA_OSSTREAM std::ostringstream
00224 # define SAGA_ISSTREAM std::istringstream
00225 #endif
00226
00228 #if defined(__AIX__) && defined(__GNUC__)
00229
00230
00231 extern "C" {
00232 void _GLOBAL__DI();
00233 void _GLOBAL__DD();
00234 }
00235 #endif
00236
00237 #endif // SAGA_IMPL_ENGINE_BASE_HPP
00238
00239