4 * Copyright (c) 2013 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_INFO_MANAGER_H_
21 #define _SENSOR_INFO_MANAGER_H_
23 #include <sensor_common.h>
24 #include <sensor_info.h>
26 #include <unordered_map>
27 #include <unordered_set>
29 class sensor_info_manager {
31 static sensor_info_manager& get_instance(void);
32 const sensor_info* get_info(sensor_type_t type);
33 std::vector<sensor_info *> get_infos(sensor_type_t type);
34 const sensor_info* get_info(sensor_id_t id);
35 bool is_valid(sensor_info* info);
36 void add_info(sensor_info* info);
39 typedef std::multimap<sensor_type_t, sensor_info*> sensor_infos;
40 typedef std::unordered_map<sensor_id_t, sensor_info*> id_to_info_map;
41 typedef std::unordered_set<sensor_info*> info_set;
43 sensor_info_manager();
44 ~sensor_info_manager();
46 sensor_info_manager(const sensor_info_manager&) {};
47 sensor_info_manager& operator=(const sensor_info_manager&);
49 sensor_infos m_sensor_infos;
50 id_to_info_map m_id_to_info_map;
54 #endif /* _SENSOR_INFO_MANAGER_H_ */