Static Callable#

Defined in namespace hal

#include <libhal-util/static_callable.hpp>

group StaticCallable

Functions

inline explicit static_callable(hal::callback<return_t(args_t... p_args)> p_callback)#

Construct a new static callable object.

Parameters:

p_callback – - when the static callback function is called, it will call this callback

inline auto *get_handler()#

Get the static function’s address.

Returns:

auto* - static function’s address

static inline return_t handler(args_t... p_args)#

private free function that calls the polymorphic callback. This is the function that can be used as entries in an interrupt vector tables or passed as a function pointer to C API.

Parameters:

p_args – - list of arguments

Returns:

return_t - the return type of the callback

Variables

static hal::callback<return_t(args_t... p_args)> callback#

the polymorphic callback to be

template<class owner_class, int reference_designator, typename signature>
class static_callable#

General class which will be used to allow for signature to be used and then split by the below class.

Template Parameters:
  • owner_class – class that this static callable belongs to

  • reference_designator – this template argument is used to generate unique static objects for each needed callback

  • signature – function signature to be split up in the static_callable specialization

template<class owner_class, int reference_designator, typename return_t, typename ...args_t>
class static_callable<owner_class, reference_designator, return_t(args_t... p_args)>#
#include <static_callable.hpp>

Specialization of static_callable with the return type and arguments split up.

Template Parameters:
  • owner_class – see static_callable

  • reference_designator – see static_callable

  • return_t – function’s return type

  • args_t – function’s set of arguments

Public Functions

inline explicit static_callable(hal::callback<return_t(args_t... p_args)> p_callback)#

Construct a new static callable object.

Parameters:

p_callback – - when the static callback function is called, it will call this callback

inline auto *get_handler()#

Get the static function’s address.

Returns:

auto* - static function’s address