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 __FACE_DOWN_ALG_IMPL_H__
21 #define __FACE_DOWN_ALG_IMPL_H__
25 #include "face_down_alg.h"
27 class face_down_alg_impl : public virtual face_down_alg {
30 ~face_down_alg_impl();
31 void update(sensor_data_t *data);
32 bool get_face_down(void);
35 void remove_old_up_time(void);
36 unsigned long long is_facing_down(void);
37 unsigned long long was_facing_up(void);
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;
45 #endif /* __FACE_DOWN_ALG_IMPL_H__ */