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.
19 * @file FIo_MessagePortService.h
20 * @brief This is the header file for the _MessagePortService class.
22 * This file contains the declarations of _MessagePortService.
25 #ifndef _FIO_INTERNAL_MESSAGE_PORT_SERVICE_H_
26 #define _FIO_INTERNAL_MESSAGE_PORT_SERVICE_H_
28 #include <FBaseResult.h>
29 #include <FBaseString.h>
30 #include <FBaseColHashMap.h>
31 #include <FBaseColHashMapT.h>
32 #include <FAppTypes.h>
39 namespace Tizen { namespace Io
42 class _MessagePortStub;
44 class _MessagePortService
47 _MessagePortService(void);
49 virtual ~_MessagePortService(void);
51 virtual result Construct(_MessagePortStub& stub);
53 virtual result RegisterMessagePort(const Tizen::Base::String& appId,
54 const Tizen::Base::String& port,
58 virtual result RequestRemotePort(const Tizen::App::AppId& remoteAppId,
59 const Tizen::Base::String& remotePort,
62 result UnregisterMessagePort(int clientId);
64 virtual result SendMessage(const Tizen::Base::String& dest,
65 const Tizen::Base::String& destPort,
67 const Tizen::Base::Collection::HashMap* pMap);
69 virtual result SendMessage(const Tizen::Base::String& src,
70 const Tizen::Base::String& srcPort,
72 const Tizen::Base::String& dest,
73 const Tizen::Base::String& destPort,
75 const Tizen::Base::Collection::HashMap* pMap);
78 Tizen::Base::String GetKey(const Tizen::Base::String& appId, const Tizen::Base::String& port) const;
80 class _StringHashProvider
81 : public Tizen::Base::Collection::IHashCodeProviderT<Tizen::Base::String>
84 virtual int GetHashCode(const Tizen::Base::String& value) const
86 return value.GetHashCode();
91 : public Tizen::Base::Collection::IComparerT<Tizen::Base::String>
94 virtual result Compare(const Tizen::Base::String& string1, const Tizen::Base::String& string2, int& cmp) const
96 cmp = string1.CompareTo(string2);
102 _MessagePortStub* __pStub;
104 Tizen::Base::Collection::HashMapT <Tizen::Base::String, int>* __pPorts;
105 Tizen::Base::Collection::HashMapT <Tizen::Base::String, int>* __pTrustedPorts;
106 }; // _MessagePortService
110 #endif // _FIO_INTERNAL_MESSAGE_PORT_SERVICE_H_