// // Open Service Platform // Copyright (c) 2012 Samsung Electronics Co., Ltd. // // Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #include #include #include #include #include "FLoc_LocationImpl.h" using namespace Tizen::Base; namespace Tizen { namespace Locations { Location::Location(void) : Tizen::Base::Object() , __pImpl(null) { __pImpl = new (std::nothrow) _LocationImpl(); if (__pImpl == null) { SetLastResult(E_OUT_OF_MEMORY); } } Location::Location(const Location& rhs) : Tizen::Base::Object() , __pImpl(null) { __pImpl = new (std::nothrow) _LocationImpl(*_LocationImpl::GetInstance(rhs)); if (__pImpl == null) { SetLastResult(E_OUT_OF_MEMORY); } } Location::~Location(void) { delete __pImpl; } bool Location::Equals(const Tizen::Base::Object& rhs) const { SysAssertf(__pImpl != null, "The location object is in an invalid state."); const Location* pRhs = dynamic_cast< const Location* >(&rhs); if (pRhs == null) { return false; } return __pImpl->Equals(*_LocationImpl::GetInstance(*pRhs)); } int Location::GetHashCode(void) const { SysAssertf(__pImpl != null, "The location object is in an invalid state."); return __pImpl->GetHashCode(); } double Location::GetHorizontalAccuracy(void) const { SysAssertf(__pImpl != null, "The location object is in an invalid state."); return __pImpl->GetHorizontalAccuracy(); } double Location::GetVerticalAccuracy(void) const { SysAssertf(__pImpl != null, "The location object is in an invalid state."); return __pImpl->GetVerticalAccuracy(); } double Location::GetCourse(void) const { SysAssertf(__pImpl != null, "The location object is in an invalid state."); return __pImpl->GetCourse(); } Coordinates Location::GetCoordinates(void) const { SysAssertf(__pImpl != null, "The location object is in an invalid state."); return __pImpl->GetCoordinates(); } double Location::GetSpeed(void) const { SysAssertf(__pImpl != null, "The location object is in an invalid state."); return __pImpl->GetSpeed(); } Tizen::Base::DateTime Location::GetTimestamp(void) const { SysAssertf(__pImpl != null, "The location object is in an invalid state."); return __pImpl->GetTimestamp(); } Tizen::Base::String Location::GetExtraInfo(const Tizen::Base::String& key) const { SysAssertf(__pImpl != null, "The location object is in an invalid state."); return __pImpl->GetExtraInfo(key); } bool Location::IsValid(void) const { SysAssertf(__pImpl != null, "The location object is in an invalid state."); return __pImpl->IsValid(); } Location& Location::operator =(const Location& rhs) { SysAssertf(__pImpl != null, "The location object is in an invalid state."); if (this == &rhs) { return *this; } *__pImpl = *_LocationImpl::GetInstance(rhs); return *this; } }}