3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

added Z3_global_param_reset_all API

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2012-12-04 11:55:12 -08:00
parent 7d24cd4ae3
commit 92a29b1e43
7 changed files with 56 additions and 71 deletions

View file

@ -60,20 +60,22 @@ public:
}
~imp() {
{
dictionary<param_descrs*>::iterator it = m_module_param_descrs.begin();
dictionary<param_descrs*>::iterator end = m_module_param_descrs.end();
for (; it != end; ++it) {
dealloc(it->m_value);
}
reset();
dictionary<param_descrs*>::iterator it = m_module_param_descrs.begin();
dictionary<param_descrs*>::iterator end = m_module_param_descrs.end();
for (; it != end; ++it) {
dealloc(it->m_value);
}
{
dictionary<params_ref*>::iterator it = m_module_params.begin();
dictionary<params_ref*>::iterator end = m_module_params.end();
for (; it != end; ++it) {
dealloc(it->m_value);
}
}
void reset() {
m_params.reset();
dictionary<params_ref*>::iterator it = m_module_params.begin();
dictionary<params_ref*>::iterator end = m_module_params.end();
for (; it != end; ++it) {
dealloc(it->m_value);
}
m_module_params.reset();
}
// -----------------------------------------------
@ -448,6 +450,11 @@ public:
gparams::imp * gparams::g_imp = 0;
void gparams::reset() {
SASSERT(g_imp != 0);
g_imp->reset();
}
void gparams::set(char const * name, char const * value) {
TRACE("gparams", tout << "setting [" << name << "] <- '" << value << "'\n";);
SASSERT(g_imp != 0);

View file

@ -27,6 +27,11 @@ class gparams {
public:
typedef default_exception exception;
/**
\brief Reset all global and module parameters.
*/
static void reset();
/**
\brief Set a global parameter \c name with \c value.