le_eventLoop.h
Go to the documentation of this file.
13 * directly through the Event Loop API or indirectly through other APIs that use the Event Loop API)16 * Every event loop has an <b>event queue</b>, which is a queue of events waiting to be handled by41 * later (when that function gets to the head of the Event Queue) by calling l@c e_event_QueueFunction().79 * - The function to be executed takes a long time, but doesn't have to be done at a high priority.250 * the handler using @c le_event_SetContextPtr(). When the handler function is called, it can call282 * If a handler is removed after the report for that event has been added to the event queue, but285 * @note To prevent race conditions, it's not permitted for one thread to remove another thread's373 * @section c_event_reportingRefCountedObjects Event Reports Containing Reference-Counted Objects389 * @c le_event_ReportWithRefCounting() passes ownership of one reference to the Event Loop API, and391 * the handler's responsibility to release its reference (using le_mem_Release()) when it's done.394 * @c le_event_CreateIdWithRefCounting() is used the same way as le_event_CreateId(), except that455 * that thread will @b not automatically run an Event Loop. To make it run an Event Loop, it must464 * Many legacy programs written on top of POSIX APIs will have previously built their own event loop465 * using poll(), select(), or some other blocking functions. It may be difficult to refactor this type of478 * on the Event Loop, @c le_event_ServiceLoop() will only perform one servicing step (i.e., call one485 * A logging keyword can be enabled to view a given thread's event handling activity. The keyword name490 * @todo Add a reference to the Process Inspector and its capabilities for inspecting Event Queues,498 //--------------------------------------------------------------------------------------------------510 //--------------------------------------------------------------------------------------------------517 //--------------------------------------------------------------------------------------------------521 //--------------------------------------------------------------------------------------------------525 * Use this macro instead of a normal function prototype to create an Initialization Event Handler537 //--------------------------------------------------------------------------------------------------545 // This macro is set by the build system. However, if it hasn't been set, use a sensible default.558 //--------------------------------------------------------------------------------------------------566 //--------------------------------------------------------------------------------------------------568 (573 //--------------------------------------------------------------------------------------------------584 //--------------------------------------------------------------------------------------------------586 (592 //--------------------------------------------------------------------------------------------------600 //--------------------------------------------------------------------------------------------------602 (608 //--------------------------------------------------------------------------------------------------615 //--------------------------------------------------------------------------------------------------619 //--------------------------------------------------------------------------------------------------628 //--------------------------------------------------------------------------------------------------636 //--------------------------------------------------------------------------------------------------646 //--------------------------------------------------------------------------------------------------653 //--------------------------------------------------------------------------------------------------666 //--------------------------------------------------------------------------------------------------675 //--------------------------------------------------------------------------------------------------690 //--------------------------------------------------------------------------------------------------700 //--------------------------------------------------------------------------------------------------706 //--------------------------------------------------------------------------------------------------713 //--------------------------------------------------------------------------------------------------722 //--------------------------------------------------------------------------------------------------731 //--------------------------------------------------------------------------------------------------739 * to the object, so the handler is responsible for releasing the object when it is finished with742 //--------------------------------------------------------------------------------------------------751 //--------------------------------------------------------------------------------------------------758 //--------------------------------------------------------------------------------------------------766 //--------------------------------------------------------------------------------------------------776 //--------------------------------------------------------------------------------------------------783 //--------------------------------------------------------------------------------------------------788 //--------------------------------------------------------------------------------------------------797 //--------------------------------------------------------------------------------------------------802 //--------------------------------------------------------------------------------------------------812 //--------------------------------------------------------------------------------------------------824 //--------------------------------------------------------------------------------------------------832 //--------------------------------------------------------------------------------------------------843 //--------------------------------------------------------------------------------------------------850 //--------------------------------------------------------------------------------------------------865 //--------------------------------------------------------------------------------------------------le_event_Id_t le_event_CreateIdWithRefCounting(const char *name)void(* le_event_LayeredHandlerFunc_t)(void *reportPtr, void *secondLayerFunc)Definition: le_eventLoop.h:586le_result_t le_event_ServiceLoop(void)void le_event_QueueFunctionToThread(le_thread_Ref_t thread, le_event_DeferredFunc_t func, void *param1Ptr, void *param2Ptr)void le_event_Report(le_event_Id_t eventId, void *payloadPtr, size_t payloadSize)void le_event_RunLoop(void)void * le_event_GetContextPtr(void)void(* le_event_DeferredFunc_t)(void *param1Ptr, void *param2Ptr)Definition: le_eventLoop.h:602le_event_Id_t le_event_CreateId(const char *name, size_t payloadSize)void le_event_SetContextPtr(le_event_HandlerRef_t handlerRef, void *contextPtr)void le_event_ReportWithRefCounting(le_event_Id_t eventId, void *objectPtr)le_event_HandlerRef_t le_event_AddHandler(const char *name, le_event_Id_t eventId, le_event_HandlerFunc_t handlerFunc)void le_event_RemoveHandler(le_event_HandlerRef_t handlerRef)le_event_HandlerRef_t le_event_AddLayeredHandler(const char *name, le_event_Id_t eventId, le_event_LayeredHandlerFunc_t firstLayerFunc, void *secondLayerFunc)int le_event_GetFd(void)void le_event_QueueFunction(le_event_DeferredFunc_t func, void *param1Ptr, void *param2Ptr)