ddc
Public Member Functions | Public Attributes | List of all members
CQFSort Class Reference

#include <QueryFilter.h>

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

Public Member Functions

 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 CQFilterClone ()
 clone this filter More...
 
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...
 
virtual bool Compile (CQueryCompiler *compiler, CQueryOptions *options)
 compile the filter. Default implementation just pushes m_Filter onto options->m_Filters 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 toString (void)
 convert filter to a canonical string More...
 
virtual string jsonClass (void)
 
virtual string jsonMinMax (void)
 
virtual string jsonType (void)
 
virtual string jsonData (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...
 
virtual ddcObjectList Children () const
 
virtual void DisownChildren ()
 
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

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 sort filters, associated with a CDDCFilterWithBounds object (ConcCommon.h) m_arg0: unused, m_arg1: lower_bound, m_arg2: upper_bound

Constructor & Destructor Documentation

◆ CQFSort() [1/2]

CQFSort::CQFSort ( HitSortEnum  ftype = NoSort,
const string &  arg0 = string(""),
const string &  arg1 = string(""),
const string &  arg2 = string("") 
)

◆ CQFSort() [2/2]

CQFSort::CQFSort ( HitSortEnum  ftype,
const string &  arg0,
int  arg1i,
int  arg2i 
)

◆ ~CQFSort()

virtual CQFSort::~CQFSort ( )
inlinevirtual

Member Function Documentation

◆ Clone()

virtual CQFilter* CQFSort::Clone ( )
inlinevirtual

◆ FilterType()

virtual HitSortEnum CQFSort::FilterType ( ) const
inlinevirtual

sort-type for this filter (if any)

Reimplemented from CQFilter.

References CQFilter::Compile(), CDDCFilterWithBounds::m_FilterType, and CQFilter::toString().

Here is the call graph for this function:

◆ SortBounds()

void CQFSort::SortBounds ( void  )

swap lower- and upper-bounds if they not in logical order

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

◆ Compile()

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

◆ ResolveAttributeName()

string CQFSort::ResolveAttributeName ( CQueryCompiler compiler,
const string &  attrName,
bool  allowBiblExpander = false 
)

compilation utility: return a valid bibliographic attribute for attrName

  • prefers attrName if that is a valid attribute name
  • otherwise uses compiler->m_pHolder->m_pConcordance->m_Bibl.m_DefaultAttrName if non-empty and a valid attribute name
  • otherwise returns an empty string

References CBiblIndex::HasBiblExpander(), CBiblIndex::HasFreeBiblIndex(), CConcordance::m_BiblIndex, CBiblIndex::m_DefaultAttrName, CConcSession::m_pConcordance, and CQueryCompiler::m_pHolder.

Referenced by CQFBiblSort::Compile(), CQFHasField::Compile(), and GetBiblConstant().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBiblConstant()

CFreeBiblIndex * CQFSort::GetBiblConstant ( CQueryCompiler compiler,
const string &  attrName,
bool  allowBiblExpander = true 
)

compilation & satisfiability-check utility: return constant bibliographic index for attrName (if it is one), or NULL

References cfbiStringConstant, CBiblIndex::GetFreeBiblIndex(), CFreeBiblIndex::GetTypeId(), CConcordance::m_BiblIndex, CConcSession::m_pConcordance, CQueryCompiler::m_pHolder, and ResolveAttributeName().

Referenced by CQFHasFieldValue::CheckSatisfiable(), CQFHasFieldRegex::CheckSatisfiable(), and CQFHasFieldSet::CheckSatisfiable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ argString()

string CQFSort::argString ( const string &  arg) const

stringification utility: quoted strign for arg, or empty string

References escapeChars().

Referenced by CQFBiblSort::toString(), and CQFContextSort::toString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toString()

string CQFSort::toString ( void  )
virtual

convert filter to a canonical string

Reimplemented from CQFilter.

Reimplemented in CQFPrune, CQFHasField, CQFContextSort, and CQFBiblSort.

References EngMakeUpper(), HitSortEnumStrings, m_arg0, m_arg1, m_arg2, m_Filter, and CDDCFilterWithBounds::m_FilterType.

Referenced by CQFBiblSort::Compile(), CQFContextSort::Compile(), CQFHasField::Compile(), CQFHasFieldValue::Compile(), CQFHasFieldRegex::Compile(), and CQFHasFieldSet::Compile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jsonClass()

virtual string CQFSort::jsonClass ( void  )
inlinevirtual

class-name for json strinfication

  • default implementation returns C++ class name

Reimplemented from CQFilter.

Reimplemented in CQFPrune, CQFHasFieldSet, CQFHasFieldInfix, CQFHasFieldSuffix, CQFHasFieldPrefix, CQFHasFieldRegex, CQFHasFieldValue, CQFHasField, CQFContextSort, CQFBiblSort, CQFRandomSort, CQFSizeSort, CQFDateSort, and CQFRankSort.

◆ jsonMinMax()

string CQFSort::jsonMinMax ( void  )
virtual

Reimplemented in CQFHasField, and CQFBiblSort.

References jsonStr(), m_arg1, and m_arg2.

Referenced by CQFBiblSort::jsonData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jsonType()

string CQFSort::jsonType ( void  )
virtual

References HitSortEnumStrings, jsonStr(), m_Filter, and CDDCFilterWithBounds::m_FilterType.

Referenced by CQFBiblSort::jsonData(), and CQFContextSort::jsonData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jsonData()

virtual string CQFSort::jsonData ( void  )
inlinevirtual

instance data for json stringification

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

Reimplemented from ddcObject.

Reimplemented in CQFPrune, CQFContextSort, CQFBiblSort, CQFRandomSort, and CQFRankSort.

Member Data Documentation

◆ m_Filter

CDDCFilterWithBounds CQFSort::m_Filter

◆ m_arg0

std::string CQFSort::m_arg0

◆ m_arg1

std::string CQFSort::m_arg1

◆ m_arg2

std::string CQFSort::m_arg2

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