CallbackMap< T, E > Class Template Reference

HiCR: HiCR::tasking::CallbackMap< T, E > Class Template Reference
HiCR
HiCR::tasking::CallbackMap< T, E > Class Template Reference

#include <callbackMap.hpp>

Public Member Functions

__INLINE__ void clear ()
 
__INLINE__ void removeCallback (const E callback)
 
__INLINE__ void setCallback (const E callback, callbackFc_t< T > fc)
 
__INLINE__ void trigger (T arg, const E callback) const
 
__INLINE__ bool isCallbackSet (const E callback) const
 

Detailed Description

template<class T, class E>
class HiCR::tasking::CallbackMap< T, E >

Defines a map that relates task-related callbacks to their corresponding callback.

The callback is defined by the user and manually triggered by other (e.g., Task) classes, as the corresponding callback occurs.

Member Function Documentation

◆ clear()

template<class T , class E >
__INLINE__ void HiCR::tasking::CallbackMap< T, E >::clear ( )
inline

Clears the callback map (no callbacks will be triggered)

◆ isCallbackSet()

template<class T , class E >
__INLINE__ bool HiCR::tasking::CallbackMap< T, E >::isCallbackSet ( const E  callback) const
inline

Checks whether the specified callback is set

Parameters
[in]callbackThe callback to check for
Returns
True, if the callback has been set; false, otherwise

◆ removeCallback()

template<class T , class E >
__INLINE__ void HiCR::tasking::CallbackMap< T, E >::removeCallback ( const E  callback)
inline

Remove a particular event's callback from the map

Parameters
[in]callbackThe callback to remove from the map

◆ setCallback()

template<class T , class E >
__INLINE__ void HiCR::tasking::CallbackMap< T, E >::setCallback ( const E  callback,
callbackFc_t< T >  fc 
)
inline

Adds a callback for a particular event

Parameters
[in]callbackThe callback to add
[in]fcThe callback function to call when the callback is triggered

◆ trigger()

template<class T , class E >
__INLINE__ void HiCR::tasking::CallbackMap< T, E >::trigger ( arg,
const E  callback 
) const
inline

Triggers the execution of the callback function for a given event

Parameters
[in]argThe argument to the trigger function.
[in]callbackThe triggered callback.

The documentation for this class was generated from the following file:
  • /home/runner/work/HiCR/HiCR/include/hicr/frontends/tasking/callbackMap.hpp