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 <message-port-data-types.h>
30 #include <FBaseResult.h>
31 #include <FBaseString.h>
32 #include <FBaseColHashMap.h>
33 #include <FBaseColHashMapT.h>
34 #include <FAppTypes.h>
41 class _MessagePortStub;
43 class _MessagePortService
46 _MessagePortService(void);
48 virtual ~_MessagePortService(void);
50 virtual result Construct(_MessagePortStub& stub);
52 virtual int RegisterMessagePort(int clientId, const BundleBuffer& buffer);
54 virtual int CheckRemotePort(const BundleBuffer& buffer);
56 result UnregisterMessagePort(int clientId);
58 virtual int SendMessage(const BundleBuffer& metadata, const BundleBuffer& buffer);
61 Tizen::Base::String GetKey(const BundleBuffer& buffer, bool local = true) const;
63 bool IsPreloaded(const Tizen::Base::String& localAppId, const Tizen::Base::String& remoteAppId) const;
65 int CheckCertificate(const Tizen::Base::String& localAppId, const Tizen::Base::String& remoteAppId) const;
67 class _StringHashProvider
68 : public Tizen::Base::Collection::IHashCodeProviderT<Tizen::Base::String>
71 virtual int GetHashCode(const Tizen::Base::String& value) const
73 return value.GetHashCode();
78 : public Tizen::Base::Collection::IComparerT<Tizen::Base::String>
81 virtual result Compare(const Tizen::Base::String& string1, const Tizen::Base::String& string2, int& cmp) const
83 cmp = string1.CompareTo(string2);
89 _MessagePortStub* __pStub;
91 Tizen::Base::Collection::HashMapT <Tizen::Base::String, int>* __pPorts;
92 Tizen::Base::Collection::HashMapT <Tizen::Base::String, int>* __pTrustedPorts;
93 }; // _MessagePortService
95 #endif // _FIO_INTERNAL_MESSAGE_PORT_SERVICE_H_