All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
le_eventLoop.h
Go to the documentation of this file.
1 
615 //--------------------------------------------------------------------------------------------------
623 #ifndef LEGATO_EVENTLOOP_INCLUDE_GUARD
624 #define LEGATO_EVENTLOOP_INCLUDE_GUARD
625 
626 
627 //--------------------------------------------------------------------------------------------------
634 //--------------------------------------------------------------------------------------------------
635 typedef struct le_event_Id* le_event_Id_t;
636 
637 
638 //--------------------------------------------------------------------------------------------------
654 //--------------------------------------------------------------------------------------------------
655 
656 #ifdef __cplusplus
657  #define LE_CI_LINKAGE extern "C"
658 #else
659  #define LE_CI_LINKAGE
660 #endif
661 
662 // This macro is set by the build system. However, if it hasn't been set, use a sensible default.
663 #ifndef COMPONENT_INIT
664  #define COMPONENT_INIT LE_CI_LINKAGE void _le_event_InitializeComponent(void)
665 #endif
666 
668 #define LE_EVENT_INIT_HANDLER COMPONENT_INIT
669 
670 
671 //--------------------------------------------------------------------------------------------------
679 //--------------------------------------------------------------------------------------------------
680 typedef void (*le_event_HandlerFunc_t)
681 (
682  void* reportPtr
683 );
684 
685 
686 //--------------------------------------------------------------------------------------------------
697 //--------------------------------------------------------------------------------------------------
698 typedef void (*le_event_LayeredHandlerFunc_t)
699 (
700  void* reportPtr,
701  void* secondLayerFunc
702 );
703 
704 
705 //--------------------------------------------------------------------------------------------------
711 //--------------------------------------------------------------------------------------------------
712 typedef void (*le_event_FdHandlerFunc_t)
713 (
714  int fd
715 );
716 
717 
718 //--------------------------------------------------------------------------------------------------
726 //--------------------------------------------------------------------------------------------------
727 typedef void (*le_event_DeferredFunc_t)
728 (
729  void* param1Ptr,
730  void* param2Ptr
731 );
732 
733 
734 //--------------------------------------------------------------------------------------------------
740 //--------------------------------------------------------------------------------------------------
741 typedef struct le_event_FdMonitor* le_event_FdMonitorRef_t;
742 
743 
744 //--------------------------------------------------------------------------------------------------
751 //--------------------------------------------------------------------------------------------------
752 typedef struct le_event_Handler* le_event_HandlerRef_t;
753 
754 
755 //--------------------------------------------------------------------------------------------------
762 //--------------------------------------------------------------------------------------------------
763 typedef struct le_event_FdHandler* le_event_FdHandlerRef_t;
764 
765 
766 //--------------------------------------------------------------------------------------------------
770 //--------------------------------------------------------------------------------------------------
771 typedef enum
772 {
779 }
781 
782 #define LE_EVENT_NUM_FD_EVENT_TYPES 6
783 
784 
785 //--------------------------------------------------------------------------------------------------
794 //--------------------------------------------------------------------------------------------------
796 (
797  const char* name,
798  size_t payloadSize
799 );
800 
801 
802 //--------------------------------------------------------------------------------------------------
812 //--------------------------------------------------------------------------------------------------
814 (
815  const char* name
816 );
817 
818 
819 //--------------------------------------------------------------------------------------------------
832 //--------------------------------------------------------------------------------------------------
834 (
835  const char* name,
836  le_event_Id_t eventId,
837  le_event_HandlerFunc_t handlerFunc
838 );
839 
840 
841 //--------------------------------------------------------------------------------------------------
856 //--------------------------------------------------------------------------------------------------
858 (
859  const char* name,
860  le_event_Id_t eventId,
861  le_event_LayeredHandlerFunc_t firstLayerFunc,
862  void* secondLayerFunc
863 );
864 
865 
866 //--------------------------------------------------------------------------------------------------
872 //--------------------------------------------------------------------------------------------------
874 (
875  le_event_HandlerRef_t handlerRef
876 );
877 
878 
879 //--------------------------------------------------------------------------------------------------
888 //--------------------------------------------------------------------------------------------------
889 void le_event_Report
890 (
891  le_event_Id_t eventId,
892  void* payloadPtr,
893  size_t payloadSize
894 );
895 
896 
897 //--------------------------------------------------------------------------------------------------
908 //--------------------------------------------------------------------------------------------------
910 (
911  le_event_Id_t eventId,
912  void* objectPtr
913 );
915 
916 
917 //--------------------------------------------------------------------------------------------------
924 //--------------------------------------------------------------------------------------------------
926 (
927  le_event_HandlerRef_t handlerRef,
928  void* contextPtr
929 );
930 
931 
932 //--------------------------------------------------------------------------------------------------
942 //--------------------------------------------------------------------------------------------------
944 (
945  void
946 );
947 
948 
949 //--------------------------------------------------------------------------------------------------
964 //--------------------------------------------------------------------------------------------------
966 (
967  const char* name,
968  int fd
969 );
970 
971 
972 //--------------------------------------------------------------------------------------------------
989 //--------------------------------------------------------------------------------------------------
991 (
992  le_event_FdMonitorRef_t monitorRef,
993  le_event_FdEventType_t eventType,
994  le_event_FdHandlerFunc_t handlerFunc
995 );
996 
997 
998 //--------------------------------------------------------------------------------------------------
1003 //--------------------------------------------------------------------------------------------------
1005 (
1006  le_event_FdHandlerRef_t handlerRef,
1007  void* contextPtr
1008 );
1009 
1010 
1011 //--------------------------------------------------------------------------------------------------
1015 //--------------------------------------------------------------------------------------------------
1017 (
1018  le_event_FdHandlerRef_t handlerRef
1019 );
1020 
1021 
1022 //--------------------------------------------------------------------------------------------------
1026 //--------------------------------------------------------------------------------------------------
1028 (
1029  le_event_FdMonitorRef_t monitorRef,
1030  le_event_FdEventType_t eventType
1031 );
1032 
1033 
1034 //--------------------------------------------------------------------------------------------------
1040 //--------------------------------------------------------------------------------------------------
1042 (
1043  le_event_FdMonitorRef_t monitorRef
1044 );
1045 
1046 
1047 //--------------------------------------------------------------------------------------------------
1052 //--------------------------------------------------------------------------------------------------
1054 (
1056  void* param1Ptr,
1057  void* param2Ptr
1058 );
1059 
1060 
1061 //--------------------------------------------------------------------------------------------------
1066 //--------------------------------------------------------------------------------------------------
1068 (
1069  le_thread_Ref_t thread,
1071  void* param1Ptr,
1072  void* param2Ptr
1073 );
1074 
1075 
1076 //--------------------------------------------------------------------------------------------------
1088 //--------------------------------------------------------------------------------------------------
1089 void le_event_RunLoop
1090 (
1091  void
1092 )
1093 __attribute__ ((noreturn));
1094 
1095 
1096 //--------------------------------------------------------------------------------------------------
1107 //--------------------------------------------------------------------------------------------------
1108 int le_event_GetFd
1109 (
1110  void
1111 );
1112 
1113 
1114 //--------------------------------------------------------------------------------------------------
1129 //--------------------------------------------------------------------------------------------------
1131 (
1132  void
1133 );
1134 
1135 
1136 #endif // LEGATO_EVENTLOOP_INCLUDE_GUARD
struct le_thread * le_thread_Ref_t
Definition: le_thread.h:156
struct le_event_FdMonitor * le_event_FdMonitorRef_t
Definition: le_eventLoop.h:741
void le_event_ClearFdHandlerByEventType(le_event_FdMonitorRef_t monitorRef, le_event_FdEventType_t eventType)
void le_event_ReportWithRefCounting(le_event_Id_t eventId, void *objectPtr)
Data is available for reading.
Definition: le_eventLoop.h:773
le_event_FdHandlerRef_t le_event_SetFdHandler(le_event_FdMonitorRef_t monitorRef, le_event_FdEventType_t eventType, le_event_FdHandlerFunc_t handlerFunc)
le_result_t
Definition: le_basics.h:34
Far end shutdown their writing while we were still reading.
Definition: le_eventLoop.h:777
void(* le_event_HandlerFunc_t)(void *reportPtr)
Definition: le_eventLoop.h:681
void le_event_RunLoop(void)
struct le_event_FdHandler * le_event_FdHandlerRef_t
Definition: le_eventLoop.h:763
struct le_event_Id * le_event_Id_t
Definition: le_eventLoop.h:635
le_event_FdEventType_t
Definition: le_eventLoop.h:771
le_result_t le_event_ServiceLoop(void)
void le_event_DeleteFdMonitor(le_event_FdMonitorRef_t monitorRef)
le_event_Id_t le_event_CreateIdWithRefCounting(const char *name)
Far end shutdown their reading while we were still writing.
Definition: le_eventLoop.h:776
void le_event_Report(le_event_Id_t eventId, void *payloadPtr, size_t payloadSize)
void(* le_event_DeferredFunc_t)(void *param1Ptr, void *param2Ptr)
Definition: le_eventLoop.h:728
le_event_FdMonitorRef_t le_event_CreateFdMonitor(const char *name, int fd)
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_SetFdHandlerContextPtr(le_event_FdHandlerRef_t handlerRef, void *contextPtr)
void(* le_event_FdHandlerFunc_t)(int fd)
Definition: le_eventLoop.h:713
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:752
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)
Urgent/out-of-band data is available for reading.
Definition: le_eventLoop.h:774
Experienced an error.
Definition: le_eventLoop.h:778
void le_event_ClearFdHandler(le_event_FdHandlerRef_t handlerRef)
void(* le_event_LayeredHandlerFunc_t)(void *reportPtr, void *secondLayerFunc)
Definition: le_eventLoop.h:699
Ready to accept data for writing.
Definition: le_eventLoop.h:775
void le_event_RemoveHandler(le_event_HandlerRef_t handlerRef)