1 Functions of class **afb_event**
2 ==============================
10 * Checks whether the 'event' is valid or not.
12 * @param event the event to check
14 * @return 0 if not valid or 1 if valid.
16 int afb_event_is_valid(
24 * Gets the name associated to 'event'.
26 * @param event the event whose name is requested
28 * @return the name of the event
30 * The returned name can be used until call to 'afb_event_unref'.
31 * It shouldn't be freed.
33 const char *afb_event_name(
41 * Decrease the count of references to 'event'.
42 * Call this function when the evenid is no more used.
43 * It destroys the event_x2 when the reference count falls to zero.
45 * @param event the event
55 * Increases the count of references to 'event'
57 * @param event the event
61 afb_event_t *afb_event_addref(
67 ### afb_event_broadcast
71 * Broadcasts widely an event of 'event' with the data 'object'.
72 * 'object' can be NULL.
74 * For convenience, the function calls 'json_object_put' for 'object'.
75 * Thus, in the case where 'object' should remain available after
76 * the function returns, the function 'json_object_get' shall be used.
78 * @param event the event to broadcast
79 * @param object the companion object to associate to the broadcasted event (can be NULL)
81 * @return 0 in case of success or -1 in case of error
83 int afb_event_broadcast(
85 struct json_object *object);
92 * Pushes an event of 'event' with the data 'object' to its observers.
93 * 'object' can be NULL.
95 * For convenience, the function calls 'json_object_put' for 'object'.
96 * Thus, in the case where 'object' should remain available after
97 * the function returns, the function 'json_object_get' shall be used.
99 * @param event the event to push
100 * @param object the companion object to associate to the pushed event (can be NULL)
103 * * 1 if at least one client listen for the event
104 * * 0 if no more client listen for the event
105 * * -1 in case of error (the event can't be delivered)
109 struct json_object *object);