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.
17 * @file FIo_MessagePortManagerImpl.h
18 * @brief This is the header file for the %_MessagePortManagerImpl class.
20 * This header file contains the declarations of the %_MessagePortManagerImpl class.
22 #ifndef _FIO_INTERNAL_MESSAGE_PORT_MANAGER_H_
23 #define _FIO_INTERNAL_MESSAGE_PORT_MANAGER_H_
25 #include <FBaseResult.h>
26 #include <FBaseObject.h>
27 #include <FBaseDataType.h>
28 #include <FBaseColHashMapT.h>
29 #include <FAppTypes.h>
31 namespace Tizen { namespace Io
34 class LocalMessagePort;
35 class RemoteMessagePort;
37 class _OSP_EXPORT_ _MessagePortManagerImpl
40 virtual ~_MessagePortManagerImpl(void);
42 static _MessagePortManagerImpl* GetInstance(void);
44 LocalMessagePort* RequestLocalMessagePort(const Tizen::Base::String& localPort);
45 RemoteMessagePort* RequestRemoteMessagePort(const Tizen::App::AppId& remoteAppId, const Tizen::Base::String& remotePort);
47 LocalMessagePort* RequestTrustedLocalMessagePort(const Tizen::Base::String& localPort);
48 RemoteMessagePort* RequestTrustedRemoteMessagePort(const Tizen::App::AppId& remoteAppId, const Tizen::Base::String& remotePort);
50 RemoteMessagePort* GetRemoteMessagePort(const Tizen::App::AppId& remoteAppId, const Tizen::Base::String& remotePort, bool isTrusted);
53 _MessagePortManagerImpl(void);
54 _MessagePortManagerImpl(const _MessagePortManagerImpl& channelManagerImpl);
55 _MessagePortManagerImpl& operator =(const _MessagePortManagerImpl& channelManagerImpl);
57 result Construct(void);
59 static void InitSingleton(void);
61 static void DestroySingleton(void);
64 class _StringHashProvider
65 : public Tizen::Base::Collection::IHashCodeProviderT<Tizen::Base::String>
68 virtual int GetHashCode(const Tizen::Base::String& value) const
70 return value.GetHashCode();
75 : public Tizen::Base::Collection::IComparerT<Tizen::Base::String>
78 virtual result Compare(const Tizen::Base::String& string1, const Tizen::Base::String& string2, int& cmp) const
80 cmp = string1.CompareTo(string2);
86 Tizen::Base::Collection::HashMapT<Tizen::Base::String, LocalMessagePort*> __localPorts;
87 Tizen::Base::Collection::HashMapT<Tizen::Base::String, LocalMessagePort*> __trustLocalPorts;
88 Tizen::Base::Collection::HashMapT<Tizen::Base::String, RemoteMessagePort*> __remotePorts;
89 Tizen::Base::Collection::HashMapT<Tizen::Base::String, RemoteMessagePort*> __trustRemotePorts;
90 static _MessagePortManagerImpl* __pMessagePortMgrImplInst;
92 }; // _MessagePortManagerImpl
96 #endif //_FIO_INTERNAL_MESSAGE_PORT_MANAGER_H_