Revision 67881291c25c1f3ad3ee7a76ffd13fd9d38a540d authored by Lars Bilke on 26 April 2021, 08:11:55 UTC, committed by Lars Bilke on 26 April 2021, 08:11:55 UTC
Fix build without XDMF.

See merge request ogs/ogs!3591
2 parent s 0b3c1da + 8617adc
Raw File
Utils.cpp
/**
 * \file
 * \copyright
 * Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 *
 */

#include "Utils.h"

namespace ParameterLib
{
ParameterBase* findParameterByName(
    std::string const& parameter_name,
    std::vector<std::unique_ptr<ParameterBase>> const& parameters)
{
    // Find corresponding parameter by name.
    auto const it = std::find_if(
        parameters.cbegin(), parameters.cend(),
        [&parameter_name](std::unique_ptr<ParameterBase> const& p) {
            return p->name == parameter_name;
        });

    if (it == parameters.end())
    {
        return nullptr;
    }

    DBUG("Found parameter `{:s}'.", (*it)->name);
    return it->get();
}
}  // namespace ParameterLib
back to top