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_ChannelService.h
20 * @brief This is the header file for the _ChannelService class.
22 * This file contains the declarations of _ChannelService.
25 #ifndef _FIO_INTERNAL_CHANNEL_SERVICE_H_
26 #define _FIO_INTERNAL_CHANNEL_SERVICE_H_
30 #include <FBaseResult.h>
31 #include <FBaseObject.h>
32 #include <FBaseColIList.h>
33 #include <FBaseColHashMapT.h>
34 #include <FOspConfig.h>
35 #include "FIo_IChannelService.h"
36 #include "FIo_IChannelServiceEventListener.h"
43 namespace Tizen { namespace Io
45 class _IChannelServiceStub;
47 class _OSP_EXPORT_ _ChannelService
48 : public Tizen::Base::Object
49 , public Tizen::Io::_IChannelService
52 _ChannelService(void);
54 virtual ~_ChannelService(void);
56 virtual result Construct(_IChannelServiceStub& stub);
59 virtual result RegisterChannel(const Tizen::Base::String& channelId, const _IChannelServiceEventListener& listener);
60 virtual result UnregisterChannel(const Tizen::Base::String& channelId);
62 virtual result SendRequest(const Tizen::Base::String& src, const Tizen::Base::String& dest, const Tizen::Base::Collection::ArrayList& args, int messageId);
63 virtual result SendNullRequest(const Tizen::Base::String& src, const Tizen::Base::String& dest, int messageId);
65 virtual result SendResponse(const Tizen::Base::String& src, const Tizen::Base::String& dest, const Tizen::Base::Collection::ArrayList& args, int messageId);
66 virtual result SendNullResponse(const Tizen::Base::String& src, const Tizen::Base::String& dest, int messageId);
69 bool IsChannelRegistered(const Tizen::Base::String& channelId);
71 result RegisterChannel(const Tizen::Base::String& channelId, int clientId);
73 result UnregisterChannel(int clientId);
79 Tizen::Base::String channelId;
84 class _StringHashProvider
85 : public Tizen::Base::Collection::IHashCodeProviderT<Tizen::Base::String>
88 virtual int GetHashCode(const Tizen::Base::String& value) const
90 return value.GetHashCode();
95 : public Tizen::Base::Collection::IComparerT<Tizen::Base::String>
98 virtual result Compare(const Tizen::Base::String& string1, const Tizen::Base::String& string2, int& cmp) const
100 cmp = string1.CompareTo(string2);
105 _IChannelServiceStub* __pIChannelServiceStub;
106 Tizen::Base::Collection::HashMapT <Tizen::Base::String, _ChannelInfo*> __channels;
108 }; // _ChannelService
113 #endif // _FIO_INTERNAL_CHANNEL_SERVICE_STUB_H_