ddc
Public Attributes | List of all members
CQFPrune Class Reference

#include <QueryFilter.h>

Inheritance diagram for CQFPrune:
Inheritance graph
[legend]
Collaboration diagram for CQFPrune:
Collaboration graph
[legend]

Public Member Functions

CQFilter API
 CQFPrune (HitSortEnum ftype=LessByPruneKey, size_t Limit=0, CQCountKeyExprList *Keys=NULL)
 
virtual ~CQFPrune ()
 Default destructor (empty) More...
 
virtual CQFilterClone ()
 clone this filter (also clones m_keys) More...
 
virtual bool Compile (CQueryCompiler *compiler, CQueryOptions *options)
 apply the filter to the given compiler More...
 
ddcObject API
virtual string toString (void)
 convert filter to a canonical string More...
 
virtual string jsonClass (void)
 
virtual string jsonData (void)
 
virtual ddcObjectList Children () const
 
virtual void DisownChildren ()
 
CQFPrune local methods
void PruneHitsIndex (const CQuery *qRoot, vector< size_t > &PeriodHitsIndex)
 
- Public Member Functions inherited from CQFSort
 CQFSort (HitSortEnum ftype=NoSort, const string &arg0=string(""), const string &arg1=string(""), const string &arg2=string(""))
 
 CQFSort (HitSortEnum ftype, const string &arg0, int arg1i, int arg2i)
 
virtual ~CQFSort ()
 
virtual HitSortEnum FilterType () const
 sort-type for this filter (if any) More...
 
void SortBounds (void)
 swap lower- and upper-bounds if they not in logical order More...
 
string ResolveAttributeName (CQueryCompiler *compiler, const string &attrName, bool allowBiblExpander=false)
 
CFreeBiblIndexGetBiblConstant (CQueryCompiler *compiler, const string &attrName, bool allowBiblExpander=true)
 compilation & satisfiability-check utility: return constant bibliographic index for attrName (if it is one), or NULL More...
 
string argString (const string &arg) const
 stringification utility: quoted strign for arg, or empty string More...
 
virtual string jsonMinMax (void)
 
virtual string jsonType (void)
 
- Public Member Functions inherited from CQFilter
 CQFilter ()
 Default constructor. More...
 
virtual ~CQFilter ()
 Default destructor (empty) More...
 
virtual bool CheckSatisfiable (CQueryCompiler *compiler, CQueryOptions *options)
 Run fast (un)satisfiability checks for filter before Compile() is called. Default just returns true. More...
 
- Public Member Functions inherited from ddcObject
 ddcObject ()
 Default constructor. More...
 
virtual ~ddcObject ()
 virtual destructor does nothing More...
 
template<typename Visit >
ddcObjectTraverse (Visit &visit)
 
template<typename Visit >
ddcObjectTraverse (Visit &visit) const
 
template<typename Visit >
ddcObjectTraverseR (Visit &visit)
 
template<typename Visit >
ddcObjectTraverseR (Visit &visit) const
 
virtual ddcObjectList Descendants () const
 
virtual string toJson ()
 

Public Attributes

size_t m_limit
 maximum number of hits per count-key More...
 
CQCountKeyExprListm_keys
 list count-keys (externally allocated, freed here) More...
 
CCountMap m_Counts
 underlying counts More...
 
- Public Attributes inherited from CQFSort
CDDCFilterWithBounds m_Filter
 underlying DDC Filter struct More...
 
std::string m_arg0
 0th argument (e.g. field name) More...
 
std::string m_arg1
 1st argument (e.g. lower bound) More...
 
std::string m_arg2
 2nd argument (e.g. upper bound) More...
 
- Public Attributes inherited from ddcObject
void * m_User
 user data associated with this object (for use e.g. by perl wrappers) More...
 

Detailed Description

class for global query pruning filters m_arg0 : pruning limit (maximum number of hits per key)

Constructor & Destructor Documentation

◆ CQFPrune()

CQFPrune::CQFPrune ( HitSortEnum  ftype = LessByPruneKey,
size_t  Limit = 0,
CQCountKeyExprList Keys = NULL 
)

References CDDCFilterWithBounds::m_bSet, CQFSort::m_Filter, CDDCFilterWithBounds::m_KeyHi, and CDDCFilterWithBounds::m_KeyLo.

Referenced by Clone().

Here is the caller graph for this function:

◆ ~CQFPrune()

CQFPrune::~CQFPrune ( )
virtual

Default destructor (empty)

References m_keys.

Member Function Documentation

◆ Clone()

CQFilter * CQFPrune::Clone ( )
virtual

clone this filter (also clones m_keys)

Reimplemented from CQFSort.

References CQFPrune(), CQFSort::m_Filter, CDDCFilterWithBounds::m_FilterType, m_keys, m_limit, and CDDCFilterWithBounds::m_Parent.

Here is the call graph for this function:

◆ Compile()

bool CQFPrune::Compile ( CQueryCompiler compiler,
CQueryOptions options 
)
virtual

apply the filter to the given compiler

Reimplemented from CQFSort.

References CQFSort::Compile(), CQCountKeyExprList::Compile(), and m_keys.

Here is the call graph for this function:

◆ toString()

string CQFPrune::toString ( void  )
virtual

convert filter to a canonical string

Reimplemented from CQFSort.

References CQCountKeyExprList::empty(), EngMakeUpper(), Format(), HitSortEnumStrings, CQFSort::m_Filter, CDDCFilterWithBounds::m_FilterType, m_keys, m_limit, and CQCountKeyExprList::toString().

Here is the call graph for this function:

◆ jsonClass()

virtual string CQFPrune::jsonClass ( void  )
inlinevirtual

class-name for json strinfication

  • default implementation returns C++ class name

Reimplemented from CQFSort.

References ddcObject::Children(), ddcObject::DisownChildren(), and ddcObject::jsonData().

Here is the call graph for this function:

◆ jsonData()

string CQFPrune::jsonData ( void  )
virtual

instance data for json stringification

  • default implementation returns "NODATA":1, for strict syntax compliance

Reimplemented from CQFSort.

References CQCountKeyExprList::empty(), Format(), m_keys, m_limit, and CQuery::toJson().

Here is the call graph for this function:

◆ Children()

ddcObjectList CQFPrune::Children ( ) const
virtual

get a list of direct ddcObject daughters of this node

  • default just returns an empty list
  • useful for external wrappers (e.g. perl reference-counting)

Reimplemented from ddcObject.

References ddcObject::Children(), and m_keys.

Here is the call graph for this function:

◆ DisownChildren()

void CQFPrune::DisownChildren ( )
virtual

"disown" any direct child objects, preventing their destruction if the current object is deleted

  • default implementation does nothing

Reimplemented from ddcObject.

References m_keys.

◆ PruneHitsIndex()

void CQFPrune::PruneHitsIndex ( const CQuery qRoot,
vector< size_t > &  PeriodHitsIndex 
)

apply pruning filter to PeriodHitsIndex, assigning hit sort-key strings as we go

  • also assigns period-local key-ids (for use with navigation hints via ConcSession::SortKeyLB() etc)

References CQCountKeyExprList::Evaluate(), hsoDescending, CQuery::m_Compiler, m_Counts, CQFSort::m_Filter, CQueryNode::m_Hits, m_keys, m_limit, CQuery::m_Node, CConcSession::m_pConcordance, CQueryCompiler::m_pHolder, and CDDCFilterWithBounds::SortOrder().

Here is the call graph for this function:

Member Data Documentation

◆ m_limit

size_t CQFPrune::m_limit

maximum number of hits per count-key

Referenced by Clone(), jsonData(), PruneHitsIndex(), and toString().

◆ m_keys

CQCountKeyExprList* CQFPrune::m_keys

list count-keys (externally allocated, freed here)

Referenced by Children(), Clone(), Compile(), DisownChildren(), jsonData(), PruneHitsIndex(), toString(), and ~CQFPrune().

◆ m_Counts

CCountMap CQFPrune::m_Counts

underlying counts

Referenced by PruneHitsIndex().


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