ZFFramework
 
Loading...
Searching...
No Matches
ZFFilterBase< T_Public, T_Internal > Class Template Referenceabstract

base class of filter More...

#include <ZFFilter.h>

Inheritance diagram for ZFFilterBase< T_Public, T_Internal >:
ZFFilterBasic< zfint > ZFFilterBasic< zfindex > ZFFilterBasic< zfidentity > ZFFilterBasic< const ZFMethod * > ZFFilterBasic< ZFObject * > ZFFilterBasic< const ZFProperty * > ZFFilterForStringBase< const zfchar *, zfstring > ZFFilterForZFMethod ZFFilterForZFObject ZFFilterForZFProperty

Public Types

typedef ZFFilterResult(* CustomFilterCallback) (T_Public const &e)
 custom filter callback for ZFFilter
 

Public Member Functions

 ZFFilterBase (void)
 main constructor
 
 ZFFilterBase (const ZFFilterBase< T_Public, T_Internal > &ref)
 construct from another filter, retain only, you should use copyFrom to copy contents
 
virtual ZFFilterBase< T_Public, T_Internal > & operator= (const ZFFilterBase< T_Public, T_Internal > &ref)
 retain only
 
virtual void copyFrom (ZFFilterBase< T_Public, T_Internal > const &ref)
 copy from another filter
 
virtual ZFFilterBase< T_Public, T_Internal > & filter (T_Public const &e, ZFFilterType filterType=ZFFilterTypeExclude)
 add a element
 
virtual ZFFilterBase< T_Public, T_Internal > & filterRemove (T_Public const &e, ZFFilterType filterType=ZFFilterTypeExclude)
 remove a element
 
virtual ZFFilterBase< T_Public, T_Internal > & filterRemoveAt (zfindex index)
 remove a element
 
virtual void filterRemoveAll (void)
 remove all contents of this filter
 
virtual zfindex filterCount (void) const
 get count of element
 
virtual T_Public filterElementAt (zfindex index) const
 get element at index
 
virtual T_Internal const & filterInternalAt (zfindex index) const
 get filter data at index
 
virtual ZFFilterType filterTypeAt (zfindex index) const
 get filter type for filter data at index
 
virtual ZFFilterBase< T_Public, T_Internal > & customFilterCallbackAdd (typename ZFFilterBase< T_Public, T_Internal >::CustomFilterCallback customFilterCallback)
 add a custom filter callback
 
virtual ZFFilterBase< T_Public, T_Internal > & customFilterCallbackRemove (typename ZFFilterBase< T_Public, T_Internal >::CustomFilterCallback customFilterCallback)
 remove custom filter callback
 
virtual ZFFilterBase< T_Public, T_Internal > & customFilterCallbackRemove (zfindex index)
 remove custom filter callback
 
virtual zfindex customFilterCallbackCount (void) const
 get custom filter callback count
 
virtual ZFFilterBase< T_Public, T_Internal >::CustomFilterCallback customFilterCallbackAt (zfindex index) const
 get custom filter callback
 
virtual zfbool filterPassed (T_Public const &e) const
 return true if e is not filtered by this filter, see ZFFilterType
 
virtual void objectInfoT (zfstring &ret) const
 see objectInfo
 
virtual zfstring objectInfo (void) const
 return object info
 

Protected Types

typedef ZFFilterBase< T_Public, T_Internal > zfself
 typedef for self
 

Protected Member Functions

virtual zfbool filterOnCheckValid (T_Public const &e) const
 return true if element is valid for a filter
 
virtual void filterOnStore (T_Internal &to, T_Public const &from) const =0
 store public type to internal storage type
 
virtual void filterOnRemove (T_Internal &value) const
 called before value removed from filter
 
virtual void filterOnAccess (T_Public &to, T_Internal const &from) const =0
 access public type from internal storage type
 
virtual zfbool filterOnCheckEqual (T_Internal const &e1, T_Public const &e2) const =0
 true if e1 is regarded as equal to e2
 
virtual zfbool filterOnCheckActive (T_Public const &e) const
 called by filterPassed to check whether the element is filtered out
 

Detailed Description

template<typename T_Public, typename T_Internal = T_Public>
class ZFFilterBase< T_Public, T_Internal >

base class of filter

Member Function Documentation

◆ filter()

template<typename T_Public, typename T_Internal = T_Public>
virtual ZFFilterBase< T_Public, T_Internal > & ZFFilterBase< T_Public, T_Internal >::filter ( T_Public const & e,
ZFFilterType filterType = ZFFilterTypeExclude )
inlinevirtual

add a element

note this method won't check duplicated data for performance

◆ objectInfoT()

template<typename T_Public, typename T_Internal = T_Public>
virtual void ZFFilterBase< T_Public, T_Internal >::objectInfoT ( zfstring & ret) const
inlinevirtual

◆ filterOnCheckValid()

template<typename T_Public, typename T_Internal = T_Public>
virtual zfbool ZFFilterBase< T_Public, T_Internal >::filterOnCheckValid ( T_Public const & e) const
inlineprotectedvirtual

return true if element is valid for a filter

if false, won't be added to content by filter or compared by filterOnCheckEqual

Reimplemented in ZFFilterForStringBase< T_Public, T_Internal >.

◆ filterOnStore()

template<typename T_Public, typename T_Internal = T_Public>
virtual void ZFFilterBase< T_Public, T_Internal >::filterOnStore ( T_Internal & to,
T_Public const & from ) const
protectedpure virtual

store public type to internal storage type

Implemented in ZFFilterForStringBase< T_Public, T_Internal >.

◆ filterOnAccess()

template<typename T_Public, typename T_Internal = T_Public>
virtual void ZFFilterBase< T_Public, T_Internal >::filterOnAccess ( T_Public & to,
T_Internal const & from ) const
protectedpure virtual

access public type from internal storage type

Implemented in ZFFilterForStringBase< T_Public, T_Internal >.

◆ filterOnCheckEqual()

template<typename T_Public, typename T_Internal = T_Public>
virtual zfbool ZFFilterBase< T_Public, T_Internal >::filterOnCheckEqual ( T_Internal const & e1,
T_Public const & e2 ) const
protectedpure virtual

true if e1 is regarded as equal to e2

subclass may override this to supply custom comparation

Implemented in ZFFilterForStringBase< T_Public, T_Internal >.


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