2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FApp_TemplateUtil.h
19 * @brief This is the header file for the internap Tizen::App utilities.
22 #ifndef _FAPP_INTERNAL_TEMPLATE_UTIL_H_
23 #define _FAPP_INTERNAL_TEMPLATE_UTIL_H_
25 #include <FBaseString.h>
26 #include <FBaseColICollectionT.h>
27 #include <FBaseColIEnumeratorT.h>
29 namespace Tizen { namespace App
32 template<class Type> void
33 _DeleteCollection(Tizen::Base::Collection::ICollectionT<Type*>& col)
35 Tizen::Base::Collection::IEnumeratorT<Type*>* pEnum = col.GetEnumeratorN();
39 while (pEnum->MoveNext() == E_SUCCESS)
42 pEnum->GetCurrent(pElem);
51 template<class KeyType, class ValueType> void
52 _DeleteCollectionMapValue(Tizen::Base::Collection::IMapT<KeyType, ValueType*>& col)
54 Tizen::Base::Collection::IMapEnumeratorT<KeyType, ValueType*>* pEnum = col.GetMapEnumeratorN();
58 while (pEnum->MoveNext() == E_SUCCESS)
60 ValueType* pValue = null;
61 pEnum->GetValue(pValue);
70 template<class KeyType, class ValueType> void
71 _DeleteCollectionMapValue(Tizen::Base::Collection::IMultiMapT<KeyType, ValueType*>& col)
73 Tizen::Base::Collection::IMapEnumeratorT<KeyType, ValueType*>* pEnum = col.GetMapEnumeratorN();
77 while (pEnum->MoveNext() == E_SUCCESS)
79 ValueType* pValue = null;
80 pEnum->GetValue(pValue);
91 namespace Tizen { namespace Base
98 class __HashMapDefaultProviderT<String>
99 : public IHashCodeProviderT<String>
103 __HashMapDefaultProviderT(void) {}
105 virtual ~__HashMapDefaultProviderT(void) {}
107 virtual int GetHashCode(const String& obj) const
109 return obj.GetHashCode();
114 class __MultiHashMapDefaultProviderT<String>
115 : public IHashCodeProviderT<String>
119 __MultiHashMapDefaultProviderT(void) {}
121 virtual ~__MultiHashMapDefaultProviderT(void) {}
123 virtual int GetHashCode(const String& obj) const
125 return obj.GetHashCode();
134 #endif //_FAPP_INTERNAL_TEMPLATE_UTIL_H_