coverity issues fix
[platform/core/system/sensord.git] / src / fusion-sensor / gesture / face_down_alg_impl.h
1 /*
2  * sensord
3  *
4  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
5  *
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
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
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.
17  *
18  */
19
20 #ifndef __FACE_DOWN_ALG_IMPL_H__
21 #define __FACE_DOWN_ALG_IMPL_H__
22
23 #include <queue>
24
25 #include "face_down_alg.h"
26
27 class face_down_alg_impl : public virtual face_down_alg {
28 public:
29         face_down_alg_impl();
30         ~face_down_alg_impl();
31         void update(sensor_data_t *data);
32         bool get_face_down(void);
33
34 private:
35         void remove_old_up_time(void);
36         unsigned long long is_facing_down(void);
37         unsigned long long was_facing_up(void);
38
39         unsigned long long m_current_time;
40         unsigned long long m_last_event_time;
41         unsigned long long m_latest_down_time;
42         std::queue<unsigned long long> m_oldest_up_time;
43 };
44
45 #endif /* __FACE_DOWN_ALG_IMPL_H__ */