Base class for implementing sen kernel components.
More...
#include <component.h>
|
| | Component () noexcept=default |
| virtual | ~Component ()=default |
| 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 PassResult | init (InitApi &&) |
| | 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.
|
| virtual FuncResult | run (RunApi &) |
| | 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.
|
| virtual FuncResult | unload (UnloadApi &&) |
| | Unload any 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 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.
|
Base class for implementing sen kernel components.
Users shall define the SEN_COMPONENT(name) macro once somewhere in their shared lib (in the global namespace) where 'name' shall be the name of the subclass.
◆ Component()
| sen::kernel::Component::Component |
( |
| ) |
|
|
defaultnoexcept |
◆ ~Component()
| virtual sen::kernel::Component::~Component |
( |
| ) |
|
|
virtualdefault |
◆ preload()
Preload the component and initialize all self-contained resources. This function is just called once.
◆ load()
Load the component and initialize all self-contained resources. This function is just called once.
◆ init()
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 in sen::kernel::TestComponent.
◆ run()
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 in sen::kernel::TestComponent.
◆ unload()
◆ postUnloadCleanup()
| virtual void sen::kernel::Component::postUnloadCleanup |
( |
| ) |
|
|
inlinevirtual |
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.
◆ isRealTimeOnly()
| virtual bool sen::kernel::Component::isRealTimeOnly |
( |
| ) |
const |
|
inlinenodiscardvirtualnoexcept |
Return true here if your component is not designed to work with virtualized time.
◆ delay()
|
|
inlinestaticnodiscardprotectednoexcept |
Convenience function to return an operation delay request.
◆ done()
|
|
inlinestaticnodiscardprotectednoexcept |
Convenience function to return a finished operation result.
The documentation for this class was generated from the following file: