|
Sen API
Sen Libraries
|
User-facing kernel functions. More...
#include <component_api.h>
Public Member Functions | |
| KernelApi (Kernel &kernel, impl::Runner *runner) noexcept | |
| CustomTypeRegistry & | getTypes () noexcept |
| The types registered into the kernel. | |
| void | requestKernelStop (int exitCode=0) |
| Issues an asynchronous request to stop the kernel. The request is ignored if a previous stop request was issued. | |
| std::shared_ptr< ObjectSource > | getSource (const BusAddress &address) |
| Gets an object source, where objects can be found and published. | |
| std::shared_ptr< ObjectSource > | getSource (const std::string &address) |
| Gets an object source, where objects can be found and published. The address parameter must be given as <session-name>.<bus-name>. | |
| SessionsDiscoverer & | getSessionsDiscoverer () noexcept |
| Object that allows discovering sessions and buses. | |
| const ProcessInfo * | fetchOwnerInfo (const Object *object) const noexcept |
| Gets information about the process where an object is. Returns nullptr if the object resides in the current process. | |
| const std::string & | getAppName () const noexcept |
| Gets the (optional) application name passed to the kernel as a configuration parameter. | |
| ::sen::impl::WorkQueue * | getWorkQueue () const noexcept |
| The work queue of this runner. | |
| template<typename T, typename Bus> | |
| std::shared_ptr< Subscription< T > > | selectAllFrom (const Bus &bus) |
| template<typename T, typename Bus> | |
| std::shared_ptr< Subscription< T > > | selectAllFrom (const Bus &bus, typename sen::ObjectList< T >::Callback onAdded, typename sen::ObjectList< T >::Callback onRemoved=nullptr) |
| Overload of selectAllFrom that installs addition and removal callbacks before subscribing, so they fire for objects already present at subscription time. Pass nullptr for either callback to skip it. | |
| template<typename T, typename Bus> | |
| std::shared_ptr< Subscription< T > > | selectFrom (const Bus &bus, const std::string &query, typename sen::ObjectList< T >::Callback onAdded=nullptr, typename sen::ObjectList< T >::Callback onRemoved=nullptr) |
| Creates a subscription for objects matching the given Sen query string. Unlike selectAllFrom, this lets you supply an arbitrary query with WHERE conditions. Example: selectFrom<Shape>(bus, "SELECT Shape FROM local.bus WHERE color IN (\"red\")"). It installs addition and removal callbacks before subscribing. Pass nullptr for either callback to skip it. | |
| std::filesystem::path | getConfigFilePath () const noexcept |
| Gets the path to the configuration file used to construct the kernel. It might be empty if the kernel is programmatically configured. | |
Static Public Member Functions | |
| static std::shared_ptr< spdlog::logger > | getOrCreateLogger (const std::string &loggerName) |
| Registers a new logger in the kernel if it does not exist, or returns the existing one by name. Used to propagate the logger configuration to other packages/components that use it. | |
| static void | applyToAllLoggers (std::function< void(std::shared_ptr< spdlog::logger >)> &&func) |
| Applies the input function to all loggers kept in the logger registry. Used by the logmaster component. | |
User-facing kernel functions.
|
noexcept |
|
nodiscardnoexcept |
The types registered into the kernel.
| void sen::kernel::KernelApi::requestKernelStop | ( | int | exitCode = 0 | ) |
Issues an asynchronous request to stop the kernel. The request is ignored if a previous stop request was issued.
|
nodiscard |
Gets an object source, where objects can be found and published.
|
nodiscard |
Gets an object source, where objects can be found and published. The address parameter must be given as <session-name>.<bus-name>.
|
nodiscardnoexcept |
Object that allows discovering sessions and buses.
|
nodiscardnoexcept |
Gets information about the process where an object is. Returns nullptr if the object resides in the current process.
|
nodiscardnoexcept |
Gets the (optional) application name passed to the kernel as a configuration parameter.
|
nodiscardnoexcept |
The work queue of this runner.
|
inlinenodiscard |
|
inlinenodiscard |
Overload of selectAllFrom that installs addition and removal callbacks before subscribing, so they fire for objects already present at subscription time. Pass nullptr for either callback to skip it.
|
inlinenodiscard |
Creates a subscription for objects matching the given Sen query string. Unlike selectAllFrom, this lets you supply an arbitrary query with WHERE conditions. Example: selectFrom<Shape>(bus, "SELECT Shape FROM local.bus WHERE color IN (\"red\")"). It installs addition and removal callbacks before subscribing. Pass nullptr for either callback to skip it.
|
inlinenodiscardnoexcept |
Gets the path to the configuration file used to construct the kernel. It might be empty if the kernel is programmatically configured.
|
staticnodiscard |
Registers a new logger in the kernel if it does not exist, or returns the existing one by name. Used to propagate the logger configuration to other packages/components that use it.
|
static |
Applies the input function to all loggers kept in the logger registry. Used by the logmaster component.