NUGU SDK Linux  1.7.6
nugu_equeue.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 SK Telecom Co., Ltd. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __NUGU_EQUEUE_H__
18 #define __NUGU_EQUEUE_H__
19 
20 #include <nugu.h>
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
68 };
69 
73 typedef void (*NuguEqueueCallback)(enum nugu_equeue_type type, void *data,
74  void *userdata);
75 
79 typedef void (*NuguEqueueDestroyCallback)(void *data);
80 
87 NUGU_API int nugu_equeue_initialize(void);
88 
92 NUGU_API void nugu_equeue_deinitialize(void);
93 
105  NuguEqueueCallback callback,
106  NuguEqueueDestroyCallback destroy_callback,
107  void *userdata);
108 
117 
128 NUGU_API int nugu_equeue_push(enum nugu_equeue_type type, void *data);
129 
134 #ifdef __cplusplus
135 }
136 #endif
137 
138 #endif
void(* NuguEqueueCallback)(enum nugu_equeue_type type, void *data, void *userdata)
Callback prototype for receiving an event.
Definition: nugu_equeue.h:73
NUGU_API int nugu_equeue_initialize(void)
Initialize the event queue.
NUGU_API int nugu_equeue_unset_handler(enum nugu_equeue_type type)
Unset handler for event type.
void(* NuguEqueueDestroyCallback)(void *data)
Callback prototype for releasing data after event delivery is done.
Definition: nugu_equeue.h:79
nugu_equeue_type
event types
Definition: nugu_equeue.h:44
NUGU_API int nugu_equeue_push(enum nugu_equeue_type type, void *data)
Push new event with data to queue and trigger event callback in GMainloop thread context.
NUGU_API void nugu_equeue_deinitialize(void)
De-initialize the event queue.
NUGU_API int nugu_equeue_set_handler(enum nugu_equeue_type type, NuguEqueueCallback callback, NuguEqueueDestroyCallback destroy_callback, void *userdata)
Set handler for event type.
@ NUGU_EQUEUE_TYPE_DIRECTIVES_CLOSED
Definition: nugu_equeue.h:64
@ NUGU_EQUEUE_TYPE_REGISTRY_FAILED
Definition: nugu_equeue.h:58
@ NUGU_EQUEUE_TYPE_EVENT_SEND_RESULT
Definition: nugu_equeue.h:52
@ NUGU_EQUEUE_TYPE_EVENT_RESPONSE
Definition: nugu_equeue.h:53
@ NUGU_EQUEUE_TYPE_REGISTRY_HEALTH
Definition: nugu_equeue.h:56
@ NUGU_EQUEUE_TYPE_SERVER_CONNECTED
Definition: nugu_equeue.h:61
@ NUGU_EQUEUE_TYPE_SERVER_DISCONNECTED
Definition: nugu_equeue.h:62
@ NUGU_EQUEUE_TYPE_MAX
Definition: nugu_equeue.h:67
@ NUGU_EQUEUE_TYPE_REGISTRY_SERVERS
Definition: nugu_equeue.h:57
@ NUGU_EQUEUE_TYPE_SEND_PING_FAILED
Definition: nugu_equeue.h:50
@ NUGU_EQUEUE_TYPE_NEW_ATTACHMENT
Definition: nugu_equeue.h:46
@ NUGU_EQUEUE_TYPE_INVALID_TOKEN
Definition: nugu_equeue.h:48
@ NUGU_EQUEUE_TYPE_NEW_DIRECTIVE
Definition: nugu_equeue.h:45