Sen API
Sen Libraries
Toggle main menu visibility
Loading...
Searching...
No Matches
bootloader.h
Go to the documentation of this file.
1
// === bootloader.h ====================================================================================================
2
// Sen Infrastructure
3
// Released under the Apache License v2.0 (SPDX-License-Identifier Apache-2.0).
4
// See the LICENSE.txt file for more information.
5
// © Airbus SAS, Airbus Helicopters, and Airbus Defence and Space SAU/GmbH/SAS.
6
// =====================================================================================================================
7
8
#ifndef SEN_KERNEL_BOOTLOADER_H
9
#define SEN_KERNEL_BOOTLOADER_H
10
11
// sen
12
#include "
sen/core/base/class_helpers.h
"
13
#include "
sen/kernel/kernel.h
"
14
#include "
sen/kernel/kernel_config.h
"
15
16
// std
17
#include <filesystem>
18
#include <memory>
19
#include <string>
20
21
namespace
sen::kernel
22
{
23
27
[[nodiscard]]
VarMap
getConfigAsVarFromYaml
(
const
std::filesystem::path& path,
bool
printFinalConfig =
false
);
28
33
[[nodiscard]]
VarMap
getConfigAsVarFromYaml
(
const
std::string& content,
34
const
std::filesystem::path& path,
35
bool
printFinalConfig =
false
);
36
38
class
Bootloader final
39
{
40
SEN_NOCOPY_NOMOVE(Bootloader)
41
42
public
:
44
static
std::unique_ptr<Bootloader>
fromYamlFile
(
const
std::filesystem::path& path,
bool
printConfig);
45
47
static
std::unique_ptr<Bootloader>
fromYamlString
(
const
std::string& config,
bool
printConfig);
48
49
~Bootloader
();
50
51
public
:
53
[[nodiscard]]
KernelConfig
&
getConfig
() noexcept;
54
55
private:
56
Bootloader();
57
58
private:
59
void
loadConfigFromString(const
std
::
string
& content, const
std
::filesystem::path& path,
bool
printFinalConfig);
60
61
void
loadConfigFromFile(const
std
::filesystem::path& path,
bool
printFinalConfig);
62
63
void
loadKernelConfig(const
VarMap
& data);
64
65
void
loadComponents(const
VarMap
& data);
66
67
void
loadPipelines(const
VarMap
& data);
68
69
void
component(
std
::string_view path, const
Var
& data);
70
71
void
pipeline(
std
::string_view name, const
Var
& data);
72
73
static
void
fetchPipelineObjects(
KernelConfig
::PipelineToLoad& pipelineConfig, const
VarMap
& map);
74
75
static
void
fetchPipelineComponentConfig(
KernelConfig
::PipelineToLoad& pipelineConfig, const
Var
& data);
76
77
static
void
fetchPipelineExecPeriod(
KernelConfig
::PipelineToLoad& pipelineConfig, const
VarMap
& map);
78
79
static
void
fetchPipelineUserDefinedParams(
KernelConfig
::PipelineToLoad& pipelineConfig, const
VarMap
& map);
80
81
private:
82
KernelConfig
config_;
83
VarMap
configVar_;
84
};
85
86
}
// namespace sen::kernel
87
88
#endif
// SEN_KERNEL_BOOTLOADER_H
class_helpers.h
Here we define a set of template meta-programming helpers to let the compiler take some decisions bas...
sen::kernel::Bootloader::fromYamlString
static std::unique_ptr< Bootloader > fromYamlString(const std::string &config, bool printConfig)
Reads the configuration from a string in YAML format.
sen::kernel::Bootloader::fromYamlFile
static std::unique_ptr< Bootloader > fromYamlFile(const std::filesystem::path &path, bool printConfig)
Opens a YAML configuration file and stores it in a KernelConfig structure.
sen::kernel::Bootloader::getConfig
KernelConfig & getConfig() noexcept
The loaded configuration info.
sen::kernel::Bootloader::~Bootloader
~Bootloader()
sen::kernel::KernelConfig
Holds the kernel configuration information.
Definition
kernel_config.h:33
sen::kernel::getConfigAsVarFromYaml
VarMap getConfigAsVarFromYaml(const std::filesystem::path &path, bool printFinalConfig=false)
Loads a configuration YAML file and returns its contents as a sen::VarMap. This function does not val...
sen::VarMap
std::map< std::string, Var, std::less<> > VarMap
A map of vars to represent structures.
Definition
var.h:107
kernel.h
kernel_config.h
sen::kernel
Strong type for the unique identifier for a transport timer.
Definition
native_object_impl.h:39
std
STL namespace.
sen::Var
Can hold any supported value type. Wraps std::variant to allow recursion and implements some helpers.
Definition
var.h:119
libs
kernel
include
sen
kernel
bootloader.h
Generated by
1.17.0