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 FNet_IpHostEntryImpl.cpp
19 * @brief This is the implementation for the _IpHostEntryImpl class.
22 #include <FBaseColArrayList.h>
23 #include <FBaseUtilStringUtil.h>
24 #include <FNetNetTypes.h>
25 #include <FNetIp4Address.h>
26 #include <FNetIpHostEntry.h>
27 #include <FBaseSysLog.h>
28 #include "FNet_NetTypes.h"
29 #include "FNet_IpHostEntryImpl.h"
32 using namespace Tizen::Base;
33 using namespace Tizen::Base::Collection;
34 using namespace Tizen::Base::Utility;
36 namespace Tizen { namespace Net
39 _IpHostEntryImpl::_IpHostEntryImpl(void)
40 : __pAddressList(null)
45 _IpHostEntryImpl::~_IpHostEntryImpl(void)
50 _IpHostEntryImpl::GetAddressList(void) const
52 return __pAddressList.get();
56 _IpHostEntryImpl::GetAliasList(void) const
58 return __pAliasList.get();
62 _IpHostEntryImpl::CreateIpHostEntryN()
64 IpHostEntry* pIpHostEntry = new (std::nothrow) IpHostEntry();
65 SysTryReturn(NID_NET, pIpHostEntry != null, null, E_OUT_OF_MEMORY,
66 "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
72 _IpHostEntryImpl::SetAddressList(const IList& addressList)
74 __pAddressList.reset(const_cast <IList*>(&addressList));
80 _IpHostEntryImpl::SetAliasList(const IList& aliasList)
82 __pAliasList.reset(const_cast <IList*>(&aliasList));
88 _IpHostEntryImpl::GetInstance(IpHostEntry& ipHostEntry)
90 return ipHostEntry.__pIpHostEntryImpl;
93 const _IpHostEntryImpl*
94 _IpHostEntryImpl::GetInstance(const IpHostEntry& ipHostEntry)
96 return ipHostEntry.__pIpHostEntryImpl;