BeRTOS
|
Notifier obj (interface). More...
Go to the source code of this file.
Data Structures | |
struct | DNotifier |
Base object for receive and forward messages. More... | |
struct | DFilterMap |
Map for messages. More... | |
struct | DFilter |
A filter is an interface between two notifier. More... | |
Defines | |
#define | DCONNECT(src, tgt, map, opt) |
Macro that connect src notifier to tgt using map and passing opt for filtering option. | |
Typedefs | |
typedef unsigned int | dfilter_mask_t |
Type for filter-mask checking. | |
Functions | |
void | filter_init (DFilter *f, const DFilterMap *map, bool masked, DNotifier *source, DNotifier *target) |
Filter init. | |
void | filter_update (DFilter *f, dtag_t tag, dval_t val) |
Filter update function without masking capabilities. | |
void | filter_mask_update (DFilter *f, dtag_t tag, dval_t val) |
Filter update function with masking capabilities. | |
void | notifier_init (DNotifier *n) |
Notifier init. | |
void | dnotify (DNotifier *target, dtag_t tag, dval_t val) |
Macro to notify the target object. | |
void | dnotify_targets (DNotifier *target, dtag_t tag, dval_t val) |
Macro to notify all the targets of target object. |
Notifier obj (interface).
Definition in file dnotifier.h.
#define DCONNECT | ( | src, | |
tgt, | |||
map, | |||
opt | |||
) |
do { \ static DFilter _filter_; /* Declare a filter */ \ filter_init(&(_filter_), map, opt, src, tgt); /* Init it. */ \ } while (0)
Macro that connect src notifier to tgt using map and passing opt for filtering option.
It declares a static filter to achieve connection and messages translation.
Definition at line 143 of file dnotifier.h.
void filter_init | ( | DFilter * | f, |
const DFilterMap * | map, | ||
bool | masked, | ||
DNotifier * | source, | ||
DNotifier * | target | ||
) |
Filter init.
Filter init.
If masked is true, all the fields value in map must be interpreted as a mask of bits.
Definition at line 143 of file dnotifier.c.
Filter update function with masking capabilities.
Filter update function with masking capabilities.
If a match is found change them to the corresponding ones in the map. If map is NULL the filter is trasparent and all messages sent to filter will be forwarded to its target.
Definition at line 106 of file dnotifier.c.
Filter update function without masking capabilities.
Filter update function without masking capabilities.
If a match is found change them to the corresponding ones in the map. If map is NULL the filter is trasparent and all messages sent to filter will be forwarded to its target.
Definition at line 70 of file dnotifier.c.