Sen API
Sen Libraries
Loading...
Searching...
No Matches
Kernel library

The Sen kernel API. More...

Classes

class  sen::kernel::Bootloader
 Configures a kernel for running. More...
class  sen::kernel::Component
 Base class for implementing sen kernel components. More...
class  sen::kernel::KernelApi
 User-facing kernel functions. More...
class  sen::kernel::ConfigGetter
 Allows for fetching configuration parameters. More...
class  sen::kernel::RegistrationApi
 API for objects when registered. More...
class  sen::kernel::InitApi
 What can be done when initializing a component. More...
class  sen::kernel::RunApi
 What can be done while a component is running. More...
class  sen::kernel::UnloadApi
 What can be done when unloading a component. More...
class  sen::kernel::Kernel
 Main entry point of a sen microkernel. More...
struct  sen::kernel::ComponentContext
 Holds a component instance and basic info. More...
class  sen::kernel::KernelConfig
 Holds the kernel configuration information. More...
class  sen::kernel::SourceInfo
 Provides information about sources as strings. More...
class  sen::kernel::SessionInfoProvider
struct  sen::kernel::BusId
struct  sen::kernel::ParticipantAddr
 To identify remote participants. More...
class  sen::kernel::UniqueByteBufferManager
class  sen::kernel::TransportListener
 Interface for the internal Sen element that reacts to transport events. More...
struct  sen::kernel::TransportStats
 Global transport statistics. More...
class  sen::kernel::Transport
 Interface for implementing a Sen inter-process transport solution. More...

Typedefs

using sen::kernel::BestEffortBlockPtr = std::shared_ptr<FixedMemoryBlock>
 Pointer to a memory block of fixed size, used for best effort communication.
using sen::kernel::ReliableBlockPtr = std::shared_ptr<ResizableHeapBlock>
 Pointer to a resizable memory block, used for reliable communication.
using sen::kernel::BestEffortBufferList = std::vector<BestEffortBlockPtr>
 A list (vector) of fixed-size memory blocks.
using sen::kernel::TransportFactory = std::function<std::unique_ptr<Transport>(const std::string&, std::unique_ptr<Tracer> tracer)>
 A function that creates a transport given a session name.

Functions

VarMap sen::kernel::getConfigAsVarFromYaml (const std::filesystem::path &path, bool printFinalConfig=false)
 Loads a configuration YAML file and returns its contents as a sen::VarMap. This function does not validate the correctness of the configuration, but simply translates the contents into the Var. It resolves included yamls.
VarMap sen::kernel::getConfigAsVarFromYaml (const std::string &content, const std::filesystem::path &path, bool printFinalConfig=false)
 Loads a configuration YAML file and returns its contents as a sen::VarMap. This function does not validate the correctness of the configuration, but simply translates the contents into the Var. It resolves included yamls. If the "path" argument is not correct, it will not resolve the inclusions.
bool sen::kernel::operator== (const ParticipantAddr &lhs, const ParticipantAddr &rhs) noexcept
bool sen::kernel::operator!= (const ParticipantAddr &lhs, const ParticipantAddr &rhs) noexcept
uint32_t sen::kernel::getKernelProtocolVersion () noexcept
 The protocol version of kernel messaging.
CustomTypeSpec sen::kernel::makeCustomTypeSpec (const CustomType *type)
 Implementation detail for the kernel.
bool sen::kernel::equivalent (const Type *localType, const Type *remoteType)
 Checks if two meta types are equivalent (same hash).
ConstTypeHandle< CustomTypesen::kernel::buildNonNativeType (const CustomTypeSpec &remoteType, const CustomTypeRegistry &nativeTypes, const CustomTypeRegistry &nonNativeTypes)
 Implementation detail for the kernel.
std::vector< std::string > sen::kernel::getRuntimeDifferences (const Type *localType, const Type *remoteType)
 Detects which differences cause.
std::vector< std::string > sen::kernel::runtimeCompatible (const Type *localType, const Type *remoteType)
 Checks if two types are runtime-compatible and returns the error string in case they are not.
CustomTypeSpec sen::kernel::toCurrentVersion (const CustomTypeSpecV4 &v4)
 Translates a CustomTypeSpec from V4 to the current version (V6) of the kernel protocol.
CustomTypeSpec sen::kernel::toCurrentVersion (const CustomTypeSpecV5 &v5)
 Translates a CustomTypeSpec from V5 to the current version (V6) of the kernel protocol.

Variables

constexpr std::size_t sen::kernel::maxBestEffortMessageSize = 65527U
 The maximum UDP payload size.

Detailed Description

The Sen kernel API.


Class Documentation

◆ sen::kernel::ComponentContext

struct sen::kernel::ComponentContext

Holds a component instance and basic info.

Class Members
Component * instance = nullptr
ComponentConfig config {}
ComponentInfo info {}

◆ sen::kernel::ParticipantAddr

struct sen::kernel::ParticipantAddr

To identify remote participants.

Class Members
ProcessId proc
ObjectOwnerId id
void * userData = nullptr Allows transport implementations to inject information.

◆ sen::kernel::TransportStats

struct sen::kernel::TransportStats

Global transport statistics.

Class Members
size_t udpSentBytes = 0
size_t udpReceivedBytes = 0
size_t tcpSentBytes = 0
size_t tcpReceivedBytes = 0

Typedef Documentation

◆ BestEffortBlockPtr

using sen::kernel::BestEffortBlockPtr = std::shared_ptr<FixedMemoryBlock>

Pointer to a memory block of fixed size, used for best effort communication.

◆ ReliableBlockPtr

using sen::kernel::ReliableBlockPtr = std::shared_ptr<ResizableHeapBlock>

Pointer to a resizable memory block, used for reliable communication.

◆ BestEffortBufferList

A list (vector) of fixed-size memory blocks.

◆ TransportFactory

using sen::kernel::TransportFactory = std::function<std::unique_ptr<Transport>(const std::string&, std::unique_ptr<Tracer> tracer)>

A function that creates a transport given a session name.

Function Documentation

◆ getConfigAsVarFromYaml() [1/2]

VarMap sen::kernel::getConfigAsVarFromYaml ( const std::filesystem::path & path,
bool printFinalConfig = false )
nodiscard

Loads a configuration YAML file and returns its contents as a sen::VarMap. This function does not validate the correctness of the configuration, but simply translates the contents into the Var. It resolves included yamls.

◆ getConfigAsVarFromYaml() [2/2]

VarMap sen::kernel::getConfigAsVarFromYaml ( const std::string & content,
const std::filesystem::path & path,
bool printFinalConfig = false )
nodiscard

Loads a configuration YAML file and returns its contents as a sen::VarMap. This function does not validate the correctness of the configuration, but simply translates the contents into the Var. It resolves included yamls. If the "path" argument is not correct, it will not resolve the inclusions.

◆ operator==()

bool sen::kernel::operator== ( const ParticipantAddr & lhs,
const ParticipantAddr & rhs )
nodiscardnoexcept

◆ operator!=()

bool sen::kernel::operator!= ( const ParticipantAddr & lhs,
const ParticipantAddr & rhs )
nodiscardnoexcept

◆ getKernelProtocolVersion()

uint32_t sen::kernel::getKernelProtocolVersion ( )
nodiscardnoexcept

The protocol version of kernel messaging.

◆ makeCustomTypeSpec()

CustomTypeSpec sen::kernel::makeCustomTypeSpec ( const CustomType * type)
nodiscard

Implementation detail for the kernel.

◆ equivalent()

bool sen::kernel::equivalent ( const Type * localType,
const Type * remoteType )
nodiscard

Checks if two meta types are equivalent (same hash).

◆ buildNonNativeType()

ConstTypeHandle< CustomType > sen::kernel::buildNonNativeType ( const CustomTypeSpec & remoteType,
const CustomTypeRegistry & nativeTypes,
const CustomTypeRegistry & nonNativeTypes )
nodiscard

Implementation detail for the kernel.

◆ getRuntimeDifferences()

std::vector< std::string > sen::kernel::getRuntimeDifferences ( const Type * localType,
const Type * remoteType )
nodiscard

Detects which differences cause.

◆ runtimeCompatible()

std::vector< std::string > sen::kernel::runtimeCompatible ( const Type * localType,
const Type * remoteType )
nodiscard

Checks if two types are runtime-compatible and returns the error string in case they are not.

◆ toCurrentVersion() [1/2]

CustomTypeSpec sen::kernel::toCurrentVersion ( const CustomTypeSpecV4 & v4)
nodiscard

Translates a CustomTypeSpec from V4 to the current version (V6) of the kernel protocol.

◆ toCurrentVersion() [2/2]

CustomTypeSpec sen::kernel::toCurrentVersion ( const CustomTypeSpecV5 & v5)
nodiscard

Translates a CustomTypeSpec from V5 to the current version (V6) of the kernel protocol.

Variable Documentation

◆ maxBestEffortMessageSize

std::size_t sen::kernel::maxBestEffortMessageSize = 65527U
constexpr

The maximum UDP payload size.