All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
le_eventLoop.h
Go to the documentation of this file.
1 
613 //--------------------------------------------------------------------------------------------------
621 #ifndef LEGATO_EVENTLOOP_INCLUDE_GUARD
622 #define LEGATO_EVENTLOOP_INCLUDE_GUARD
623 
624 
625 //--------------------------------------------------------------------------------------------------
632 //--------------------------------------------------------------------------------------------------
633 typedef struct le_event_Id* le_event_Id_t;
634 
635 
636 //--------------------------------------------------------------------------------------------------
652 //--------------------------------------------------------------------------------------------------
653 
654 #ifdef __cplusplus
655  #define LE_CI_LINKAGE extern "C"
656 #else
657  #define LE_CI_LINKAGE
658 #endif
659 
660 // This macro is set by the build system. However, if it hasn't been set, use a sensable default.
661 #ifndef COMPONENT_INIT
662  #define COMPONENT_INIT LE_CI_LINKAGE void _le_event_InitializeComponent(void)
663 #endif
664 
666 #define LE_EVENT_INIT_HANDLER COMPONENT_INIT
667 
668 
669 //--------------------------------------------------------------------------------------------------
677 //--------------------------------------------------------------------------------------------------
678 typedef void (*le_event_HandlerFunc_t)
679 (
680  void* reportPtr
681 );
682 
683 
684 //--------------------------------------------------------------------------------------------------
695 //--------------------------------------------------------------------------------------------------
696 typedef void (*le_event_LayeredHandlerFunc_t)
697 (
698  void* reportPtr,
699  void* secondLayerFunc
700 );
701 
702 
703 //--------------------------------------------------------------------------------------------------
709 //--------------------------------------------------------------------------------------------------
710 typedef void (*le_event_FdHandlerFunc_t)
711 (
712  int fd
713 );
714 
715 
716 //--------------------------------------------------------------------------------------------------
724 //--------------------------------------------------------------------------------------------------
725 typedef void (*le_event_DeferredFunc_t)
726 (
727  void* param1Ptr,
728  void* param2Ptr
729 );
730 
731 
732 //--------------------------------------------------------------------------------------------------
738 //--------------------------------------------------------------------------------------------------
739 typedef struct le_event_FdMonitor* le_event_FdMonitorRef_t;
740 
741 
742 //--------------------------------------------------------------------------------------------------
749 //--------------------------------------------------------------------------------------------------
750 typedef struct le_event_Handler* le_event_HandlerRef_t;
751 
752 
753 //--------------------------------------------------------------------------------------------------
760 //--------------------------------------------------------------------------------------------------
761 typedef struct le_event_FdHandler* le_event_FdHandlerRef_t;
762 
763 
764 //--------------------------------------------------------------------------------------------------
768 //--------------------------------------------------------------------------------------------------
769 typedef enum
770 {
777 }
779 
780 #define LE_EVENT_NUM_FD_EVENT_TYPES 6
781 
782 
783 //--------------------------------------------------------------------------------------------------
792 //--------------------------------------------------------------------------------------------------
794 (
795  const char* name,
796  size_t payloadSize
797 );
798 
799 
800 //--------------------------------------------------------------------------------------------------
810 //--------------------------------------------------------------------------------------------------
812 (
813  const char* name
814 );
815 
816 
817 //--------------------------------------------------------------------------------------------------
830 //--------------------------------------------------------------------------------------------------
832 (
833  const char* name,
834  le_event_Id_t eventId,
835  le_event_HandlerFunc_t handlerFunc
836 );
837 
838 
839 //--------------------------------------------------------------------------------------------------
854 //--------------------------------------------------------------------------------------------------
856 (
857  const char* name,
858  le_event_Id_t eventId,
859  le_event_LayeredHandlerFunc_t firstLayerFunc,
860  void* secondLayerFunc
861 );
862 
863 
864 //--------------------------------------------------------------------------------------------------
870 //--------------------------------------------------------------------------------------------------
872 (
873  le_event_HandlerRef_t handlerRef
874 );
875 
876 
877 //--------------------------------------------------------------------------------------------------
886 //--------------------------------------------------------------------------------------------------
887 void le_event_Report
888 (
889  le_event_Id_t eventId,
890  void* payloadPtr,
891  size_t payloadSize
892 );
893 
894 
895 //--------------------------------------------------------------------------------------------------
906 //--------------------------------------------------------------------------------------------------
908 (
909  le_event_Id_t eventId,
910  void* objectPtr
911 );
913 
914 
915 //--------------------------------------------------------------------------------------------------
922 //--------------------------------------------------------------------------------------------------
924 (
925  le_event_HandlerRef_t handlerRef,
926  void* contextPtr
927 );
928 
929 
930 //--------------------------------------------------------------------------------------------------
940 //--------------------------------------------------------------------------------------------------
942 (
943  void
944 );
945 
946 
947 //--------------------------------------------------------------------------------------------------
962 //--------------------------------------------------------------------------------------------------
964 (
965  const char* name,
966  int fd
967 );
968 
969 
970 //--------------------------------------------------------------------------------------------------
987 //--------------------------------------------------------------------------------------------------
989 (
990  le_event_FdMonitorRef_t monitorRef,
991  le_event_FdEventType_t eventType,
992  le_event_FdHandlerFunc_t handlerFunc
993 );
994 
995 
996 //--------------------------------------------------------------------------------------------------
1001 //--------------------------------------------------------------------------------------------------
1003 (
1004  le_event_FdHandlerRef_t handlerRef,
1005  void* contextPtr
1006 );
1007 
1008 
1009 //--------------------------------------------------------------------------------------------------
1013 //--------------------------------------------------------------------------------------------------
1015 (
1016  le_event_FdHandlerRef_t handlerRef
1017 );
1018 
1019 
1020 //--------------------------------------------------------------------------------------------------
1026 //--------------------------------------------------------------------------------------------------
1028 (
1029  le_event_FdMonitorRef_t monitorRef
1030 );
1031 
1032 
1033 //--------------------------------------------------------------------------------------------------
1038 //--------------------------------------------------------------------------------------------------
1040 (
1042  void* param1Ptr,
1043  void* param2Ptr
1044 );
1045 
1046 
1047 //--------------------------------------------------------------------------------------------------
1052 //--------------------------------------------------------------------------------------------------
1054 (
1055  le_thread_Ref_t thread,
1057  void* param1Ptr,
1058  void* param2Ptr
1059 );
1060 
1061 
1062 //--------------------------------------------------------------------------------------------------
1074 //--------------------------------------------------------------------------------------------------
1075 void le_event_RunLoop
1076 (
1077  void
1078 )
1079 __attribute__ ((noreturn));
1080 
1081 
1082 //--------------------------------------------------------------------------------------------------
1093 //--------------------------------------------------------------------------------------------------
1094 int le_event_GetFd
1095 (
1096  void
1097 );
1098 
1099 
1100 //--------------------------------------------------------------------------------------------------
1115 //--------------------------------------------------------------------------------------------------
1117 (
1118  void
1119 );
1120 
1121 
1122 #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:739
void le_event_ReportWithRefCounting(le_event_Id_t eventId, void *objectPtr)
Data is available for reading.
Definition: le_eventLoop.h:771
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:775
void(* le_event_HandlerFunc_t)(void *reportPtr)
Definition: le_eventLoop.h:679
void le_event_RunLoop(void)
struct le_event_FdHandler * le_event_FdHandlerRef_t
Definition: le_eventLoop.h:761
struct le_event_Id * le_event_Id_t
Definition: le_eventLoop.h:633
le_event_FdEventType_t
Definition: le_eventLoop.h:769
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:774
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:726
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:711
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:750
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:772
Experienced an error.
Definition: le_eventLoop.h:776
void le_event_ClearFdHandler(le_event_FdHandlerRef_t handlerRef)
void(* le_event_LayeredHandlerFunc_t)(void *reportPtr, void *secondLayerFunc)
Definition: le_eventLoop.h:697
Ready to accept data for writing.
Definition: le_eventLoop.h:773
void le_event_RemoveHandler(le_event_HandlerRef_t handlerRef)