2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file FLoc_LocationMonitor.cpp
20 * @brief This is the implementation file for the %_LocationMonitor class.
22 * This implementation file contains the definitions of the %_LocationMonitor class methods.
25 #include <FBaseSysLog.h>
26 #include "FLoc_LocationMonitor.h"
28 using namespace Tizen::Base::Runtime;
31 namespace Tizen { namespace Locations
34 _LocationMonitor::_LocationMonitor(void)
40 _LocationMonitor::~_LocationMonitor(void)
46 _LocationMonitor::Construct(int timeout, LocationAccuracy accuracy)
48 unique_ptr< Tizen::Base::Runtime::Monitor > pMonitor(new (std::nothrow) Monitor());
49 SysTryReturn(NID_LOC, pMonitor, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
51 result r = pMonitor->Construct();
52 SysTryReturn(NID_LOC, r == E_SUCCESS, r, r, "[%s] Error from Monitor::Construct(). Propagating.", GetErrorMessage(r));
54 __pMonitor = std::move(pMonitor);
57 __accuracy = accuracy;
63 _LocationMonitor::Enter(void)
65 return __pMonitor->Enter();
69 _LocationMonitor::Wait(void)
71 return __pMonitor->Wait();
75 _LocationMonitor::Notify(void)
77 return __pMonitor->Notify();
81 _LocationMonitor::Exit(void)
83 return __pMonitor->Exit();
87 _LocationMonitor::GetLocationN(void)
89 Location* pLocation = __pLocation;
95 _LocationMonitor::SetLocation(Tizen::Locations::Location* pLocation)
97 if (__pLocation != null)
101 __pLocation = pLocation;
105 _LocationMonitor::GetTimeout(void) const
111 _LocationMonitor::GetAccuracy(void) const