4 * Copyright (c) 2016 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_LIST_H_
21 #define _SENSOR_INFO_LIST_H_
27 interval_info(int client_id, bool is_processor, unsigned int interval);
30 unsigned int interval;
33 typedef std::list<interval_info>::iterator interval_info_iterator;
37 batch_info(int client_id, unsigned int latency);
42 typedef std::list<batch_info>::iterator batch_info_iterator;
44 class sensor_info_list {
46 bool add_interval(int client_id, unsigned int interval, bool is_processor);
47 bool delete_interval(int client_id, bool is_processor);
48 unsigned int get_interval(int client_id, bool is_processor);
49 unsigned int get_min_interval(void);
51 bool add_batch(int client_id, unsigned int latency);
52 bool delete_batch(int client_id);
53 unsigned int get_batch(int client_id);
54 unsigned int get_max_batch(void);
57 static bool comp_interval_info(interval_info a, interval_info b);
58 interval_info_iterator find_if_interval_info(int client_id, bool is_processor);
60 static bool comp_batch_info(batch_info a, batch_info b);
61 batch_info_iterator find_if_batch_info(int client_id);
63 std::list<interval_info> m_interval_info_list;
64 std::list<batch_info> m_batch_info_list;
67 #endif /* _SENSOR_INFO_LIST_H_ */