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 FApp_TemplateUtil.h
20 * @brief This is the header file for the internap Tizen::App utilities.
23 #ifndef _FAPP_INTERNAL_TEMPLATE_UTIL_H_
24 #define _FAPP_INTERNAL_TEMPLATE_UTIL_H_
26 #include <FBaseString.h>
27 #include <FBaseColICollectionT.h>
28 #include <FBaseColIEnumeratorT.h>
30 namespace Tizen { namespace App
33 template<class Type> void
34 _DeleteCollection(Tizen::Base::Collection::ICollectionT<Type*>& col)
36 Tizen::Base::Collection::IEnumeratorT<Type*>* pEnum = col.GetEnumeratorN();
40 while (pEnum->MoveNext() == E_SUCCESS)
43 pEnum->GetCurrent(pElem);
52 template<class KeyType, class ValueType> void
53 _DeleteCollectionMapValue(Tizen::Base::Collection::IMapT<KeyType, ValueType*>& col)
55 Tizen::Base::Collection::IMapEnumeratorT<KeyType, ValueType*>* pEnum = col.GetMapEnumeratorN();
59 while (pEnum->MoveNext() == E_SUCCESS)
61 ValueType* pValue = null;
62 pEnum->GetValue(pValue);
71 template<class KeyType, class ValueType> void
72 _DeleteCollectionMapValue(Tizen::Base::Collection::IMultiMapT<KeyType, ValueType*>& col)
74 Tizen::Base::Collection::IMapEnumeratorT<KeyType, ValueType*>* pEnum = col.GetMapEnumeratorN();
78 while (pEnum->MoveNext() == E_SUCCESS)
80 ValueType* pValue = null;
81 pEnum->GetValue(pValue);
92 namespace Tizen { namespace Base
99 class __HashMapDefaultProviderT<String>
100 : public IHashCodeProviderT<String>
104 __HashMapDefaultProviderT(void) {}
106 virtual ~__HashMapDefaultProviderT(void) {}
108 virtual int GetHashCode(const String& obj) const
110 return obj.GetHashCode();
115 class __MultiHashMapDefaultProviderT<String>
116 : public IHashCodeProviderT<String>
120 __MultiHashMapDefaultProviderT(void) {}
122 virtual ~__MultiHashMapDefaultProviderT(void) {}
124 virtual int GetHashCode(const String& obj) const
126 return obj.GetHashCode();
135 #endif //_FAPP_INTERNAL_TEMPLATE_UTIL_H_