This PR removes the next heavily specialized template function Options::operator[] in favor of direct access to the option data.
}
d_smtEngine.reset(new SmtEngine(d_nodeMgr.get(), d_originalOptions.get()));
d_smtEngine->setSolver(this);
- d_rng.reset(new Random(d_smtEngine->getOptions()[options::seed]));
+ d_rng.reset(new Random(d_smtEngine->getOptions().driver.seed));
resetStatistics();
}
NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK(!d_smtEngine->isQueryMade()
- || d_smtEngine->getOptions()[options::incrementalSolving])
+ || d_smtEngine->getOptions().smt.incrementalSolving)
<< "Cannot make multiple queries unless incremental solving is enabled "
"(try --incremental)";
CVC5_API_SOLVER_CHECK_TERM(term);
CVC5_API_TRY_CATCH_BEGIN;
NodeManagerScope scope(getNodeManager());
CVC5_API_CHECK(!d_smtEngine->isQueryMade()
- || d_smtEngine->getOptions()[options::incrementalSolving])
+ || d_smtEngine->getOptions().smt.incrementalSolving)
<< "Cannot make multiple queries unless incremental solving is enabled "
"(try --incremental)";
CVC5_API_SOLVER_CHECK_TERMS(terms);
CVC5_API_TRY_CATCH_BEGIN;
NodeManagerScope scope(getNodeManager());
CVC5_API_CHECK(!d_smtEngine->isQueryMade()
- || d_smtEngine->getOptions()[options::incrementalSolving])
+ || d_smtEngine->getOptions().smt.incrementalSolving)
<< "Cannot make multiple queries unless incremental solving is enabled "
"(try --incremental)";
//////// all checks before this line
CVC5_API_TRY_CATCH_BEGIN;
NodeManagerScope scope(getNodeManager());
CVC5_API_CHECK(!d_smtEngine->isQueryMade()
- || d_smtEngine->getOptions()[options::incrementalSolving])
+ || d_smtEngine->getOptions().smt.incrementalSolving)
<< "Cannot make multiple queries unless incremental solving is enabled "
"(try --incremental)";
CVC5_API_SOLVER_CHECK_TERM_WITH_SORT(assumption, getBooleanSort());
CVC5_API_TRY_CATCH_BEGIN;
NodeManagerScope scope(getNodeManager());
CVC5_API_CHECK(!d_smtEngine->isQueryMade() || assumptions.size() == 0
- || d_smtEngine->getOptions()[options::incrementalSolving])
+ || d_smtEngine->getOptions().smt.incrementalSolving)
<< "Cannot make multiple queries unless incremental solving is enabled "
"(try --incremental)";
CVC5_API_SOLVER_CHECK_TERMS_WITH_SORT(assumptions, getBooleanSort());
{
CVC5_API_TRY_CATCH_BEGIN;
NodeManagerScope scope(getNodeManager());
- CVC5_API_CHECK(d_smtEngine->getOptions()[options::incrementalSolving])
+ CVC5_API_CHECK(d_smtEngine->getOptions().smt.incrementalSolving)
<< "Cannot get unsat assumptions unless incremental solving is enabled "
"(try --incremental)";
- CVC5_API_CHECK(d_smtEngine->getOptions()[options::unsatAssumptions])
+ CVC5_API_CHECK(d_smtEngine->getOptions().smt.unsatAssumptions)
<< "Cannot get unsat assumptions unless explicitly enabled "
"(try --produce-unsat-assumptions)";
CVC5_API_CHECK(d_smtEngine->getSmtMode() == SmtMode::UNSAT)
{
CVC5_API_TRY_CATCH_BEGIN;
NodeManagerScope scope(getNodeManager());
- CVC5_API_CHECK(d_smtEngine->getOptions()[options::unsatCores])
+ CVC5_API_CHECK(d_smtEngine->getOptions().smt.unsatCores)
<< "Cannot get unsat core unless explicitly enabled "
"(try --produce-unsat-cores)";
CVC5_API_RECOVERABLE_CHECK(d_smtEngine->getSmtMode() == SmtMode::UNSAT)
{
CVC5_API_TRY_CATCH_BEGIN;
NodeManagerScope scope(getNodeManager());
- CVC5_API_RECOVERABLE_CHECK(d_smtEngine->getOptions()[options::produceModels])
+ CVC5_API_RECOVERABLE_CHECK(d_smtEngine->getOptions().smt.produceModels)
<< "Cannot get value unless model generation is enabled "
"(try --produce-models)";
CVC5_API_RECOVERABLE_CHECK(d_smtEngine->isSmtModeSat())
d_smtEngine->getLogicInfo().isTheoryEnabled(theory::THEORY_SEP))
<< "Cannot obtain separation logic expressions if not using the "
"separation logic theory.";
- CVC5_API_CHECK(d_smtEngine->getOptions()[options::produceModels])
+ CVC5_API_CHECK(d_smtEngine->getOptions().smt.produceModels)
<< "Cannot get separation heap term unless model generation is enabled "
"(try --produce-models)";
CVC5_API_RECOVERABLE_CHECK(d_smtEngine->isSmtModeSat())
d_smtEngine->getLogicInfo().isTheoryEnabled(theory::THEORY_SEP))
<< "Cannot obtain separation logic expressions if not using the "
"separation logic theory.";
- CVC5_API_CHECK(d_smtEngine->getOptions()[options::produceModels])
+ CVC5_API_CHECK(d_smtEngine->getOptions().smt.produceModels)
<< "Cannot get separation nil term unless model generation is enabled "
"(try --produce-models)";
CVC5_API_RECOVERABLE_CHECK(d_smtEngine->isSmtModeSat())
{
NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
- CVC5_API_CHECK(d_smtEngine->getOptions()[options::incrementalSolving])
+ CVC5_API_CHECK(d_smtEngine->getOptions().smt.incrementalSolving)
<< "Cannot pop when not solving incrementally (use --incremental)";
CVC5_API_CHECK(nscopes <= d_smtEngine->getNumUserLevels())
<< "Cannot pop beyond first pushed context";
{
NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
- CVC5_API_CHECK(d_smtEngine->getOptions()[options::produceModels])
+ CVC5_API_CHECK(d_smtEngine->getOptions().smt.produceModels)
<< "Cannot get value unless model generation is enabled "
"(try --produce-models)";
CVC5_API_RECOVERABLE_CHECK(d_smtEngine->isSmtModeSat())
{
NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
- CVC5_API_CHECK(d_smtEngine->getOptions()[options::produceModels])
+ CVC5_API_CHECK(d_smtEngine->getOptions().smt.produceModels)
<< "Cannot get value unless model generation is enabled "
"(try --produce-models)";
CVC5_API_RECOVERABLE_CHECK(d_smtEngine->isSmtModeSat())
{
NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
- CVC5_API_CHECK(d_smtEngine->getOptions()[options::incrementalSolving])
+ CVC5_API_CHECK(d_smtEngine->getOptions().smt.incrementalSolving)
<< "Cannot push when not solving incrementally (use --incremental)";
//////// all checks before this line
for (uint32_t n = 0; n < nscopes; ++n)
type operator()() const;
}} thread_local {name};"""
-TPL_DECL_OP_BRACKET = \
-"""template <> const options::{name}__option_t::type& Options::operator[](
- options::{name}__option_t) const;"""
-
-TPL_IMPL_OP_BRACKET = TPL_DECL_OP_BRACKET[:-1] + \
-"""
-{{
- return {module}.{name};
-}}"""
-
TPL_DECL_WAS_SET_BY_USER = \
"""template <> bool Options::wasSetByUser(options::{name}__option_t) const;"""
# Option specific methods
TPL_IMPL_OP_PAR = \
-"""inline {name}__option_t::type {name}__option_t::operator()() const
-{{
- return Options::current()[*this];
-}}"""
+"""inline {type} {name}__option_t::operator()() const
+{{ return Options::current().{module}.{name}; }}"""
# Mode templates
TPL_DECL_MODE_ENUM = \
# Generate module specialization
default_decl.append(TPL_DECL_SET_DEFAULT.format(module=module.id, name=option.name, funcname=capoptionname, type=option.type))
- specs.append(TPL_DECL_OP_BRACKET.format(name=option.name))
specs.append(TPL_DECL_WAS_SET_BY_USER.format(name=option.name))
if option.long and option.type not in ['bool', 'void'] and \
module.id, option.long, option.type))
# Generate module inlines
- inls.append(TPL_IMPL_OP_PAR.format(name=option.name))
+ inls.append(TPL_IMPL_OP_PAR.format(module=module.id, name=option.name, type=option.type))
### Generate code for {module.name}_options.cpp
# Accessors
default_impl.append(TPL_IMPL_SET_DEFAULT.format(module=module.id, name=option.name, funcname=capoptionname, type=option.type))
- accs.append(TPL_IMPL_OP_BRACKET.format(module=module.id, name=option.name))
accs.append(TPL_IMPL_WAS_SET_BY_USER.format(module=module.id, name=option.name))
# Global definitions
'if ({}) {{'.format(cond))
if option.type == 'bool':
getoption_handlers.append(
- 'return (*this)[options::{}] ? "true" : "false";'.format(option.name))
+ 'return options.{}.{} ? "true" : "false";'.format(module.id, option.name))
elif option.type == 'std::string':
getoption_handlers.append(
- 'return (*this)[options::{}];'.format(option.name))
+ 'return options.{}.{};'.format(module.id, option.name))
elif is_numeric_cpp_type(option.type):
getoption_handlers.append(
- 'return std::to_string((*this)[options::{}]);'.format(option.name))
+ 'return std::to_string(options.{}.{});'.format(module.id, option.name))
else:
getoption_handlers.append('std::stringstream ss;')
getoption_handlers.append(
- 'ss << (*this)[options::{}];'.format(option.name))
+ 'ss << options.{}.{};'.format(module.id, option.name))
getoption_handlers.append('return ss.str();')
getoption_handlers.append('}')
std::string Options::getOption(const std::string& key) const
{
Trace("options") << "Options::getOption(" << key << ")" << std::endl;
+ const Options& options = *this;
${getoption_handlers}$
throw UnrecognizedOptionException(key);
*/
void setOption(const std::string& key, const std::string& optionarg);
- /** Get the value of the given option. Const access only. */
- template <class T>
- const typename T::type& operator[](T) const;
-
/**
* Gets the value of the given option by key and returns value as a string.
*
const Printer& Env::getPrinter()
{
- return *Printer::getPrinter(d_options[options::outputLanguage]);
+ return *Printer::getPrinter(d_options.base.outputLanguage);
}
std::ostream& Env::getDumpOut() { return *d_options.base.out; }
/** Get a pointer to the underlying dump manager. */
smt::DumpManager* getDumpManager();
- template <typename Opt>
- const auto& getOption(Opt opt) const
- {
- return d_options[opt];
- }
-
/** Get the options object (const version only) owned by this Env. */
const Options& getOptions() const;
<< std::endl;
if (key == options::expr::defaultExprDepth__name)
{
- int depth = (*d_options)[options::defaultExprDepth];
+ int depth = d_options->expr.defaultExprDepth;
Debug.getStream() << expr::ExprSetDepth(depth);
Trace.getStream() << expr::ExprSetDepth(depth);
Notice.getStream() << expr::ExprSetDepth(depth);
}
else if (key == options::expr::defaultDagThresh__name)
{
- int dag = (*d_options)[options::defaultDagThresh];
+ int dag = d_options->expr.defaultDagThresh;
Debug.getStream() << expr::ExprDag(dag);
Trace.getStream() << expr::ExprDag(dag);
Notice.getStream() << expr::ExprDag(dag);
}
else if (key == options::smt::dumpModeString__name)
{
- const std::string& value = (*d_options)[options::dumpModeString];
+ const std::string& value = d_options->smt.dumpModeString;
Dump.setDumpFromString(value);
}
else if (key == options::base::printSuccess__name)
{
- bool value = (*d_options)[options::printSuccess];
+ bool value = d_options->base.printSuccess;
Debug.getStream() << Command::printsuccess(value);
Trace.getStream() << Command::printsuccess(value);
Notice.getStream() << Command::printsuccess(value);
}
// set the random seed
- Random::getRandom().setSeed(d_env->getOption(options::seed));
+ Random::getRandom().setSeed(d_env->getOptions().driver.seed);
// Call finish init on the options manager. This inializes the resource
// manager based on the options, and sets up the best default options
d_optm->finishInit(d_env->d_logic, d_isInternalSubsolver);
ProofNodeManager* pnm = nullptr;
- if (d_env->getOption(options::produceProofs))
+ if (d_env->getOptions().smt.produceProofs)
{
// ensure bound variable uses canonical bound variables
getNodeManager()->getBoundVarManager()->enableKeepCacheValues();
getDumpManager()->finishInit();
// subsolvers
- if (d_env->getOption(options::produceAbducts))
+ if (d_env->getOptions().smt.produceAbducts)
{
d_abductSolver.reset(new AbductionSolver(this));
}
- if (d_env->getOption(options::produceInterpols)
+ if (d_env->getOptions().smt.produceInterpols
!= options::ProduceInterpols::NONE)
{
d_interpolSolver.reset(new InterpolationSolver(this));
if (!Options::current().wasSetByUser(options::outputLanguage))
{
language::output::Language olang = language::toOutputLanguage(ilang);
- if (d_env->getOption(options::outputLanguage) != olang)
+ if (d_env->getOptions().base.outputLanguage != olang)
{
getOptions().base.outputLanguage = olang;
- *d_env->getOption(options::out) << language::SetLanguage(olang);
+ *d_env->getOptions().base.out << language::SetLanguage(olang);
}
}
}
Node func)
{
TypeNode formulaType =
- formula.getType(d_env->getOption(options::typeChecking));
+ formula.getType(d_env->getOptions().expr.typeChecking);
TypeNode funcType = func.getType();
// We distinguish here between definitions of constants and functions,
// because the type checking for them is subtly different. Perhaps we
Model* SmtEngine::getAvailableModel(const char* c) const
{
- if (!d_env->getOption(options::assignFunctionValues))
+ if (!d_env->getOptions().theory.assignFunctionValues)
{
std::stringstream ss;
ss << "Cannot " << c << " when --assign-function-values is false.";
throw RecoverableModalException(ss.str().c_str());
}
- if (!d_env->getOption(options::produceModels))
+ if (!d_env->getOptions().smt.produceModels)
{
std::stringstream ss;
ss << "Cannot " << c << " when produce-models options is off.";
<< "(" << assumptions << ") => " << r << endl;
// Check that SAT results generate a model correctly.
- if (d_env->getOption(options::checkModels))
+ if (d_env->getOptions().smt.checkModels)
{
if (r.asSatisfiabilityResult().isSat() == Result::SAT)
{
}
}
// Check that UNSAT results generate a proof correctly.
- if (d_env->getOption(options::checkProofs)
- || d_env->getOption(options::proofEagerChecking))
+ if (d_env->getOptions().smt.checkProofs
+ || d_env->getOptions().proof.proofEagerChecking)
{
if (r.asSatisfiabilityResult().isSat() == Result::UNSAT)
{
- if ((d_env->getOption(options::checkProofs)
- || d_env->getOption(options::proofEagerChecking))
- && !d_env->getOption(options::produceProofs))
+ if ((d_env->getOptions().smt.checkProofs
+ || d_env->getOptions().proof.proofEagerChecking)
+ && !d_env->getOptions().smt.produceProofs)
{
throw ModalException(
"Cannot check-proofs because proofs were disabled.");
}
}
// Check that UNSAT results generate an unsat core correctly.
- if (d_env->getOption(options::checkUnsatCores))
+ if (d_env->getOptions().smt.checkUnsatCores)
{
if (r.asSatisfiabilityResult().isSat() == Result::UNSAT)
{
{
Trace("smt") << "SMT getUnsatAssumptions()" << endl;
SmtScope smts(this);
- if (!d_env->getOption(options::unsatAssumptions))
+ if (!d_env->getOptions().smt.unsatAssumptions)
{
throw ModalException(
"Cannot get unsat assumptions when produce-unsat-assumptions option "
Assert(m->hasApproximations() || resultNode.getKind() == kind::LAMBDA
|| resultNode.isConst());
- if (d_env->getOption(options::abstractValues)
+ if (d_env->getOptions().smt.abstractValues
&& resultNode.getType().isArray())
{
resultNode = d_absValues->mkAbstractValue(resultNode);
Assert(te != nullptr);
te->setEagerModelBuilding();
- if (d_env->getOption(options::modelCoresMode)
+ if (d_env->getOptions().smt.modelCoresMode
!= options::ModelCoresMode::NONE)
{
// If we enabled model cores, we compute a model core for m based on our
std::vector<Node> eassertsProc = getExpandedAssertions();
ModelCoreBuilder::setModelCore(eassertsProc,
m->getTheoryModel(),
- d_env->getOption(options::modelCoresMode));
+ d_env->getOptions().smt.modelCoresMode);
}
// set the information on the SMT-level model
Assert(m != nullptr);
Model* m = getAvailableModel("block model");
- if (d_env->getOption(options::blockModelsMode)
+ if (d_env->getOptions().smt.blockModelsMode
== options::BlockModelsMode::NONE)
{
std::stringstream ss;
Node eblocker =
ModelBlocker::getModelBlocker(eassertsProc,
m->getTheoryModel(),
- d_env->getOption(options::blockModelsMode));
+ d_env->getOptions().smt.blockModelsMode);
Trace("smt") << "Block formula: " << eblocker << std::endl;
return assertFormula(eblocker);
}
void SmtEngine::checkProof()
{
- Assert(d_env->getOption(options::produceProofs));
+ Assert(d_env->getOptions().smt.produceProofs);
// internal check the proof
PropEngine* pe = getPropEngine();
Assert(pe != nullptr);
- if (d_env->getOption(options::proofEagerChecking))
+ if (d_env->getOptions().proof.proofEagerChecking)
{
pe->checkProof(d_asserts->getAssertionList());
}
Assert(pe->getProof() != nullptr);
std::shared_ptr<ProofNode> pePfn = pe->getProof();
- if (d_env->getOption(options::checkProofs))
+ if (d_env->getOptions().smt.checkProofs)
{
d_pfManager->checkProof(pePfn, *d_asserts);
}
UnsatCore SmtEngine::getUnsatCoreInternal()
{
- if (!d_env->getOption(options::unsatCores))
+ if (!d_env->getOptions().smt.unsatCores)
{
throw ModalException(
"Cannot get an unsat core when produce-unsat-cores or produce-proofs "
}
void SmtEngine::checkUnsatCore() {
- Assert(d_env->getOption(options::unsatCores))
+ Assert(d_env->getOptions().smt.unsatCores)
<< "cannot check unsat core if unsat cores are turned off";
Notice() << "SmtEngine::checkUnsatCore(): generating unsat core" << endl;
{
getPrinter().toStreamCmdGetProof(getOutputManager().getDumpOut());
}
- if (!d_env->getOption(options::produceProofs))
+ if (!d_env->getOptions().smt.produceProofs)
{
throw ModalException("Cannot get a proof when proof option is off.");
}
void SmtEngine::printInstantiations( std::ostream& out ) {
SmtScope smts(this);
finishInit();
- if (d_env->getOption(options::instFormatMode) == options::InstFormatMode::SZS)
+ if (d_env->getOptions().printer.instFormatMode == options::InstFormatMode::SZS)
{
out << "% SZS output start Proof for " << d_state->getFilename()
<< std::endl;
// First, extract and print the skolemizations
bool printed = false;
- bool reqNames = !d_env->getOption(options::printInstFull);
+ bool reqNames = !d_env->getOptions().printer.printInstFull;
// only print when in list mode
- if (d_env->getOption(options::printInstMode) == options::PrintInstMode::LIST)
+ if (d_env->getOptions().printer.printInstMode == options::PrintInstMode::LIST)
{
std::map<Node, std::vector<Node>> sks;
qe->getSkolemTermVectors(sks);
continue;
}
// must have a name
- if (d_env->getOption(options::printInstMode) == options::PrintInstMode::NUM)
+ if (d_env->getOptions().printer.printInstMode == options::PrintInstMode::NUM)
{
out << "(num-instantiations " << name << " " << i.second.size() << ")"
<< std::endl;
}
else
{
- Assert(d_env->getOption(options::printInstMode)
+ Assert(d_env->getOptions().printer.printInstMode
== options::PrintInstMode::LIST);
InstantiationList ilist(name, i.second);
out << ilist;
{
out << "No instantiations" << std::endl;
}
- if (d_env->getOption(options::instFormatMode) == options::InstFormatMode::SZS)
+ if (d_env->getOptions().printer.instFormatMode == options::InstFormatMode::SZS)
{
out << "% SZS output end Proof for " << d_state->getFilename() << std::endl;
}
{
SmtScope smts(this);
finishInit();
- if (d_env->getOption(options::produceProofs)
- && (!d_env->getOption(options::unsatCores)
- || d_env->getOption(options::unsatCoresMode) == options::UnsatCoresMode::FULL_PROOF)
+ if (d_env->getOptions().smt.produceProofs
+ && (!d_env->getOptions().smt.unsatCores
+ || d_env->getOptions().smt.unsatCoresMode == options::UnsatCoresMode::FULL_PROOF)
&& getSmtMode() == SmtMode::UNSAT)
{
// minimize instantiations based on proof manager
getPrinter().toStreamCmdGetAssertions(getOutputManager().getDumpOut());
}
Trace("smt") << "SMT getAssertions()" << endl;
- if (!d_env->getOption(options::produceAssertions))
+ if (!d_env->getOptions().smt.produceAssertions)
{
const char* msg =
"Cannot query the current assertion list when not in produce-assertions mode.";
d_infidWeights.fill(1);
d_resourceWeights.fill(1);
- for (const auto& opt : d_options[options::resourceWeightHolder])
+ for (const auto& opt : d_options.resman.resourceWeightHolder)
{
std::string name;
uint64_t weight;
uint64_t ResourceManager::getResourceRemaining() const
{
- if (d_options[options::cumulativeResourceLimit] <= d_cumulativeResourceUsed)
+ if (d_options.resman.cumulativeResourceLimit <= d_cumulativeResourceUsed)
return 0;
- return d_options[options::cumulativeResourceLimit] - d_cumulativeResourceUsed;
+ return d_options.resman.cumulativeResourceLimit - d_cumulativeResourceUsed;
}
void ResourceManager::spendResource(uint64_t amount)
void ResourceManager::beginCall()
{
- d_perCallTimer.set(d_options[options::perCallMillisecondLimit]);
+ d_perCallTimer.set(d_options.resman.perCallMillisecondLimit);
d_thisCallResourceUsed = 0;
- if (d_options[options::cumulativeResourceLimit] > 0)
+ if (d_options.resman.cumulativeResourceLimit > 0)
{
// Compute remaining cumulative resource budget
d_thisCallResourceBudget =
- d_options[options::cumulativeResourceLimit] - d_cumulativeResourceUsed;
+ d_options.resman.cumulativeResourceLimit - d_cumulativeResourceUsed;
}
- if (d_options[options::perCallResourceLimit] > 0)
+ if (d_options.resman.perCallResourceLimit > 0)
{
// Check if per-call resource budget is even smaller
- if (d_options[options::perCallResourceLimit] < d_thisCallResourceBudget)
+ if (d_options.resman.perCallResourceLimit < d_thisCallResourceBudget)
{
- d_thisCallResourceBudget = d_options[options::perCallResourceLimit];
+ d_thisCallResourceBudget = d_options.resman.perCallResourceLimit;
}
}
}
bool ResourceManager::limitOn() const
{
- return (d_options[options::cumulativeResourceLimit] > 0)
- || (d_options[options::perCallMillisecondLimit] > 0)
- || (d_options[options::perCallResourceLimit] > 0);
+ return (d_options.resman.cumulativeResourceLimit > 0)
+ || (d_options.resman.perCallMillisecondLimit > 0)
+ || (d_options.resman.perCallResourceLimit > 0);
}
bool ResourceManager::outOfResources() const
{
- if (d_options[options::perCallResourceLimit] > 0)
+ if (d_options.resman.perCallResourceLimit > 0)
{
// Check if per-call resources are exhausted
- if (d_thisCallResourceUsed >= d_options[options::perCallResourceLimit])
+ if (d_thisCallResourceUsed >= d_options.resman.perCallResourceLimit)
{
return true;
}
}
- if (d_options[options::cumulativeResourceLimit] > 0)
+ if (d_options.resman.cumulativeResourceLimit > 0)
{
// Check if cumulative resources are exhausted
- if (d_cumulativeResourceUsed >= d_options[options::cumulativeResourceLimit])
+ if (d_cumulativeResourceUsed >= d_options.resman.cumulativeResourceLimit)
{
return true;
}
bool ResourceManager::outOfTime() const
{
- if (d_options[options::perCallMillisecondLimit] == 0) return false;
+ if (d_options.resman.perCallMillisecondLimit == 0) return false;
return d_perCallTimer.expired();
}