ParameterSystem: add function to query if registration is open

This commit is contained in:
Arne Morten Kvarving 2024-09-04 18:50:12 +02:00
parent 0cda471821
commit 3161b4f547
3 changed files with 12 additions and 1 deletions

View File

@ -454,6 +454,11 @@ void reset()
MetaData::clear(); MetaData::clear();
} }
bool IsRegistrationOpen()
{
return MetaData::registrationOpen();
}
void endRegistration() void endRegistration()
{ {
if (!MetaData::registrationOpen()) { if (!MetaData::registrationOpen()) {

View File

@ -393,6 +393,12 @@ void Hide()
detail::Hide_(detail::getParamName<Param>()); detail::Hide_(detail::getParamName<Param>());
} }
/*!
* \brief Query whether parameter registration is open or not.
* \return True if registration is open, false otherwise
*/
bool IsRegistrationOpen();
/*! /*!
* \brief Indicate that all parameters are registered for a given type tag. * \brief Indicate that all parameters are registered for a given type tag.
* *

View File

@ -84,7 +84,7 @@ namespace Opm {
// Read the command line parameters. Throws an exception if something goes wrong. // Read the command line parameters. Throws an exception if something goes wrong.
static int setupParameters_(int argc, char** argv, Parallel::Communication comm) static int setupParameters_(int argc, char** argv, Parallel::Communication comm)
{ {
if (!Parameters::MetaData::registrationOpen()) { if (!Parameters::IsRegistrationOpen()) {
// We have already successfully run setupParameters_(). // We have already successfully run setupParameters_().
// For the dynamically chosen runs (as from the main flow // For the dynamically chosen runs (as from the main flow
// executable) we must run this function again with the // executable) we must run this function again with the