ZFFramework
 
Loading...
Searching...
No Matches
ZFHashMap.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFHashMap_h_
7#define _ZFI_ZFHashMap_h_
8
10
12
13zfclassFwd _ZFP_ZFHashMapPrivate;
17zfclass ZFLIB_ZFCore ZFHashMap: zfextend ZFKeyValueContainer {
18 ZFOBJECT_DECLARE(ZFHashMap, ZFKeyValueContainer)
19
20public:
25
26
30
35 , ZFMP_IN(ZFObject *, key)
36 )
37
42 , ZFMP_IN(ZFObject *, key)
43 )
44
50 )
53
59 )
62
63public:
68 , ZFMP_IN(ZFKeyValueContainer *, another)
69 )
70
80 , ZFMP_IN(ZFObject *, key)
81 , ZFMP_IN(ZFObject *, value)
82 )
83
88 , ZFMP_IN(ZFObject *, key)
89 )
97 , ZFMP_IN(ZFObject *, key)
98 )
103
104 // ============================================================
105 // ZFIterable
106public:
109
112 , ZFMP_IN(ZFObject *, key)
114
117 , ZFMP_IN(const zfiter &, it)
119
122 , ZFMP_IN(const zfiter &, it)
124
125public:
128 , ZFMP_IN_OUT(zfiter &, it)
129 , ZFMP_IN(ZFObject *, value)
133 , ZFMP_IN_OUT(zfiter &, it)
135
138 , ZFMP_IN(ZFObject *, key)
139 , ZFMP_IN(ZFObject *, value)
141
142protected:
146 ZFOBJECT_ON_INIT_DECLARE_1(ZFMP_IN(ZFKeyValueContainer *, another))
148 virtual void objectOnInit(void);
150 virtual void objectOnDealloc(void);
151
152private:
153 _ZFP_ZFHashMapPrivate *d;
154};
155
157#endif // #ifndef _ZFI_ZFHashMap_h_
158
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
#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 zfclassFwd
forward declaration of a class type
Definition ZFCoreTypeDef_ClassType.h:31
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
_ZFT_t_zfindex zfindex
similar to size_t, used for index and size only
Definition ZFCoreTypeDef_CoreType.h:154
key value container of ZFObject
#define ZFMP_IN_OUT(ParamType, paramName)
see ZFMP_IN
Definition ZFMethod.h:117
#define ZFMP_IN(ParamType, paramName)
macro to wrap param types for ZFMETHOD_INLINE_0 series
Definition ZFMethod.h:105
#define ZFMETHOD_DECLARE_0(ReturnType, MethodName)
see ZFMethod
Definition ZFMethodDeclare.h:693
#define ZFMETHOD_DECLARE_2(ReturnType, MethodName, ZFMP_0, ZFMP_1)
see ZFMethod
Definition ZFMethodDeclare.h:1025
#define ZFMETHOD_DECLARE_1(ReturnType, MethodName, ZFMP_0)
see ZFMethod
Definition ZFMethodDeclare.h:854
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
#define zfclass
same as class, shows that this class is a ZFObject type
Definition ZFObjectClassTypeFwd.h:38
#define ZFOBJECT_ON_INIT_DECLARE_1(ZFMP_0)
see ZFOBJECT_ON_INIT_INLINE_1
Definition ZFObjectDeclare.h:263
#define ZFOBJECT_DECLARE(ChildClass, SuperClass,...)
necessary for every class inherit from ZFObject
Definition ZFObjectDeclare.h:126
light weight array
Definition ZFCoreArray.h:331
virtual void iterRemove(zfiter &it)
see zfiter
virtual zfany iterValue(const zfiter &it)
see zfiter
virtual void remove(ZFObject *key)
remove value associated with key
virtual void iterAdd(ZFObject *key, ZFObject *value)
see zfiter
virtual zfany iterKey(const zfiter &it)
see zfiter
virtual void removeAll()
remove all content
virtual ZFCoreArray< zfauto > allKey()
see allKey
virtual zfiter iter()
see zfiter
virtual zfbool isEmpty()
return true if empty or false if not empty
virtual void objectOnInit(ZFKeyValueContainer *another)
init from a existing container
virtual zfbool isContain(ZFObject *key)
return true if contain key
virtual void allValueT(ZFCoreArray< zfauto > &ret)
get a copy of all value
virtual zfiter iterFind(ZFObject *key)
see zfiter
virtual zfauto removeAndGet(ZFObject *key)
remove and return removed value or null if not exist
virtual zfany get(ZFObject *key)
get element by key or null if no such key
virtual void addFrom(ZFKeyValueContainer *another)
add data from another container
virtual ZFCoreArray< zfauto > allValue()
see allValue
virtual zfindex count()
return number of content
virtual void set(ZFObject *key, ZFObject *value)
set a key value pair
virtual void objectOnDealloc(void)
override this to destroy your object
virtual void allKeyT(ZFCoreArray< zfauto > &ret)
get a copy of all key
util method to cast ZFObject types freely
Definition zfany.h:35
a ZFObject holder which would release content object automatically when destroyed
Definition zfautoFwd.h:34
iterator for ZFFramework
Definition zfiter.h:40