export _AppControlImpl::FindAndStart()
[platform/framework/native/appfw.git] / src / app / inc / FApp_RequestManagerT.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16
17 /**
18  * @file        FApp_RequestManagerT.h
19  * @brief       This is the header file for the _RequestManagerT class.
20  */
21
22 #ifndef _FAPP_INTERNAL_REQUEST_MANAGERT_H_
23 #define _FAPP_INTERNAL_REQUEST_MANAGERT_H_
24
25 #include <FOspConfig.h>
26 #include <FBaseColHashMapT.h>
27 #include <FBaseSysLog.h>
28
29 namespace Tizen { namespace Base { namespace Runtime
30 {
31 class IEventListener;
32 }}}
33
34 namespace Tizen { namespace App
35 {
36
37 template<typename T>
38 class _RequestManagerT
39 {
40 public:
41         typedef Tizen::Base::Collection::HashMapT<int, T*> RequestListType;
42         typedef Tizen::Base::Collection::IMapEnumeratorT<int, T*> RequestListEnumType;
43         typedef bool (*Pred)(const T&, Tizen::Base::Runtime::IEventListener*);
44
45         _RequestManagerT(void);
46
47         ~_RequestManagerT(void);
48
49         int InsertItem(T* pItem);
50
51         void RemoveItem(int reqId);
52
53         void RemoveItem(T* pItem);
54
55         T* FindItemWithListener(Pred, Tizen::Base::Runtime::IEventListener* pListener) const;
56
57         T* FindItem(int reqId) const;
58
59         void Dump(void) const;
60
61 private:
62         _RequestManagerT(const T& rhs);
63
64         _RequestManagerT& operator =(const _RequestManagerT& rhs);
65
66 private:
67         int __reqId;
68         RequestListType __requestList;
69 }; // _RequestManagerT
70
71
72 } } // Tizen::App
73
74 #endif // _FAPP_INTERNAL_REQUEST_MANAGERT_H_