4 * Copyright (c) 2014 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_HANDLE_INFO_H_
21 #define _SENSOR_HANDLE_INFO_H_
23 #include <reg_event_info.h>
24 #include <sensor_logs.h>
26 #include <unordered_map>
29 typedef std::unordered_map<unsigned int,reg_event_info> event_info_map;
31 class sensor_handle_info {
34 sensor_id_t m_sensor_id;
40 sensor_accuracy_changed_cb_t m_accuracy_cb;
41 void *m_accuracy_user_data;
44 ~sensor_handle_info();
46 bool add_reg_event_info(unsigned int event_type, unsigned int interval, unsigned int latency, int cb_type, void *cb,void *user_data);
47 bool delete_reg_event_info(unsigned int event_type);
49 bool change_reg_event_batch(unsigned int event_type, unsigned int interval, unsigned int latency);
50 bool change_reg_event_maincontext(unsigned int event_type, GMainContext *maincontext);
52 reg_event_info* get_reg_event_info(const unsigned int event_type);
53 void get_reg_event_types(event_type_vector &event_types);
54 void get_batch(unsigned int &interval, unsigned int &latency);
55 unsigned int get_reg_event_count(void);
57 void clear_all_events(void);
58 static unsigned long long renew_event_id(void);
60 event_info_map m_reg_event_infos;
61 static unsigned long long m_event_id;
65 #endif /* _SENSOR_HANDLE_INFO_H_ */