_SyncLocationRequestInfo(_LocationMonitor* pLocMonitor, RequestId reqId)
: Tizen::Base::Object()
, __pLocMonitor(pLocMonitor)
- , __pTimer(null)
, __reqId(reqId)
, __tickCount(0)
{
_LocationMonitor* GetLocationMonitor(void) const {return __pLocMonitor;}
- result StartTimer(Tizen::Base::Runtime::ITimerEventListener& listener)
- {
- result r = E_SUCCESS;
-
- if (__pTimer == null)
- {
- std::unique_ptr< Tizen::Base::Runtime::Timer > pTimer(new (std::nothrow) Tizen::Base::Runtime::Timer());
- SysTryReturn(NID_LOC, pTimer != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
- "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- r = pTimer->Construct(listener);
- SysTryReturn(NID_LOC, r == E_SUCCESS, r, r, "[%s] Failed to construct the timer.", GetErrorMessage(r));
-
- __pTimer = std::move(pTimer);
- }
-
- const int DEFAULT_TIME_OUT = 1000;
- r = __pTimer->Start(DEFAULT_TIME_OUT);
- SysTryReturn(NID_LOC, r == E_SUCCESS, r, r, "[%s] Failed to start the timer.", GetErrorMessage(r));
- __tickCount++;
- return E_SUCCESS;
- }
-
- bool Equals(const Tizen::Base::Runtime::Timer& timer) {return __pTimer->Equals(timer);}
-
RequestId GetRequestId(void) const {return __reqId;}
int GetTickCount(void) const {return __tickCount;}
+ void IncrementTickCount(void) { __tickCount++;}
+
bool IsInTime(const Tizen::Base::DateTime& timestamp)
{
return (timestamp > __requestTime) ? true : false;
private:
Tizen::Base::DateTime __requestTime;
_LocationMonitor* __pLocMonitor;
- std::unique_ptr< Tizen::Base::Runtime::Timer > __pTimer;
RequestId __reqId;
int __tickCount;
}; //_SyncLocationRequestInfo