ZFFramework
Loading...
Searching...
No Matches
ZFCoreOrderMap Class Reference

map type which keeps item order, for private use only More...

#include <ZFCoreOrderMap.h>

Public Member Functions

 ZFCoreOrderMap (void)
 construct an empty map
 ZFCoreOrderMap (const ZFCoreOrderMap &ref)
 retain the ref, to copy, use copyFrom
ZFCoreOrderMapoperator= (const ZFCoreOrderMap &ref)
 retain the ref, to copy, use copyFrom
zfbool operator== (const ZFCoreOrderMap &ref) const
 true if same ref
zfbool operator!= (const ZFCoreOrderMap &ref) const
 true if not same ref
void objectInfoT (zfstring &ret) const
 see objectInfo
zfstring objectInfo (void) const
 return object info
void objectInfoOfContentT (zfstring &ret, zfindex maxCount=((zfindex) -1), const ZFTokenForKeyValueContainer &token=_ZFP_ZFTokenForKeyValueContainerDefault) const
 see objectInfoOfContent
zfstring objectInfoOfContent (zfindex maxCount=((zfindex) -1), const ZFTokenForKeyValueContainer &token=_ZFP_ZFTokenForKeyValueContainerDefault) const
 return contents info
void swap (ZFCoreOrderMap &ref)
 swap internal data
void copyFrom (const ZFCoreOrderMap &ref)
 copy all contents from ref, remove all before copy
zfindex objectRetainCount (void) const
 get current retain count
zfindex count (void) const
 return count
zfbool isEmpty (void) const
 true if empty
zfbool isContain (const zfstring &key) const
 true if contains the key
void addFrom (const ZFCoreOrderMap &ref)
 add elements from ref
void set (const zfstring &key, const ZFCorePointer &value)
 change value or create if not exist, value would be retained by this method
const ZFCorePointerget (const zfstring &key) const
 get value or null if not exist
template<typename T_Element>
T_Element get (const zfstring &key) const
 get value or null if not exist
void allKeyT (ZFCoreArray< zfstring > &ret) const
 see allKey
ZFCoreArray< zfstringallKey (void) const
 return a copy of all keys
void allValueT (ZFCoreArray< const ZFCorePointer * > &ret) const
 see allValue
ZFCoreArray< const ZFCorePointer * > allValue (void) const
 return a copy of all values
template<typename T_Element>
void allValueT (ZFCoreArray< T_Element > &ret) const
 see allValue
void remove (const zfstring &key)
 remove or do nothing if not exist
void removeAll (void)
 remove all content
zfiter iter (void) const
 see zfiter
zfiter iterFind (const zfstring &key) const
 see zfiter
zfstring iterKey (const zfiter &it) const
 see zfiter
const ZFCorePointeriterValue (const zfiter &it) const
 see zfiter
void iterValue (zfiter &it, const ZFCorePointer &newValue)
 see zfiter
void iterRemove (zfiter &it)
 see zfiter
void iterAdd (const zfstring &key, const ZFCorePointer &value)
 see zfiter
template<typename T_Element>
T_Element iterValue (const zfiter &it) const
 see zfiter
const ZFCorePointerupdate (const zfstring &key) const
 try update value order by moving to tail, return null if not exist
template<typename T_Element>
T_Element update (const zfstring &key) const
 try update value order by moving to tail, return null if not exist

Detailed Description

map type which keeps item order, for private use only

Member Function Documentation

◆ set()

void ZFCoreOrderMap::set ( const zfstring & key,
const ZFCorePointer & value )

change value or create if not exist, value would be retained by this method

null key is considered same as empty string
assert fail if value is null (use an empty smart pointer to store null value)


The documentation for this class was generated from the following file: