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_RECORD_H_
21 #define _EXTERNAL_SENSOR_RECORD_H_
24 #include <sensor_common.h>
26 #include <unordered_set>
28 class external_sensor_record {
30 external_sensor_record();
31 ~external_sensor_record();
33 void set_client_id(int client_id);
35 void set_client_info(pid_t pid, const std::string &name);
36 const char* get_client_info(void);
39 bool has_usage(sensor_id_t sensor);
41 bool add_usage(sensor_id_t sensor);
42 bool remove_usage(sensor_id_t sensor);
44 void set_command_socket(const csocket &socket);
45 void get_command_socket(csocket &socket);
46 bool close_command_socket(void);
51 std::string m_client_info;
52 csocket m_command_socket;
53 std::unordered_set<sensor_id_t> m_usages;
56 #endif /* _EXTERNAL_SENSOR_RECORD_H_ */