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

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

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

Public Member Functions

 EventPoolCapacityCallbackIfc (EventPoolCapacityCallbackIfc const &)=delete
 
 EventPoolCapacityCallbackIfc (EventPoolCapacityCallbackIfc &&)=delete
 
EventPoolCapacityCallbackIfcoperator= (EventPoolCapacityCallbackIfc const &) &=delete
 
EventPoolCapacityCallbackIfcoperator= (EventPoolCapacityCallbackIfc &&) &=delete
 
virtual bool onEventPoolCapacityCritical (uint16_t const protocolID, ::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.
 
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.
 

Static Public Attributes

static constexpr size_t EVENTPOOL_THRESHOLD_DIVISOR_CRITICAL {10U}
 Lower threshold for critical: 10% capacity remaining.
 
static constexpr size_t EVENTPOOL_THRESHOLD_DIVISOR_RECOVERED {5U}
 Upper threshold for recovered: 20% capacity remaining.
 

Protected Member Functions

 EventPoolCapacityCallbackIfc () noexcept=default
 Default constructor.
 
 ~EventPoolCapacityCallbackIfc () noexcept=default
 Destructor.
 

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).

This interface does not provide ownership on the callback object.

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

Definition at line 59 of file EventPoolCapacityCallbackIfc.h.

Constructor & Destructor Documentation

◆ EventPoolCapacityCallbackIfc() [1/3]

imt::base::dff::runtime::EventPoolCapacityCallbackIfc::EventPoolCapacityCallbackIfc ( EventPoolCapacityCallbackIfc const &  )
delete

◆ EventPoolCapacityCallbackIfc() [2/3]

imt::base::dff::runtime::EventPoolCapacityCallbackIfc::EventPoolCapacityCallbackIfc ( EventPoolCapacityCallbackIfc &&  )
delete

◆ EventPoolCapacityCallbackIfc() [3/3]

imt::base::dff::runtime::EventPoolCapacityCallbackIfc::EventPoolCapacityCallbackIfc ( )
protecteddefaultnoexcept

Default constructor.

◆ ~EventPoolCapacityCallbackIfc()

imt::base::dff::runtime::EventPoolCapacityCallbackIfc::~EventPoolCapacityCallbackIfc ( )
protecteddefaultnoexcept

Destructor.

Member Function Documentation

◆ onEventPoolCapacityCritical()

virtual bool imt::base::dff::runtime::EventPoolCapacityCallbackIfc::onEventPoolCapacityCritical ( uint16_t const  protocolID,
::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
protocolIDIdentifier 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.

◆ operator=() [1/2]

EventPoolCapacityCallbackIfc & imt::base::dff::runtime::EventPoolCapacityCallbackIfc::operator= ( EventPoolCapacityCallbackIfc &&  ) &
delete

◆ operator=() [2/2]

EventPoolCapacityCallbackIfc & imt::base::dff::runtime::EventPoolCapacityCallbackIfc::operator= ( EventPoolCapacityCallbackIfc const &  ) &
delete

Member Data Documentation

◆ EVENTPOOL_THRESHOLD_DIVISOR_CRITICAL

constexpr size_t imt::base::dff::runtime::EventPoolCapacityCallbackIfc::EVENTPOOL_THRESHOLD_DIVISOR_CRITICAL {10U}
staticconstexpr

Lower threshold for critical: 10% capacity remaining.

Definition at line 66 of file EventPoolCapacityCallbackIfc.h.

◆ EVENTPOOL_THRESHOLD_DIVISOR_RECOVERED

constexpr size_t imt::base::dff::runtime::EventPoolCapacityCallbackIfc::EVENTPOOL_THRESHOLD_DIVISOR_RECOVERED {5U}
staticconstexpr

Upper threshold for recovered: 20% capacity remaining.

Definition at line 71 of file EventPoolCapacityCallbackIfc.h.


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