2 // Open Service Platform
3 // Copyright (c) 2012-2013 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.
18 * @file FNetDhcpClientInfo.cpp
19 * @brief This is the implementation file for the DhcpClientInfo Class.
21 * This header file contains implementation of the DhcpClientInfo Class.
24 #include <FNetDhcpClientInfo.h>
25 #include <FBaseSysLog.h>
26 #include "FNet_DhcpClientInfoImpl.h"
28 using namespace Tizen::Base;
30 namespace Tizen { namespace Net
33 DhcpClientInfo::DhcpClientInfo(void)
35 __pDhcpClientInfoImpl = new (std::nothrow) _DhcpClientInfoImpl();
36 SysTryReturnVoidResult(NID_NET, __pDhcpClientInfoImpl != null, E_OUT_OF_MEMORY,
37 "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
40 DhcpClientInfo::DhcpClientInfo(const DhcpClientInfo& rhs)
42 __pDhcpClientInfoImpl = new (std::nothrow) _DhcpClientInfoImpl(rhs);
43 SysTryReturnVoidResult(NID_NET, __pDhcpClientInfoImpl != null, E_OUT_OF_MEMORY,
44 "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
47 DhcpClientInfo::~DhcpClientInfo(void)
49 delete __pDhcpClientInfoImpl;
50 __pDhcpClientInfoImpl = null;
54 DhcpClientInfo::GetName(void) const
56 return __pDhcpClientInfoImpl->GetName();
60 DhcpClientInfo::GetIpAddress(void) const
62 return __pDhcpClientInfoImpl->GetLocalAddress();
66 DhcpClientInfo::GetMacAddress(void) const
68 return __pDhcpClientInfoImpl->GetMacAddress();
72 DhcpClientInfo::Equals(const Object& rhs) const
74 const DhcpClientInfo* pRhs = dynamic_cast<const DhcpClientInfo*>(&rhs);
80 const _DhcpClientInfoImpl* pRhsImpl = _DhcpClientInfoImpl::GetInstance(*pRhs);
86 return __pDhcpClientInfoImpl->Equals(*pRhsImpl);
90 DhcpClientInfo::GetHashCode(void) const
92 return __pDhcpClientInfoImpl->GetHashCode();