Merge "Changing the return value description of IsBitSet(), IsProbablePrimeNumber...
[platform/framework/native/appfw.git] / src / io / FIoMessagePortManager.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16
17 /**
18  * @file        FIoMessagePortManager.cpp
19  * @brief       This is the implementation file for the MessagePortManager class.
20  *
21  */
22
23 #include <FBaseSysLog.h>
24 #include <FIoMessagePortManager.h>
25 #include <FIoLocalMessagePort.h>
26 #include <FIoRemoteMessagePort.h>
27 #include "FIo_MessagePortManagerImpl.h"
28
29
30 using namespace Tizen::Base;
31 using namespace Tizen::App;
32
33 namespace Tizen { namespace Io
34 {
35
36 MessagePortManager::MessagePortManager(void)
37 {
38 }
39
40 MessagePortManager::~MessagePortManager(void)
41 {
42 }
43
44 LocalMessagePort*
45 MessagePortManager::RequestLocalMessagePort(const String& localMessagePortName)
46 {
47         _MessagePortManagerImpl* pImpl = _MessagePortManagerImpl::GetInstance();
48         SysTryReturn(NID_IO, pImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
49
50         return pImpl->RequestLocalMessagePort(localMessagePortName);
51 }
52
53 RemoteMessagePort*
54 MessagePortManager::RequestRemoteMessagePort(const AppId& remoteAppId, const String& remoteMessagePortName)
55 {
56         _MessagePortManagerImpl* pImpl = _MessagePortManagerImpl::GetInstance();
57         SysTryReturn(NID_IO, pImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
58
59         return pImpl->RequestRemoteMessagePort(remoteAppId, remoteMessagePortName);
60 }
61
62 LocalMessagePort*
63 MessagePortManager::RequestTrustedLocalMessagePort(const String& localMessagePortName)
64 {
65         _MessagePortManagerImpl* pImpl = _MessagePortManagerImpl::GetInstance();
66         SysTryReturn(NID_IO, pImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
67
68         return pImpl->RequestTrustedLocalMessagePort(localMessagePortName);
69 }
70
71 RemoteMessagePort*
72 MessagePortManager::RequestTrustedRemoteMessagePort(const AppId& remoteAppId, const String& remoteMessagePortName)
73 {
74         _MessagePortManagerImpl* pImpl = _MessagePortManagerImpl::GetInstance();
75         SysTryReturn(NID_IO, pImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
76
77         return pImpl->RequestTrustedRemoteMessagePort(remoteAppId, remoteMessagePortName);
78 }
79
80 } } // Tizen::Io