problem_handler.cc

来自「由matlab开发的hybrid系统的描述语言」· CC 代码 · 共 56 行

CC
56
字号
#include "Problem_handler.h"#include "Problem.h"#include "Globals.h"#include "Cmd_options.h"Problem_handler::Problem_handler(ostream & o, const Globals * glob) : out(o) {	globals = glob;}Problem_handler::~Problem_handler() {	out.flush();}int Problem_handler::warnlevel_to_verboselevel(warning_type w) const {	switch (w) {		case SYMBOL_NOT_USED:			return 1;		case VAR_NOT_DEFINED:			return 1;		case MATH_SINGULAR:			return 1;		case BOUND_NOT_TIGHT:			return 2;		case BOUNDS_ORDER:			return 1;	}	assert(0); //fine	return -1;}void Problem_handler::process(Problem * p) {	if (p->get_type() == ERROR ||		(p->get_type() == WARNING &&		warnlevel_to_verboselevel(p->get_level()) <=		globals->cmd_options->get_verbose())) {			out << p->to_string();			if (p->terminate()) {				out.flush();				delete p;				exit(1);			} else delete p;	} else //suppress warning		delete p;}string Problem_handler::notify_us() const {	string res;	res += "please contact torrisi@aut.ee.ethz.ch for an updated version\n";	return res;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?