Sen API
Sen Libraries
Loading...
Searching...
No Matches
sen::kernel::Component Class Reference

Base class for implementing sen kernel components. More...

#include <component.h>

Inheritance diagram for sen::kernel::Component:

Public Member Functions

 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 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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ Component()

sen::kernel::Component::Component ( )
defaultnoexcept

◆ ~Component()

virtual sen::kernel::Component::~Component ( )
virtualdefault

Member Function Documentation

◆ preload()

virtual FuncResult sen::kernel::Component::preload ( PreloadApi && )
inlinevirtual

Preload the component and initialize all self-contained resources. This function is just called once.

◆ load()

virtual FuncResult sen::kernel::Component::load ( LoadApi && )
inlinevirtual

Load the component and initialize all self-contained resources. This function is just called once.

◆ init()

virtual PassResult sen::kernel::Component::init ( InitApi && )
inlinevirtual

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()

virtual FuncResult sen::kernel::Component::run ( RunApi & )
inlinevirtual

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()

virtual FuncResult sen::kernel::Component::unload ( UnloadApi && )
inlinevirtual

Unload any self-contained resources. This function is just called once.

Reimplemented in sen::kernel::TestComponent.

◆ 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()

PassResult sen::kernel::Component::delay ( Duration time)
inlinestaticnodiscardprotectednoexcept

Convenience function to return an operation delay request.

◆ done()

PassResult sen::kernel::Component::done ( )
inlinestaticnodiscardprotectednoexcept

Convenience function to return a finished operation result.


The documentation for this class was generated from the following file: