BRL-CAD
|
libbu observer. More...
Files | |
file | observer.h |
Data Structures | |
struct | bu_observer |
struct | bu_observer_list |
Macros | |
#define | BU_OBSERVER_NULL ((struct bu_observer *)0) |
#define | BU_CK_OBSERVER(_op) BU_CKMAG(_op, BU_OBSERVER_MAGIC, "bu_observer magic") |
#define | BU_OBSERVER_INIT(_op) |
#define | BU_OBSERVER_INIT_ZERO { BU_OBSERVER_MAGIC, BU_VLS_INIT_ZERO, BU_VLS_INIT_ZERO } |
#define | BU_OBSERVER_LIST_INIT_ZERO { 0, 0, NULL } |
#define | BU_OBSERVER_IS_INITIALIZED(_op) (((struct bu_observer *)(_op) != BU_OBSERVER_NULL) && LIKELY((_op)->magic == BU_OBSERVER_MAGIC)) |
Typedefs | |
typedef void() | bu_observer_eval_t(void *, const char *) |
typedef struct bu_observer | bu_observer_t |
Functions | |
int | bu_observer_cmd (void *clientData, int argc, const char *argv[]) |
Routines for implementing the observer pattern. More... | |
void | bu_observer_notify (void *context, struct bu_observer_list *observers, char *self, bu_observer_eval_t *ofunc) |
void | bu_observer_free (struct bu_observer_list *) |
libbu observer.
#define BU_OBSERVER_NULL ((struct bu_observer *)0) |
Definition at line 51 of file observer.h.
#define BU_CK_OBSERVER | ( | _op | ) | BU_CKMAG(_op, BU_OBSERVER_MAGIC, "bu_observer magic") |
asserts the integrity of a non-head node bu_observer struct.
Definition at line 61 of file observer.h.
#define BU_OBSERVER_INIT | ( | _op | ) |
initializes a bu_observer struct without allocating any memory.
Definition at line 66 of file observer.h.
#define BU_OBSERVER_INIT_ZERO { BU_OBSERVER_MAGIC, BU_VLS_INIT_ZERO, BU_VLS_INIT_ZERO } |
macro suitable for declaration statement initialization of a bu_observer struct. does not allocate memory. not suitable for a head node.
Definition at line 76 of file observer.h.
#define BU_OBSERVER_LIST_INIT_ZERO { 0, 0, NULL } |
Definition at line 78 of file observer.h.
#define BU_OBSERVER_IS_INITIALIZED | ( | _op | ) | (((struct bu_observer *)(_op) != BU_OBSERVER_NULL) && LIKELY((_op)->magic == BU_OBSERVER_MAGIC)) |
returns truthfully whether a bu_observer has been initialized.
Definition at line 83 of file observer.h.
typedef void() bu_observer_eval_t(void *, const char *) |
Definition at line 40 of file observer.h.
typedef struct bu_observer bu_observer_t |
Definition at line 50 of file observer.h.
int bu_observer_cmd | ( | void * | clientData, |
int | argc, | ||
const char * | argv[] | ||
) |
Routines for implementing the observer pattern.
runs a given command, calling the corresponding observer callback if it matches.
void bu_observer_notify | ( | void * | context, |
struct bu_observer_list * | observers, | ||
char * | self, | ||
bu_observer_eval_t * | ofunc | ||
) |
Notify observers.
void bu_observer_free | ( | struct bu_observer_list * | ) |
Free observers.