20 #include "callstack.h"
23 #include "exceptions.h"
25 #include <xercesc/util/PlatformUtils.hpp>
27 using namespace xercesc;
36 this->default_val = default_val;
37 this->user_set =
false;
42 signal(SIGABRT, CallStack::dump);
43 signal(SIGFPE, CallStack::dump);
44 signal(SIGILL, CallStack::dump);
45 signal(SIGSEGV, CallStack::dump);
46 signal(SIGTERM, CallStack::dump);
49 XMLPlatformUtils::Initialize();
54 ss << H2D_PRECALCULATED_FORMS_DIRECTORY;
55 if(ss.str().at(ss.str().length() - 1) ==
'\\' || ss.str().at(ss.str().length() - 1) ==
'/')
63 XMLPlatformUtils::Terminate();
68 for(std::map<Hermes2DApiParam, Parameter<std::string>*>::const_iterator it = this->text_parameters.begin(); it != this->text_parameters.end(); ++it)
71 for(std::map<Hermes2DApiParam, Parameter<int>*>::const_iterator it = this->integral_parameters.begin(); it != this->integral_parameters.end(); ++it)
75 int Api2D::get_integral_param_value(Hermes2DApiParam param)
77 if(this->integral_parameters.find(param) == integral_parameters.end())
78 throw Hermes::Exceptions::Exception(
"Wrong Hermes::Api parameter name:%i", param);
79 if(this->integral_parameters.find(param)->second->user_set)
80 return this->integral_parameters.find(param)->second->user_val;
82 return this->integral_parameters.find(param)->second->default_val;
85 void Api2D::set_integral_param_value(Hermes2DApiParam param,
int value)
87 if(this->integral_parameters.find(param) == integral_parameters.end())
88 throw Hermes::Exceptions::Exception(
"Wrong Hermes::Api parameter name:%i", param);
89 this->integral_parameters.find(param)->second->user_set =
true;
90 this->integral_parameters.find(param)->second->user_val = value;
93 std::string Api2D::get_text_param_value(Hermes2DApiParam param)
95 if(this->text_parameters.find(param) == text_parameters.end())
96 throw Hermes::Exceptions::Exception(
"Wrong Hermes::Api parameter name:%i", param);
97 if(this->text_parameters.find(param)->second->user_set)
98 return this->text_parameters.find(param)->second->user_val;
100 return this->text_parameters.find(param)->second->default_val;
103 void Api2D::set_text_param_value(Hermes2DApiParam param,
std::string value)
105 if(this->text_parameters.find(param) == text_parameters.end())
106 throw Hermes::Exceptions::Exception(
"Wrong Hermes::Api parameter name:%i", param);
107 this->text_parameters.find(param)->second->user_set =
true;
108 this->text_parameters.find(param)->second->user_val = value;