Branch data Line data Source code
1 : : // Copyright 2026 HPActor Contributors
2 : : //
3 : : // Licensed under the Apache License, Version 2.0 (the "License");
4 : : // you may not use this file except in compliance with the License.
5 : : // You may obtain a copy of the License at
6 : : //
7 : : // http://www.apache.org/licenses/LICENSE-2.0
8 : : //
9 : : // Unless required by applicable law or agreed to in writing, software
10 : : // distributed under the License is distributed on an "AS IS" BASIS,
11 : : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 : : // See the License for the specific language governing permissions and
13 : : // limitations under the License.
14 : :
15 : : #pragma once
16 : :
17 : : #include <hpactor/config/toml_file_data.hpp>
18 : : #include <hpactor/config/toml_parse_context.hpp>
19 : : #include <hpactor/config/toml_table_view.hpp>
20 : : #include <hpactor/types/types.hpp>
21 : :
22 : : #include <string_view>
23 : :
24 : : namespace hpactor::config {
25 : :
26 : : class ITomlSystemConfigParser {
27 : : public:
28 : 336 : virtual ~ITomlSystemConfigParser() = default;
29 : :
30 : : virtual std::string_view name() const noexcept = 0;
31 : : virtual int order() const noexcept = 0;
32 : : virtual result<void> parse(const TomlTableView& system, SystemDef& out,
33 : : TomlParseContext& ctx) const = 0;
34 : : };
35 : :
36 : : class ITomlDocumentConfigParser {
37 : : public:
38 : 37 : virtual ~ITomlDocumentConfigParser() = default;
39 : :
40 : : virtual std::string_view name() const noexcept = 0;
41 : : virtual int order() const noexcept = 0;
42 : : virtual result<void> parse(const TomlTableView& root, TomlFileData& out,
43 : : TomlParseContext& ctx) const = 0;
44 : : };
45 : :
46 : : } // namespace hpactor::config
|