4 * Copyright (c) 2017 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_LOADER_H__
21 #define __SENSOR_LOADER_H__
23 #include <sensor_hal.h>
24 #include <physical_sensor.h>
25 #include <fusion_sensor.h>
26 #include <external_sensor.h>
34 typedef std::vector<std::shared_ptr<sensor_device>> device_sensor_registry_t;
35 typedef std::vector<std::shared_ptr<physical_sensor>> physical_sensor_registry_t;
36 typedef std::vector<std::shared_ptr<fusion_sensor>> fusion_sensor_registry_t;
37 typedef std::vector<std::shared_ptr<external_sensor>> external_sensor_registry_t;
42 virtual ~sensor_loader();
44 void load_hal(const std::string &path, device_sensor_registry_t &devices);
45 void load_physical_sensor(const std::string &path, physical_sensor_registry_t &sensors);
46 void load_fusion_sensor(const std::string &path, fusion_sensor_registry_t &sensors);
47 void load_external_sensor(const std::string &path, external_sensor_registry_t &sensors);
53 bool load(const std::string &path, std::vector<std::shared_ptr<T>> &sensors);
55 bool get_module_paths(const std::string &dir_path, std::vector<std::string> &paths);
57 std::map<std::string, void *> m_modules;
62 #endif /* __SENSOR_LOADER_H__ */