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

iterator for ZFFramework More...

#include <zfiter.h>

Classes

class  Impl
 see zfiter More...
 

Public Member Functions

zfbool valid (void) const
 whether valid
 
void next (void) const
 move to next
 
zfiter copy (void) const
 copy
 
zfbool isEqual (const zfiter &ref) const
 compare
 
 zfiter (void)
 create a dummy iterator
 
 zfiter (Impl *impl)
 implementations of iterables must use this to create an iterator, see zfiter
 
Implimpl (void) const
 implementations may use this method to access data passed from constructor, see zfiter
 
template<typename T_Impl>
T_Impl impl (void) const
 implementations may use this method to access data passed from constructor, see zfiter
 
void objectInfoT (zfstring &ret) const
 see objectInfo
 
zfstring objectInfo (void) const
 return object info
 

Detailed Description

iterator for ZFFramework

zfiter is an abstract iterator holder, which simply stores an void * pointer for implementations to achieve iterator logic

typically, you may use iterators like this:

for(zfiter it = someIterable.iter(); it; ++it) {
const SomeType &value = someIterable.iterValue(it);
}
zfiter(void)
create a dummy iterator
Definition zfiter.h:104

for key-value container, access by iterator should return value, and should supply key-value version of iterator access:

for(zfiter it = keyValueIterable.iterFind(key); it; ++it) {
// access key and value
KeyType key = keyValueIterable.iterKey(it);
ValueType value = keyValueIterable.iterValue(it);
}


for implementations, you should construct a zfiter with proper zfiter::Impl


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