Distributed Publish & Subscribe for IoT
event.h
Go to the documentation of this file.
1 
6 /*
7  *******************************************************************
8  *
9  * Copyright 2016 Intel Corporation All rights reserved.
10  *
11  *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
12  *
13  * Licensed under the Apache License, Version 2.0 (the "License");
14  * you may not use this file except in compliance with the License.
15  * You may obtain a copy of the License at
16  *
17  * http://www.apache.org/licenses/LICENSE-2.0
18  *
19  * Unless required by applicable law or agreed to in writing, software
20  * distributed under the License is distributed on an "AS IS" BASIS,
21  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22  * See the License for the specific language governing permissions and
23  * limitations under the License.
24  *
25  *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
26  */
27 
28 #ifndef _DPS_EVENT_H
29 #define _DPS_EVENT_H
30 
31 #include <dps/err.h>
32 #include <dps/dps.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
47 typedef struct _DPS_Event DPS_Event;
48 
55 
61 void DPS_DestroyEvent(DPS_Event* event);
62 
69 void DPS_SetEventData(DPS_Event* event, void* data);
70 
78 void* DPS_GetEventData(const DPS_Event* event);
79 
86 void DPS_SignalEvent(DPS_Event* event, DPS_Status status);
87 
96 
105 DPS_Status DPS_TimedWaitForEvent(DPS_Event* event, uint16_t timeout);
106 
109 #ifdef __cplusplus
110 }
111 #endif
112 
113 #endif
Public APIs.
void * DPS_GetEventData(const DPS_Event *event)
Get the event application data.
int DPS_Status
The status code type.
Definition: err.h:41
struct _DPS_Event DPS_Event
Opaque type for an event.
Definition: event.h:47
DPS_Event * DPS_CreateEvent(void)
Create and initialize an event.
Status codes.
void DPS_SignalEvent(DPS_Event *event, DPS_Status status)
Signal an event.
void DPS_SetEventData(DPS_Event *event, void *data)
Set the event application data.
void DPS_DestroyEvent(DPS_Event *event)
Destroy an event and free resources.
DPS_Status DPS_WaitForEvent(DPS_Event *event)
Wait for an event to be signalled.
DPS_Status DPS_TimedWaitForEvent(DPS_Event *event, uint16_t timeout)
Wait for an event to be signalled with a timeout.