build option cahnged
[platform/framework/native/locations.git] / src / FLoc_SyncLocationRequestInfo.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file        FLoc_SyncLocationRequestInfo.h
20  * @brief       This is the header file for the %_SyncLocationRequestInfo class.
21  *
22  * This header file contains the declarations of the %_SyncLocationRequestInfo class member variables.
23  */
24
25 #ifndef _FLOC_INTERNAL_SYNC_LOCATION_REQUEST_INFO_H_
26 #define _FLOC_INTERNAL_SYNC_LOCATION_REQUEST_INFO_H_
27
28 #include <new>
29 #include <unique_ptr.h>
30 #include <FBaseObject.h>
31 #include <FBaseRtTimer.h>
32 #include <FBaseRtITimerEventListener.h>
33 #include <FLocTypes.h>
34 #include <FSysSystemTime.h>
35
36 namespace Tizen { namespace Locations
37 {
38 class _LocationMonitor;
39 class _LocationManager;
40
41 class _SyncLocationRequestInfo
42         : public Tizen::Base::Object
43 {
44 public:
45         _SyncLocationRequestInfo(_LocationMonitor* pLocMonitor, RequestId reqId)
46                 : Tizen::Base::Object()
47                 , __pLocMonitor(pLocMonitor)
48                 , __reqId(reqId)
49                 , __tickCount(0)
50         {
51                 Tizen::System::SystemTime::GetCurrentTime(__requestTime);
52         }
53
54         ~_SyncLocationRequestInfo(void) {}
55
56         _LocationMonitor* GetLocationMonitor(void) const {return __pLocMonitor;}
57
58         RequestId GetRequestId(void) const {return __reqId;}
59
60         int GetTickCount(void) const {return __tickCount;}
61
62         void IncrementTickCount(void) { __tickCount++;}
63
64         bool IsInTime(const Tizen::Base::DateTime& timestamp)
65         {
66                 return (timestamp > __requestTime) ? true : false;
67         }
68
69         bool IsAccuracySatisfying(LocationAccuracy accuracy)
70         {
71                 if (accuracy == LOC_ACCURACY_INVALID)
72                 {
73                         return false;
74                 }
75                 else
76                 {
77                         return (accuracy <= __pLocMonitor->GetAccuracy()) ? true : false;
78                 }
79         }
80
81 private:
82         _SyncLocationRequestInfo(void);
83
84         _SyncLocationRequestInfo& operator =(const _SyncLocationRequestInfo& rhs);
85
86 private:
87         Tizen::Base::DateTime __requestTime;
88         _LocationMonitor* __pLocMonitor;
89         RequestId __reqId;
90         int __tickCount;
91 }; //_SyncLocationRequestInfo
92 }} //Tizen::Locations
93 #endif // _FLOC_INTERNAL_SYNC_LOCATION_REQUEST_INFO_H_