Distributed Publish Subscribe for IoT
event.h
Go to the documentation of this file.
1 /*
2  *******************************************************************
3  *
4  * Copyright 2016 Intel Corporation All rights reserved.
5  *
6  *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21  */
22 
23 #ifndef _DPS_EVENT_H
24 #define _DPS_EVENT_H
25 
26 #include <uv.h>
27 #include <dps/err.h>
28 #include <dps/dps.h>
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
37 typedef struct _DPS_Event DPS_Event;
38 
43 
49 void DPS_DestroyEvent(DPS_Event* event);
50 
57 void DPS_SetEventData(DPS_Event* event, void* data);
58 
64 void* DPS_GetEventData(const DPS_Event* event);
65 
72 void DPS_SignalEvent(DPS_Event* event, DPS_Status status);
73 
82 
91 DPS_Status DPS_TimedWaitForEvent(DPS_Event* event, uint16_t timeout);
92 
93 #ifdef __cplusplus
94 }
95 #endif
96 
97 #endif
void DPS_DestroyEvent(DPS_Event *event)
Destroy an event and free resources.
int DPS_Status
Definition: err.h:30
void DPS_SetEventData(DPS_Event *event, void *data)
Set the event application data pointer.
struct _DPS_Event DPS_Event
Opaque type for an event.
Definition: event.h:37
DPS_Status DPS_TimedWaitForEvent(DPS_Event *event, uint16_t timeout)
Wait for an event to be signalled with a timeout.
DPS_Event * DPS_CreateEvent()
Create and initialize an event.
void DPS_SignalEvent(DPS_Event *event, DPS_Status status)
Signal an event.
DPS_Status DPS_WaitForEvent(DPS_Event *event)
Wait for an event to be signalled.
void * DPS_GetEventData(const DPS_Event *event)
Get the event application data pointer.