2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file FIoMessagePortManager.cpp
19 * @brief This is the implementation file for the MessagePortManager class.
23 #include <FBaseSysLog.h>
24 #include <FIoMessagePortManager.h>
25 #include <FIoLocalMessagePort.h>
26 #include <FIoRemoteMessagePort.h>
27 #include "FIo_MessagePortManagerImpl.h"
30 using namespace Tizen::Base;
31 using namespace Tizen::App;
33 namespace Tizen { namespace Io
36 MessagePortManager::MessagePortManager(void)
40 MessagePortManager::~MessagePortManager(void)
45 MessagePortManager::RequestLocalMessagePort(const String& localMessagePortName)
47 _MessagePortManagerImpl* pImpl = _MessagePortManagerImpl::GetInstance();
48 SysTryReturn(NID_IO, pImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
50 return pImpl->RequestLocalMessagePort(localMessagePortName);
54 MessagePortManager::RequestRemoteMessagePort(const AppId& remoteAppId, const String& remoteMessagePortName)
56 _MessagePortManagerImpl* pImpl = _MessagePortManagerImpl::GetInstance();
57 SysTryReturn(NID_IO, pImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
59 return pImpl->RequestRemoteMessagePort(remoteAppId, remoteMessagePortName);
63 MessagePortManager::RequestTrustedLocalMessagePort(const String& localMessagePortName)
65 _MessagePortManagerImpl* pImpl = _MessagePortManagerImpl::GetInstance();
66 SysTryReturn(NID_IO, pImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
68 return pImpl->RequestTrustedLocalMessagePort(localMessagePortName);
72 MessagePortManager::RequestTrustedRemoteMessagePort(const AppId& remoteAppId, const String& remoteMessagePortName)
74 _MessagePortManagerImpl* pImpl = _MessagePortManagerImpl::GetInstance();
75 SysTryReturn(NID_IO, pImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
77 return pImpl->RequestTrustedRemoteMessagePort(remoteAppId, remoteMessagePortName);