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.
18 * @file FIo_MessagePortManagerImpl.h
19 * @brief This is the header file for the %_MessagePortManagerImpl class.
21 * This header file contains the declarations of the %_MessagePortManagerImpl class.
23 #ifndef _FIO_INTERNAL_MESSAGE_PORT_MANAGER_H_
24 #define _FIO_INTERNAL_MESSAGE_PORT_MANAGER_H_
26 #include <FBaseResult.h>
27 #include <FBaseObject.h>
28 #include <FBaseDataType.h>
29 #include <FBaseColHashMapT.h>
30 #include <FAppTypes.h>
32 namespace Tizen { namespace Io
35 class LocalMessagePort;
36 class RemoteMessagePort;
38 class _OSP_EXPORT_ _MessagePortManagerImpl
41 virtual ~_MessagePortManagerImpl(void);
43 static _MessagePortManagerImpl* GetInstance(void);
45 LocalMessagePort* RequestLocalMessagePort(const Tizen::Base::String& localPort);
46 RemoteMessagePort* RequestRemoteMessagePort(const Tizen::App::AppId& remoteAppId, const Tizen::Base::String& remotePort);
48 LocalMessagePort* RequestTrustedLocalMessagePort(const Tizen::Base::String& localPort);
49 RemoteMessagePort* RequestTrustedRemoteMessagePort(const Tizen::App::AppId& remoteAppId, const Tizen::Base::String& remotePort);
51 RemoteMessagePort* GetRemoteMessagePort(const Tizen::App::AppId& remoteAppId, const Tizen::Base::String& remotePort, bool isTrusted);
54 _MessagePortManagerImpl(void);
55 _MessagePortManagerImpl(const _MessagePortManagerImpl& channelManagerImpl);
56 _MessagePortManagerImpl& operator =(const _MessagePortManagerImpl& channelManagerImpl);
58 result Construct(void);
60 static void InitSingleton(void);
62 static void DestroySingleton(void);
65 class _StringHashProvider
66 : public Tizen::Base::Collection::IHashCodeProviderT<Tizen::Base::String>
69 virtual int GetHashCode(const Tizen::Base::String& value) const
71 return value.GetHashCode();
76 : public Tizen::Base::Collection::IComparerT<Tizen::Base::String>
79 virtual result Compare(const Tizen::Base::String& string1, const Tizen::Base::String& string2, int& cmp) const
81 cmp = string1.CompareTo(string2);
87 Tizen::Base::Collection::HashMapT<Tizen::Base::String, LocalMessagePort*> __localPorts;
88 Tizen::Base::Collection::HashMapT<Tizen::Base::String, LocalMessagePort*> __trustLocalPorts;
89 Tizen::Base::Collection::HashMapT<Tizen::Base::String, RemoteMessagePort*> __remotePorts;
90 Tizen::Base::Collection::HashMapT<Tizen::Base::String, RemoteMessagePort*> __trustRemotePorts;
91 static _MessagePortManagerImpl* __pMessagePortMgrImplInst;
93 }; // _MessagePortManagerImpl
97 #endif //_FIO_INTERNAL_MESSAGE_PORT_MANAGER_H_