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
00057 class namespace_entry;
00058 class namespace_dir;
00059
00060 class directory;
00061 class file;
00062 class const_iovec;
00063 class iovec;
00064
00065 class logical_directory;
00066 class logical_file;
00067
00068 class advert;
00069 class advert_directory;
00070
00071 class rpc;
00072 class parameter;
00073
00074 class stream;
00075 class server;
00076
00077 class job;
00078 class self;
00079 class job_service;
00080 class description;
00081 class istream_interface;
00082 class ostream_interface;
00083
00084 class service_description;
00085 class service_data;
00086 class discoverer;
00087
00088 class cpr_job;
00089 class cpr_job_service;
00090 class cpr_checkpoint;
00091 class cpr_directory;
00092 class cpr_job_description;
00093
00094 class metric;
00095
00096
00097
00098 class adaptor_selector;
00099
00100 class proxy;
00101
00102 namespace v1_0
00103 {
00104 class cpi;
00105 class cpi_info;
00106 class op_info;
00107 }
00108
00109
00110 class attribute;
00111 class monitorable;
00112 class steerable;
00113 struct task_interface;
00114
00115
00116 class exception_list;
00117
00118
00119 struct void_t {};
00120
00121 }
00122
00124
00125
00126
00128
00129 SAGA_EXPORT char* safe_getenv(const char *);
00131
00132 }
00133
00135
00137
00138
00139
00140
00141 #ifdef SAGA_LOG_FACILITY
00142 # define SAGA_VERBOSE_LOG_FACILITY SAGA_LOG_FACILITY
00143 #else
00144 # define SAGA_VERBOSE_LOG_FACILITY __FILE__
00145 #endif
00146
00148 #define SAGA_VERBOSE(x) \
00149 if ( NULL != saga::safe_getenv ("SAGA_VERBOSE") && \
00150 x <= atoi (saga::safe_getenv ("SAGA_VERBOSE")) ) \
00151
00152
00153 #define SAGA_LOG(level,msg) \
00154 SAGA_VERBOSE (level) \
00155 { \
00156 fprintf (stderr, "%-10s : %-25s : %s\n", \
00157 level ## _MSG, SAGA_VERBOSE_LOG_FACILITY, msg); \
00158 } \
00159
00160
00161 #define SAGA_LOG_ALWAYS(msg) \
00162 SAGA_LOG (SAGA_VERBOSE_LEVEL_ALWAYS,msg) \
00163
00164
00165 #define SAGA_LOG_CRITICAL(msg) \
00166 SAGA_LOG (SAGA_VERBOSE_LEVEL_CRITICAL,msg) \
00167
00168
00169 #define SAGA_LOG_ERROR(msg) \
00170 SAGA_LOG (SAGA_VERBOSE_LEVEL_ERROR,msg) \
00171
00172
00173 #define SAGA_LOG_WARN(msg) \
00174 SAGA_LOG (SAGA_VERBOSE_LEVEL_WARNING,msg) \
00175
00176
00177 #define SAGA_LOG_INFO(msg) \
00178 SAGA_LOG (SAGA_VERBOSE_LEVEL_INFO,msg) \
00179
00180
00181 #define SAGA_LOG_DEBUG(msg) \
00182 SAGA_LOG (SAGA_VERBOSE_LEVEL_DEBUG,msg) \
00183
00184
00185 #define SAGA_LOG_BLURB(msg) \
00186 SAGA_LOG (SAGA_VERBOSE_LEVEL_BLURB,msg) \
00187
00188
00189 char const* const SAGA_VERBOSE_LEVEL_ALWAYS_MSG = "LOG";
00190 char const* const SAGA_VERBOSE_LEVEL_CRITICAL_MSG = "CRITICAL";
00191 char const* const SAGA_VERBOSE_LEVEL_ERROR_MSG = "ERROR";
00192 char const* const SAGA_VERBOSE_LEVEL_WARNING_MSG = "WARNING";
00193 char const* const SAGA_VERBOSE_LEVEL_INFO_MSG = "INFO";
00194 char const* const SAGA_VERBOSE_LEVEL_DEBUG_MSG = "DEBUG";
00195 char const* const SAGA_VERBOSE_LEVEL_BLURB_MSG = "BLURB";
00196
00197 #define SAGA_VERBOSE_LEVEL_ALWAYS 0
00198 #define SAGA_VERBOSE_LEVEL_CRITICAL 1
00199 #define SAGA_VERBOSE_LEVEL_ERROR 2
00200 #define SAGA_VERBOSE_LEVEL_WARNING 3
00201 #define SAGA_VERBOSE_LEVEL_INFO 4
00202 #define SAGA_VERBOSE_LEVEL_DEBUG 5
00203 #define SAGA_VERBOSE_LEVEL_BLURB 6
00204
00206
00207
00208 #ifdef BOOST_NO_STRINGSTREAM
00209 # include <strstream>
00210 inline std::string SAGA_OSSTREAM_GETSTRING (std::ostrstream & ss)
00211 {
00212 ss << std::ends;
00213 std::string rval = ss.str ();
00214 ss.freeze (false);
00215 return (rval);
00216 }
00217 # define SAGA_OSSTREAM std::ostrstream
00218 # define SAGA_ISSTREAM std::istrstream
00219 #else
00220 # include <sstream>
00221 # define SAGA_OSSTREAM_GETSTRING(ss) ss.str()
00222 # define SAGA_OSSTREAM std::ostringstream
00223 # define SAGA_ISSTREAM std::istringstream
00224 #endif
00225
00227 #if defined(__AIX__) && defined(__GNUC__)
00228
00229
00230 extern "C" {
00231 void _GLOBAL__DI();
00232 void _GLOBAL__DD();
00233 }
00234 #endif
00235
00236 #endif // SAGA_IMPL_ENGINE_BASE_HPP
00237
00238