4 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #ifndef _SENSOR_CALLBACK_DELIVERER_H_
21 #define _SENSOR_CALLBACK_DELIVERER_H_
24 #include <client_common.h>
29 class sensor_callback_deliverer {
31 sensor_callback_deliverer();
32 ~sensor_callback_deliverer();
36 bool is_running(void);
38 bool push(client_callback_info *ci);
41 static gboolean callback_dispatcher(gpointer data);
43 std::atomic_bool m_running;
45 GAsyncQueue *m_callbacks;
46 std::thread *m_deliverer;
51 void deliver_to_main_loop(client_callback_info *ci);
54 #endif /* _SENSOR_CALLBACK_DELIVERER_H_ */