ODeV framework  v2
IEventSrcVtbl.h
Go to the documentation of this file.
1 
30 #ifndef INCLUDE_EVENTS_IEVENTSRCVTBL_H_
31 #define INCLUDE_EVENTS_IEVENTSRCVTBL_H_
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 #include "systypes.h"
38 #include "syserror.h"
39 #include "systp.h"
40 
41 typedef struct _IEventSrc_vtbl IEventSrc_vtbl;
42 
51  uint32_t (*GetMaxListenerCount)(const IEventSrc *this);
52  sys_error_code_t (*SendEvent)(const IEventSrc *this, const IEvent *pxEvent, void *pvParams);
53 };
54 
58 struct _IEventSrc {
63 };
64 
65 
66 // Public API declaration
67 //***********************
68 
69 
70 // Inline functions definition
71 // ***************************
72 
73 SYS_DEFINE_INLINE
75  return this->vptr->Init(this);
76 }
77 
78 SYS_DEFINE_INLINE
80  return this->vptr->AddEventListener(this, pListener);
81 }
82 
83 SYS_DEFINE_INLINE
85  return this->vptr->RemoveEventListener(this, pListener);
86 }
87 
88 SYS_DEFINE_INLINE
89 uint32_t IEventSrcGetMaxListenerCount(const IEventSrc *this) {
90  return this->vptr->GetMaxListenerCount(this);
91 }
92 
93 SYS_DEFINE_INLINE
94 sys_error_code_t IEventSrcSendEvent(const IEventSrc *this, const IEvent *pxEvent, void *pvParams) {
95  return this->vptr->SendEvent(this, pxEvent, pvParams);
96 }
97 
98 #ifdef __cplusplus
99 }
100 #endif
101 
102 #endif /* INCLUDE_EVENTS_IEVENTSRCVTBL_H_ */
SYS_DEFINE_INLINE sys_error_code_t IEventSrcSendEvent(const IEventSrc *this, const IEvent *pxEvent, void *pvParams)
Definition: IEventSrcVtbl.h:94
Define the global error management API.
Definition: IEventListenerVtbl.h:56
SYS_DEFINE_INLINE sys_error_code_t IEventSrcAddEventListener(IEventSrc *this, IEventListener *pListener)
Definition: IEventSrcVtbl.h:79
sys_error_code_t(* Init)(IEventSrc *this)
Definition: IEventSrcVtbl.h:48
sys_error_code_t(* SendEvent)(const IEventSrc *this, const IEvent *pxEvent, void *pvParams)
Definition: IEventSrcVtbl.h:52
sys_error_code_t(* RemoveEventListener)(IEventSrc *this, IEventListener *pListener)
Definition: IEventSrcVtbl.h:50
sys_error_code_t(* AddEventListener)(IEventSrc *this, IEventListener *pListener)
Definition: IEventSrcVtbl.h:49
SYS_DEFINE_INLINE sys_error_code_t IEventSrcInit(IEventSrc *this)
Definition: IEventSrcVtbl.h:74
SYS_DEFINE_INLINE sys_error_code_t IEventSrcRemoveEventListener(IEventSrc *this, IEventListener *pListener)
Definition: IEventSrcVtbl.h:84
Definition: IEventSrcVtbl.h:58
Definition: IEventSrcVtbl.h:47
Common type declaration.
uint32_t(* GetMaxListenerCount)(const IEventSrc *this)
Definition: IEventSrcVtbl.h:51
SYS_DEFINE_INLINE uint32_t IEventSrcGetMaxListenerCount(const IEventSrc *this)
Definition: IEventSrcVtbl.h:89
unsigned short sys_error_code_t
Definition: syserror.h:45
Target platform definition.
const IEventSrc_vtbl * vptr
Definition: IEventSrcVtbl.h:62
Definition: IEvent.h:52