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_PLUGIN_LOADER_H_
21 #define _SENSOR_PLUGIN_LOADER_H_
23 #include <sensor_common.h>
24 #include <sensor_types.h>
25 #include <sensor_hal.h>
35 #include <physical_sensor.h>
36 #include <virtual_sensor.h>
40 typedef std::multimap<sensor_type_t, std::shared_ptr<sensor_base>> sensor_map_t;
46 bool load_devices(const std::string &path, std::vector<sensor_device_t> &devices, void* &handle);
48 physical_sensor* create_sensor(sensor_handle_t handle, sensor_device *device);
49 bool load_physical_sensors(std::vector<sensor_device_t> &devices);
51 template <typename _sensor> void load_virtual_sensor(const char *name);
52 void load_virtual_sensors(void);
54 void show_sensor_info(void);
55 bool get_paths_from_dir(const std::string &dir_path, std::vector<std::string> &plugin_paths);
57 sensor_map_t m_sensors;
59 static sensor_loader& get_instance();
60 bool load_sensors(void);
62 sensor_base* get_sensor(sensor_type_t type);
63 sensor_base* get_sensor(sensor_id_t id);
65 std::vector<sensor_type_t> get_sensor_types(void);
66 std::vector<sensor_base *> get_sensors(sensor_type_t type);
67 std::vector<sensor_base *> get_virtual_sensors(void);
69 #endif /* _SENSOR_PLUGIN_LOADER_H_ */