4 * Copyright (c) 2015 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 _EXTERNAL_SENSOR_SERVICE_H_
21 #define _EXTERNAL_SENSOR_SERVICE_H_
23 #include <external_sensor.h>
26 #include <unordered_map>
28 class external_client_manager;
30 class external_sensor_service {
32 static external_sensor_service& get_instance();
33 bool register_sensor(external_sensor *sensor);
34 bool unregister_sensor(external_sensor *sensor);
35 external_sensor* get_sensor(const std::string& key);
37 void accept_command_channel(csocket client_socket);
40 external_sensor_service();
41 ~external_sensor_service();
42 external_sensor_service(const external_sensor_service&) {};
43 external_sensor_service& operator=(const external_sensor_service&);
45 static external_client_manager& get_client_manager(void);
47 void dispatch_command(void);
49 std::unordered_map<std::string, external_sensor*> m_external_sensors;
51 #endif /* _EXTERNAL_SENSOR_SERVICE_H_ */