6#ifndef _ZFI_zfstlhashmap_h_
7#define _ZFI_zfstlhashmap_h_
14 #define zfstlhashmap std::unordered_map
15 #include "zfstl_impl/unordered_map.hpp"
21 #define zfstlhash _ZFT_zfstlhash
23 #define zfstlhash std::hash
29 #ifdef _ZFT_zfstlequalto
30 #define zfstlequalto _ZFT_zfstlequalto
32 #define zfstlequalto std::equal_to
39template<
typename T_Key,
typename T_Value,
typename T_Hash = zfstlhash<T_Key>,
typename T_Equal = zfstlequalto<T_Key> >
40class zfimplhashmap :
public zfstlhashmap<T_Key, T_Value, T_Hash, T_Equal> {
44 typename zfimplhashmap<T_Key, T_Value, T_Hash, T_Equal>::iterator it;
45 typename zfimplhashmap<T_Key, T_Value, T_Hash, T_Equal>::iterator end;
48 virtual zfbool valid(
void) {
52 virtual void next(
void) {
56 virtual Impl *copy(
void) {
63 virtual void destroy(
void) {
68 _Iter *t = (_Iter *)d;
75 impl->it = this->begin();
76 impl->end = this->end();
82 impl->it = this->find(key);
83 impl->end = this->end();
88 return it.impl<_Iter *>()->it->first;
91 return it.impl<_Iter *>()->it->second;
96 ,
ZF_IN T_Value
const &newValue
98 it.impl<_Iter *>()->it->second = newValue;
101 this->erase((it.impl<_Iter *>()->it)++);
105 ZF_IN T_Key
const &key
106 ,
ZF_IN T_Value
const &value
115template<
typename T_Type>
118 zfstlsize operator () (T_Type
const &v)
const {
#define zffinal
dummy macro shows that a method or class is designed must not to be overrided
Definition ZFCoreTypeDef_ClassType.h:63
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
#define zfoverride
dummy macro shows that method override parent's method
Definition ZFCoreTypeDef_ClassType.h:58
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:180
#define zfclassNotPOD
shows the class is not a POD type, you should not memset it or declare it in stack or copy value by c...
Definition ZFCoreTypeDef_ClassType.h:48
#define ZF_IN_OUT
dummy macro that shows the param used as required input and output
Definition ZFCoreTypeDef_ClassType.h:196
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
_zft_zfflags zfflags
used to hold flags, ensured 32 bit, ensured unsigned
Definition ZFCoreTypeDef_CoreType.h:211
_zft_zftimet zftimet
time unit, ensured at least 64 bit, ensured signed
Definition ZFCoreTypeDef_CoreType.h:203
_zft_zfidentity zfidentity
identity type, ensured at least 32 bit, ensured unsigned
Definition ZFCoreTypeDef_CoreType.h:225
_zft_zffloat zffloat
same as float, see zfindex
Definition ZFCoreTypeDef_CoreType.h:183
_zft_zfdouble zfdouble
same as double, see zfindex
Definition ZFCoreTypeDef_CoreType.h:188
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
zfidentity zfhash(const T_Type &v)
std::hash wrapper
Definition ZFCoreUtilTemplate.h:516
zfidentity zfidentityCalc(T_Type const &v)
calculate identity from POD object
Definition ZFIdentityUtil.h:92
zfidentity zfidentityCalcString(const zfchar *src, zfindex srcLen=((zfindex) -1))
calculate identity from string
#define zfpoolDelete(obj)
see zfpoolNew
Definition ZFMemPool.h:38
#define zfpoolNew(T_Type,...)
internal use only, for allocating internal types for performance
Definition ZFMemPool.h:37
POD data to hold index range.
Definition ZFCoreTypeDef_OtherType.h:66
readonly string container for internal use only
Definition ZFSigName.h:17
const zfchar * cString(void) const
access string value, return empty string if empty
zfindex length(void) const
length of string content
see zfiter
Definition zfiter.h:84
iterator for ZFFramework
Definition zfiter.h:40
hash wrapper for zftHash
Definition zfstlhashmap.h:116
const T_Char * cString(void) const
access string value
Definition zfstring.h:464
zfindex length(void) const
length of the string
Definition zfstring.h:468
#define zfstlsize
size_t wrapper
Definition zfstl_define.h:29
#define zfstlhash
stl wrapper
Definition zfstlhashmap.h:23
#define zfstlhashmap
stl wrapper
Definition zfstlhashmap.h:14
stl wrapper, note it's internal use only
#define zfstlpair
stl wrapper
Definition zfstlpair.h:15