le_eventLoop.h
Go to the documentation of this file.
1 
498 //--------------------------------------------------------------------------------------------------
506 #ifndef LEGATO_EVENTLOOP_INCLUDE_GUARD
507 #define LEGATO_EVENTLOOP_INCLUDE_GUARD
508 
509 
510 //--------------------------------------------------------------------------------------------------
517 //--------------------------------------------------------------------------------------------------
518 typedef struct le_event_Id* le_event_Id_t;
519 
520 
521 //--------------------------------------------------------------------------------------------------
537 //--------------------------------------------------------------------------------------------------
538 
539 #ifdef __cplusplus
540  #define LE_CI_LINKAGE extern "C"
541 #else
542  #define LE_CI_LINKAGE
543 #endif
544 
545 // This macro is set by the build system. However, if it hasn't been set, use a sensible default.
546 // TODO: Remove this.
547 #ifndef COMPONENT_INIT
548 
551  #define COMPONENT_INIT LE_CI_LINKAGE LE_SHARED void _le_event_InitializeComponent(void)
552 #endif
553 
555 #define LE_EVENT_INIT_HANDLER COMPONENT_INIT
556 
557 
558 //--------------------------------------------------------------------------------------------------
566 //--------------------------------------------------------------------------------------------------
567 typedef void (*le_event_HandlerFunc_t)
568 (
569  void* reportPtr
570 );
571 
572 
573 //--------------------------------------------------------------------------------------------------
584 //--------------------------------------------------------------------------------------------------
585 typedef void (*le_event_LayeredHandlerFunc_t)
586 (
587  void* reportPtr,
588  void* secondLayerFunc
589 );
590 
591 
592 //--------------------------------------------------------------------------------------------------
600 //--------------------------------------------------------------------------------------------------
601 typedef void (*le_event_DeferredFunc_t)
602 (
603  void* param1Ptr,
604  void* param2Ptr
605 );
606 
607 
608 //--------------------------------------------------------------------------------------------------
615 //--------------------------------------------------------------------------------------------------
616 typedef struct le_event_Handler* le_event_HandlerRef_t;
617 
618 
619 //--------------------------------------------------------------------------------------------------
628 //--------------------------------------------------------------------------------------------------
630 (
631  const char* name,
632  size_t payloadSize
633 );
634 
635 
636 //--------------------------------------------------------------------------------------------------
646 //--------------------------------------------------------------------------------------------------
648 (
649  const char* name
650 );
651 
652 
653 //--------------------------------------------------------------------------------------------------
666 //--------------------------------------------------------------------------------------------------
668 (
669  const char* name,
670  le_event_Id_t eventId,
671  le_event_HandlerFunc_t handlerFunc
672 );
673 
674 
675 //--------------------------------------------------------------------------------------------------
690 //--------------------------------------------------------------------------------------------------
692 (
693  const char* name,
694  le_event_Id_t eventId,
695  le_event_LayeredHandlerFunc_t firstLayerFunc,
696  void* secondLayerFunc
697 );
698 
699 
700 //--------------------------------------------------------------------------------------------------
706 //--------------------------------------------------------------------------------------------------
708 (
709  le_event_HandlerRef_t handlerRef
710 );
711 
712 
713 //--------------------------------------------------------------------------------------------------
722 //--------------------------------------------------------------------------------------------------
723 void le_event_Report
724 (
725  le_event_Id_t eventId,
726  void* payloadPtr,
727  size_t payloadSize
728 );
729 
730 
731 //--------------------------------------------------------------------------------------------------
742 //--------------------------------------------------------------------------------------------------
744 (
745  le_event_Id_t eventId,
746  void* objectPtr
747 );
749 
750 
751 //--------------------------------------------------------------------------------------------------
758 //--------------------------------------------------------------------------------------------------
760 (
761  le_event_HandlerRef_t handlerRef,
762  void* contextPtr
763 );
764 
765 
766 //--------------------------------------------------------------------------------------------------
776 //--------------------------------------------------------------------------------------------------
778 (
779  void
780 );
781 
782 
783 //--------------------------------------------------------------------------------------------------
788 //--------------------------------------------------------------------------------------------------
790 (
792  void* param1Ptr,
793  void* param2Ptr
794 );
795 
796 
797 //--------------------------------------------------------------------------------------------------
802 //--------------------------------------------------------------------------------------------------
804 (
805  le_thread_Ref_t thread,
807  void* param1Ptr,
808  void* param2Ptr
809 );
810 
811 
812 //--------------------------------------------------------------------------------------------------
824 //--------------------------------------------------------------------------------------------------
825 void le_event_RunLoop
826 (
827  void
828 )
829 __attribute__ ((noreturn));
830 
831 
832 //--------------------------------------------------------------------------------------------------
843 //--------------------------------------------------------------------------------------------------
844 int le_event_GetFd
845 (
846  void
847 );
848 
849 
850 //--------------------------------------------------------------------------------------------------
865 //--------------------------------------------------------------------------------------------------
867 (
868  void
869 );
870 
871 
872 #endif // LEGATO_EVENTLOOP_INCLUDE_GUARD
struct le_thread * le_thread_Ref_t
Definition: le_thread.h:167
void(* le_event_DeferredFunc_t)(void *param1Ptr, void *param2Ptr)
Definition: le_eventLoop.h:602
void le_event_ReportWithRefCounting(le_event_Id_t eventId, void *objectPtr)
le_result_t
Definition: le_basics.h:35
void le_event_RunLoop(void)
struct le_event_Id * le_event_Id_t
Definition: le_eventLoop.h:518
le_result_t le_event_ServiceLoop(void)
le_event_Id_t le_event_CreateIdWithRefCounting(const char *name)
void le_event_Report(le_event_Id_t eventId, void *payloadPtr, size_t payloadSize)
void le_event_SetContextPtr(le_event_HandlerRef_t handlerRef, void *contextPtr)
le_event_HandlerRef_t le_event_AddLayeredHandler(const char *name, le_event_Id_t eventId, le_event_LayeredHandlerFunc_t firstLayerFunc, void *secondLayerFunc)
void(* le_event_LayeredHandlerFunc_t)(void *reportPtr, void *secondLayerFunc)
Definition: le_eventLoop.h:586
int le_event_GetFd(void)
le_event_HandlerRef_t le_event_AddHandler(const char *name, le_event_Id_t eventId, le_event_HandlerFunc_t handlerFunc)
void le_event_QueueFunction(le_event_DeferredFunc_t func, void *param1Ptr, void *param2Ptr)
struct le_event_Handler * le_event_HandlerRef_t
Definition: le_eventLoop.h:616
void * le_event_GetContextPtr(void)
le_event_Id_t le_event_CreateId(const char *name, size_t payloadSize)
void le_event_QueueFunctionToThread(le_thread_Ref_t thread, le_event_DeferredFunc_t func, void *param1Ptr, void *param2Ptr)
void(* le_event_HandlerFunc_t)(void *reportPtr)
Definition: le_eventLoop.h:568
void le_event_RemoveHandler(le_event_HandlerRef_t handlerRef)