Dataflow Runtime API  4.0.1.0
Public Member Functions | Static Public Attributes | List of all members
imt::base::dff::runtime::EventPoolCapacityCallbackIfc Class Referenceabstract

Interface for callback about the event pool capacity. More...

#include <Imt.Base.Dff.Runtime/EventPoolCapacityCallbackIfc.h>

Public Member Functions

virtual ~EventPoolCapacityCallbackIfc ()
 Destructor. More...
 
virtual bool onEventPoolCapacityCritical (uint16_t const protocolIdentifier, ::imt::base::core::serialization::SerializableIfc const *const pEventData)=0
 Is called continuously by the core as long as the critical event pool capacity is below (event pool size / EVENTPOOL_THRESHOLD_DIVISOR_CRITICAL) of the total event pool size. More...
 
virtual void onEventPoolCapacityRecovered ()=0
 Is called by the core when the event pool capacity is again above (event pool size / EVENTPOOL_THRESHOLD_DIVISOR_RECOVERED) of the total event pool size. More...
 

Static Public Attributes

static size_t const EVENTPOOL_THRESHOLD_DIVISOR_CRITICAL = 10U
 Lower threshold for critical: 10% capacity remaining. More...
 
static size_t const EVENTPOOL_THRESHOLD_DIVISOR_RECOVERED = 5U
 Upper threshold for recovered: 20% capacity remaining. More...
 

Detailed Description

Interface for callback about the event pool capacity.

This is called when the number of available messages in the event pool has reached the EVENTPOOL_THRESHOLD_SIZE_CRITICAL. The reason is usually because the system is overloaded or the defined EVENTPOOL_SIZE is too small. It is now the responsibility of the callback to decide if the given message (identifier by the message identifier) is critical and has to be enqueued, or non-critical and can be discarded. Once the event pool capacity is recovered (number of available messages in the event pool above EVENTPOOL_THRESHOLD_SIZE_RECOVERED).

Note
This callback is called on each schedule task and therefore slow downs the scheduler! Ensure the implementation returns as fast as possible.

Constructor & Destructor Documentation

◆ ~EventPoolCapacityCallbackIfc()

virtual imt::base::dff::runtime::EventPoolCapacityCallbackIfc::~EventPoolCapacityCallbackIfc ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ onEventPoolCapacityCritical()

virtual bool imt::base::dff::runtime::EventPoolCapacityCallbackIfc::onEventPoolCapacityCritical ( uint16_t const  protocolIdentifier,
::imt::base::core::serialization::SerializableIfc const *const  pEventData 
)
pure virtual

Is called continuously by the core as long as the critical event pool capacity is below (event pool size / EVENTPOOL_THRESHOLD_DIVISOR_CRITICAL) of the total event pool size.

This callback gives the application an opportunity to decide if the given message is critical and has to be queued, or non-critical and can be discarded. Additionally it can disable non-critical peripheral interrupts to reduce the system load. Notes: is invoked with interrupts locked and must also return with interrupts locked.

Parameters
protocolIdentifierIdentifier of the protocol.
pEventDataEvent data.
Returns
True indicates that the message has to be enqueued, false indicates that the message can be discarded.

◆ onEventPoolCapacityRecovered()

virtual void imt::base::dff::runtime::EventPoolCapacityCallbackIfc::onEventPoolCapacityRecovered ( )
pure virtual

Is called by the core when the event pool capacity is again above (event pool size / EVENTPOOL_THRESHOLD_DIVISOR_RECOVERED) of the total event pool size.

This callback gives the application an opportunity to re-enable non-critical peripheral interrupts. Notes: is invoked with interrupts locked and must also return with interrupts locked.

Member Data Documentation

◆ EVENTPOOL_THRESHOLD_DIVISOR_CRITICAL

size_t const imt::base::dff::runtime::EventPoolCapacityCallbackIfc::EVENTPOOL_THRESHOLD_DIVISOR_CRITICAL = 10U
static

Lower threshold for critical: 10% capacity remaining.

◆ EVENTPOOL_THRESHOLD_DIVISOR_RECOVERED

size_t const imt::base::dff::runtime::EventPoolCapacityCallbackIfc::EVENTPOOL_THRESHOLD_DIVISOR_RECOVERED = 5U
static

Upper threshold for recovered: 20% capacity remaining.


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