Imt.Base C++ API V4.1.1.0
Loading...
Searching...
No Matches
imt::base::dff::runtime::RuntimeCore Class Referencefinal

RuntimeCore defines the basic Application Interface (API) to the core part of the event-based run to completion (RTC) kernel. More...

#include <Imt.Base.Dff.Runtime/inc/Imt.Base.Dff.Runtime/RuntimeCore.h>

Inheritance diagram for imt::base::dff::runtime::RuntimeCore:
imt::base::core::platform::StaticClass

Public Types

using CoreHandle = int16_t
 A CoreHandle is used to identify an executable with a unique number (similar to a phone number).
 

Static Public Member Functions

static void init (IdleCallbackIfc *const pIdleCallback=nullptr, EventPoolCapacityCallbackIfc *const pEventPoolCapacityCallback=nullptr)
 Initialize the core.
 
static CoreHandle create (ExecutableIfc &executable)
 Register the given executable in the core.
 
static void start ()
 Start the core.
 
static void stop ()
 Stops the core.
 
static void sendEvent (CoreHandle const receiverHandle, uint16_t const protocolIdentifier, ::imt::base::core::serialization::SerializableIfc const *const pEventData, size_t const eventDataSizeBytes)
 Send an event to the given receiver (the scheduler will determinate when the event will be processed based on the priority of the receiver).
 

Static Public Attributes

static constexpr CoreHandle COREHANDLE_INVALID {-1}
 Constant which represents an invalid CoreHandle.
 

Detailed Description

RuntimeCore defines the basic Application Interface (API) to the core part of the event-based run to completion (RTC) kernel.

Executables can be registered with RuntimeCore::create and can be identified with a CoreHandle. This CoreHandle is then used in RuntimeCore::sendEvent to identify the receiver. The event is then dispatched by the runtime back to the application with the ExecutableIfc based on the priority of the executable.

Definition at line 56 of file RuntimeCore.h.

Member Typedef Documentation

◆ CoreHandle

A CoreHandle is used to identify an executable with a unique number (similar to a phone number).

Invalid handles have the identifier COREHANDLE_INVALID.

Definition at line 64 of file RuntimeCore.h.

Member Function Documentation

◆ create()

static CoreHandle imt::base::dff::runtime::RuntimeCore::create ( ExecutableIfc executable)
static

Register the given executable in the core.

A handle is returned, which can be used as an identifier for the RuntimeCore::sendEvent function. This function must be called at initialization phase with interrupts disabled.

Note
Returns COREHANDLE_INVALID if there are no more handles available (increase EXECUTABLES_MAX).
Parameters
executableObject which implements the executable interface.
Returns
CoreHandle Unique identifier for the given executable.

◆ init()

static void imt::base::dff::runtime::RuntimeCore::init ( IdleCallbackIfc *const  pIdleCallback = nullptr,
EventPoolCapacityCallbackIfc *const  pEventPoolCapacityCallback = nullptr 
)
static

Initialize the core.

Note
The core can process the messages faster if there is no pEventPoolCapacityCallback set.
Parameters
pIdleCallbackOptional idle callback, can be nullptr.
pEventPoolCapacityCallbackOptional event pool capacity callback, can be null.

◆ sendEvent()

static void imt::base::dff::runtime::RuntimeCore::sendEvent ( CoreHandle const  receiverHandle,
uint16_t const  protocolIdentifier,
::imt::base::core::serialization::SerializableIfc const *const  pEventData,
size_t const  eventDataSizeBytes 
)
static

Send an event to the given receiver (the scheduler will determinate when the event will be processed based on the priority of the receiver).

Parameters
receiverHandleUnique identifier of the executable which receives the event.
protocolIdentifierUnique identifier of protocol (is required for the receiver to encode the event data).
pEventDataPointer to the event data, which can be deserialized based on the protocol identifier (can also be nullptr).
eventDataSizeBytesSize in bytes of the serialized event data.

◆ start()

static void imt::base::dff::runtime::RuntimeCore::start ( )
static

Start the core.

Note
If an idle callback has been provided in the RuntimeCore::init function, this function will never return.

◆ stop()

static void imt::base::dff::runtime::RuntimeCore::stop ( )
static

Stops the core.

This will abort the execution of all active parts causing the data flow application to stop its execution.

Member Data Documentation

◆ COREHANDLE_INVALID

constexpr CoreHandle imt::base::dff::runtime::RuntimeCore::COREHANDLE_INVALID {-1}
staticconstexpr

Constant which represents an invalid CoreHandle.

Definition at line 69 of file RuntimeCore.h.


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