ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
ek/Container.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2026 The ESPResSo project
3 *
4 * This file is part of ESPResSo.
5 *
6 * ESPResSo is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * ESPResSo is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include <config/config.hpp>
23
27
28#include <memory>
29#include <optional>
30#include <string>
31
33
34class Container : public AutoParameters<Container, System::Leaf> {
35public:
38 {"solver",
39 [](Variant const &v) {
40 if (not is_none(v)) {
41 throw WriteError("solver");
42 }
43 },
44 []() { return Variant{None{}}; }},
45 });
46 }
47};
48
49} // namespace ScriptInterface::EK
Bind parameters in the script interface.
void add_parameters(std::vector< AutoParameter > &&params)
Type to indicate no value in Variant.
Definition None.hpp:32
constexpr bool is_none(Variant const &v)
Definition Variant.hpp:163
T get_value(Variant const &v)
Extract value of specific type T from a Variant.
Recursive variant implementation.
Definition Variant.hpp:84