3 title: Functions of class afb_event
5 https://git.automotivelinux.org/src/app-framework-binder/plain/docs/reference-v3/func-event.md?h=master
8 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/apis_services/master/app-framework-binder-developer-guides-api-services-book.yml -->
10 Functions of class **afb_event**
11 ==============================
15 ### afb_event_is_valid
19 * Checks whether the 'event' is valid or not.
21 * @param event the event to check
23 * @return 0 if not valid or 1 if valid.
25 int afb_event_is_valid(
33 * Gets the name associated to 'event'.
35 * @param event the event whose name is requested
37 * @return the name of the event
39 * The returned name can be used until call to 'afb_event_unref'.
40 * It shouldn't be freed.
42 const char *afb_event_name(
50 * Decrease the count of references to 'event'.
51 * Call this function when the evenid is no more used.
52 * It destroys the event_x2 when the reference count falls to zero.
54 * @param event the event
64 * Increases the count of references to 'event'
66 * @param event the event
70 afb_event_t *afb_event_addref(
76 ### afb_event_broadcast
80 * Broadcasts widely an event of 'event' with the data 'object'.
81 * 'object' can be NULL.
83 * For convenience, the function calls 'json_object_put' for 'object'.
84 * Thus, in the case where 'object' should remain available after
85 * the function returns, the function 'json_object_get' shall be used.
87 * @param event the event to broadcast
88 * @param object the companion object to associate to the broadcasted event (can be NULL)
90 * @return 0 in case of success or -1 in case of error
92 int afb_event_broadcast(
94 struct json_object *object);
101 * Pushes an event of 'event' with the data 'object' to its observers.
102 * 'object' can be NULL.
104 * For convenience, the function calls 'json_object_put' for 'object'.
105 * Thus, in the case where 'object' should remain available after
106 * the function returns, the function 'json_object_get' shall be used.
108 * @param event the event to push
109 * @param object the companion object to associate to the pushed event (can be NULL)
112 * * 1 if at least one client listen for the event
113 * * 0 if no more client listen for the event
114 * * -1 in case of error (the event can't be delivered)
118 struct json_object *object);