1 # ifndef CPPAD_UTILITY_ERROR_HANDLER_HPP
2 # define CPPAD_UTILITY_ERROR_HANDLER_HPP
128 # include <cppad/configure.hpp>
136 template <
class Base>
140 (bool, int,
const char *,
const char *,
const char *);
147 const char* file = __FILE__;
148 const char*
exp =
"! local::set_get_in_parallel(0)";
150 "Using ErrorHandler constructor in parallel mode.";
151 Call(known, line, file, exp, msg);
161 const char* file = __FILE__;
162 const char*
exp =
"! local::set_get_in_parallel(0)";
164 "Using ErrorHandler destructor in parallel mode.";
165 Call(known, line, file, exp, msg);
178 handler(known, line, file, exp, msg);
194 cerr << CPPAD_PACKAGE_STRING;
196 cerr <<
" error from a known source:" << endl;
197 else cerr <<
" error from unknown source" << endl;
200 cerr <<
"Error detected by false result for" << endl;
201 cerr <<
" " << exp << endl;
202 cerr <<
"at line " << line <<
" in the file " << endl;
203 cerr <<
" " << file << endl;
214 {
static bool first_call =
true;
218 {
bool known =
false;
220 const char* file = __FILE__;
221 const char*
exp =
"";
222 const char* msg =
"";
223 Call(known, line, file, exp, msg);
ErrorHandler(Handler handler)
static void Default(bool known, int line, const char *file, const char *exp, const char *msg)
static bool set_get_in_parallel(bool(*in_parallel_new)(void), bool set=false)
Set and call the routine that determine if we are in parallel execution mode.
AD< Base > exp(const AD< Base > &x)
static void Call(bool known, int line, const char *file, const char *exp, const char *msg)
File used to set and get user in_parallel routine.
friend void parallel_ad(void)
Enable parallel execution mode with AD<Base> by initializing static variables that my be used...
static Handler & Current(void)
void(* Handler)(bool, int, const char *, const char *, const char *)