Dataflow Runtime API  3.1.1.0
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
imt::base::dff::runtime::RuntimeCore Class Reference

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/RuntimeCore.h>

Public Types

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

Static Public Member Functions

static void init (IdleCallbackIfc *const idleCallback=NULL, EventPoolCapacityCallbackIfc *const eventPoolCapacityCallback=NULL)
 Initialize the core. More...
 
static CoreHandle create (ExecutableIfc &executable)
 Register the given executable in the core. More...
 
static void start (void)
 Start the core. More...
 
static void sendEvent (const CoreHandle receiverHandle, const uint16_t protocolIdentifier, const imt::base::core::serialization::SerializableIfc *const pEventData, const size_t 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). More...
 

Static Public Attributes

static const CoreHandle COREHANDLE_INVALID = -1
 Constant which represents an invalid CoreHandle. More...
 

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.

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.

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  idleCallback = NULL,
EventPoolCapacityCallbackIfc *const  eventPoolCapacityCallback = NULL 
)
static

Initialize the core.

Note
The core can process the messages faster if there is no eventPoolCapacityCallback set.
Parameters
idleCallbackOptional idle callback, can be NULL.
eventPoolCapacityCallbackOptional event pool capacity callback, can be null.

◆ sendEvent()

static void imt::base::dff::runtime::RuntimeCore::sendEvent ( const CoreHandle  receiverHandle,
const uint16_t  protocolIdentifier,
const imt::base::core::serialization::SerializableIfc *const  pEventData,
const size_t  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 NULL).
eventDataSizeBytesSize in bytes of the serialized event data.

◆ start()

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

Start the core.

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

Member Data Documentation

◆ COREHANDLE_INVALID

const CoreHandle imt::base::dff::runtime::RuntimeCore::COREHANDLE_INVALID = -1
static

Constant which represents an invalid CoreHandle.


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