|
Sen API
Sen Libraries
|
Convenience class for using lambdas instead of inheritance when defining test components. More...
#include <test_kernel.h>
Public Types | |
| using | InitFunc = std::function<PassResult(InitApi&&)> |
| using | RunFunc = std::function<FuncResult(RunApi&)> |
| using | UnloadFunc = std::function<FuncResult(UnloadApi&&)> |
Public Member Functions | |
| TestComponent ()=default | |
| ~TestComponent () override=default | |
| void | onInit (InitFunc func) |
| void | onRun (RunFunc func) |
| void | onUnload (UnloadFunc func) |
| PassResult | init (InitApi &&api) override |
| Initialize the component and perform kernel-related operations. This may include dependency resolution, and resource registration. This function will be continuously called until it returns that it's done. | |
| FuncResult | run (RunApi &api) override |
| Runs the component in a dedicated thread. This function is called once and only when the kernel has reached the desired group of this component. Implementations shall end the execution thread when the stopFlag is set to true. | |
| FuncResult | unload (UnloadApi &&api) override |
| Unload any self-contained resources. This function is just called once. | |
| virtual FuncResult | preload (PreloadApi &&) |
| Preload the component and initialize all self-contained resources. This function is just called once. | |
| virtual FuncResult | load (LoadApi &&) |
| Load the component and initialize all self-contained resources. This function is just called once. | |
| virtual void | postUnloadCleanup () |
| Do an additional (and final) clean up step after unloading the component. This function is just called once for all components and independently of the chosen group. | |
| virtual bool | isRealTimeOnly () const noexcept |
| Return true here if your component is not designed to work with virtualized time. | |
Static Protected Member Functions | |
| static PassResult | delay (Duration time) noexcept |
| Convenience function to return an operation delay request. | |
| static PassResult | done () noexcept |
| Convenience function to return a finished operation result. | |
Convenience class for using lambdas instead of inheritance when defining test components.
| using sen::kernel::TestComponent::InitFunc = std::function<PassResult(InitApi&&)> |
| using sen::kernel::TestComponent::RunFunc = std::function<FuncResult(RunApi&)> |
| using sen::kernel::TestComponent::UnloadFunc = std::function<FuncResult(UnloadApi&&)> |
|
default |
|
overridedefault |
| void sen::kernel::TestComponent::onInit | ( | InitFunc | func | ) |
| void sen::kernel::TestComponent::onRun | ( | RunFunc | func | ) |
| void sen::kernel::TestComponent::onUnload | ( | UnloadFunc | func | ) |
|
overridevirtual |
Initialize the component and perform kernel-related operations. This may include dependency resolution, and resource registration. This function will be continuously called until it returns that it's done.
Reimplemented from sen::kernel::Component.
|
overridevirtual |
Runs the component in a dedicated thread. This function is called once and only when the kernel has reached the desired group of this component. Implementations shall end the execution thread when the stopFlag is set to true.
Reimplemented from sen::kernel::Component.
|
overridevirtual |
Unload any self-contained resources. This function is just called once.
Reimplemented from sen::kernel::Component.
|
inlinevirtualinherited |
Preload the component and initialize all self-contained resources. This function is just called once.
|
inlinevirtualinherited |
Load the component and initialize all self-contained resources. This function is just called once.
|
inlinevirtualinherited |
Do an additional (and final) clean up step after unloading the component. This function is just called once for all components and independently of the chosen group.
|
inlinenodiscardvirtualnoexceptinherited |
Return true here if your component is not designed to work with virtualized time.
|
inlinestaticnodiscardprotectednoexceptinherited |
Convenience function to return an operation delay request.
|
inlinestaticnodiscardprotectednoexceptinherited |
Convenience function to return a finished operation result.