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 FUixSensorLightSensorData.cpp
20 * @brief This is the implementation file for the %LightSensorData class.
22 * This files contains implementation of the %LightSensorData class.
26 #include <FBaseErrors.h>
27 #include <FBaseSysLog.h>
28 #include <FBaseFloat.h>
29 #include <FBaseLongLong.h>
31 #include <FUixSensorLightSensorData.h>
33 using namespace Tizen::Base;
35 namespace Tizen { namespace Uix { namespace Sensor
39 static const wchar_t W_MSG_INVALID_SENSOR_DATA_KEY[] = L"A data matching the specified key and data type cannot be found.";
42 LightSensorData::LightSensorData(void)
48 LightSensorData::~LightSensorData(void)
53 LightSensorData::LightSensorData(const LightSensorData& rhs)
60 LightSensorData::operator =(const LightSensorData& rhs)
62 // check for self-assignment
65 timestamp = rhs.timestamp;
73 LightSensorData::GetHashCode(void) const
77 hash += LongLong::GetHashCode(this->timestamp);
78 hash += Float::GetHashCode(this->level);
84 LightSensorData::Equals(const Object& rhs) const
86 const LightSensorData* pRhs = dynamic_cast <const LightSensorData*>(&rhs);
92 if (this->timestamp != pRhs->timestamp)
97 if (this->level != pRhs->level)
105 LightSensorData::GetValue(SensorDataKey dataKey, long& value) const
107 SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
108 return E_INVALID_ARG;
112 LightSensorData::GetValue(SensorDataKey dataKey, float& value) const
114 SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
115 return E_INVALID_ARG;
119 LightSensorData::GetValue(SensorDataKey dataKey, bool& value) const
121 SysLogException(NID_UIX, E_INVALID_ARG, "[%s] %ls", GetErrorMessage(E_INVALID_ARG), W_MSG_INVALID_SENSOR_DATA_KEY);
122 return E_INVALID_ARG;
124 } } }// Tizen::Uix::Sensor