8#ifndef SEN_KERNEL_TEST_KERNEL_H
9#define SEN_KERNEL_TEST_KERNEL_H
16#include "stl/sen/kernel/kernel_objects.stl.h"
41 void step(std::size_t count = 1);
43 [[nodiscard]] std::shared_ptr<ObjectSource>
getComponentBus(std::string_view componentName,
44 const BusAddress& busAddress)
const;
45 [[nodiscard]] std::optional<const ComponentContext*>
getComponentContext(std::string_view componentName)
const;
52 std::unique_ptr<Kernel> kernel_;
A registry of custom types.
Definition type_registry.h:36
A point in time.
Definition timestamp.h:26
Base class for implementing sen kernel components.
Definition component.h:34
Component() noexcept=default
What can be done when initializing a component.
Definition component_api.h:213
Holds the kernel configuration information.
Definition kernel_config.h:33
What can be done while a component is running.
Definition component_api.h:224
std::function< FuncResult(UnloadApi &&)> UnloadFunc
Definition test_kernel.h:64
std::function< FuncResult(RunApi &)> RunFunc
Definition test_kernel.h:63
PassResult init(InitApi &&api) override
Initialize the component and perform kernel-related operations. This may include dependency resolutio...
~TestComponent() override=default
FuncResult unload(UnloadApi &&api) override
Unload any self-contained resources. This function is just called once.
void onUnload(UnloadFunc func)
std::function< PassResult(InitApi &&)> InitFunc
Definition test_kernel.h:62
void onInit(InitFunc func)
FuncResult run(RunApi &api) override
Runs the component in a dedicated thread. This function is called once and only when the kernel has r...
std::optional< const ComponentContext * > getComponentContext(std::string_view componentName) const
std::shared_ptr< ObjectSource > getComponentBus(std::string_view componentName, const BusAddress &busAddress) const
static TestKernel fromYamlFile(const std::filesystem::path &configFilePath)
TestKernel(Component *component)
CustomTypeRegistry & getTypes() const
void step(std::size_t count=1)
static TestKernel fromYamlString(const std::string &configString)
TestKernel(KernelConfig config)
TimeStamp getTime() const
What can be done when unloading a component.
Definition component_api.h:291
Strong type for the unique identifier for a transport timer.
Definition native_object_impl.h:39
Result< OpState, ExecError > PassResult
The result of operations that may be called multiple times.
Definition component_api.h:53
Result< void, ExecError > FuncResult
The result of operations that are called once.
Definition component_api.h:50