ddc
Public Member Functions | Public Attributes | List of all members
CQueryResultIndex Struct Reference

temporary type for (re-)sorting CQueryResult hits More...

#include <QueryResult.h>

Collaboration diagram for CQueryResultIndex:
Collaboration graph
[legend]

Public Member Functions

 CQueryResultIndex (const CQueryResult &Result)
 Default constructor creates new trivial hit index. More...
 
 CQueryResultIndex (const CQueryResult &Result, vector< size_t > *HitIndex)
 
 CQueryResultIndex (const CQueryResult &Result, vector< size_t > &HitIndex)
 
 ~CQueryResultIndex (void)
 Destructor. More...
 
void Reset (void)
 Resets the hit-index to the trivial sequence sort-order. More...
 
size_t size (void) const
 Wrapper for m_pHitIndex->size() More...
 
template<typename HitIndexLessThanT >
void SortByIndex (HitIndexLessThanT &HitIndexLess)
 
template<typename HitLessThanT >
void SortByHit (HitLessThanT &HitLess)
 
void Apply (CQueryResult &Dst, size_t Begin=0, size_t End=(size_t) -1)
 

Public Attributes

const CQueryResultm_Result
 result-set containing hits to be indexed/sorted More...
 
vector< size_t > * m_pHitIndex
 hit index: elements are indices into m_Result.m_Hits, sorted in "logical" order More...
 
bool m_bLocalIndex
 whether m_pHitIndex was created locally (if true, it will be destroyed with this object) More...
 

Detailed Description

temporary type for (re-)sorting CQueryResult hits

Constructor & Destructor Documentation

◆ CQueryResultIndex() [1/3]

CQueryResultIndex::CQueryResultIndex ( const CQueryResult Result)
inline

Default constructor creates new trivial hit index.

◆ CQueryResultIndex() [2/3]

CQueryResultIndex::CQueryResultIndex ( const CQueryResult Result,
vector< size_t > *  HitIndex 
)
inline

Constructor for an existing hit index pHitIndex (pointer version)

  • caller is responsible for destroying pHitIndex when it is no longer needed

◆ CQueryResultIndex() [3/3]

CQueryResultIndex::CQueryResultIndex ( const CQueryResult Result,
vector< size_t > &  HitIndex 
)
inline

Constructor for an existing hit index HitIndex (reference version)

  • caller is responsible for destroying HitIndex when it is no longer needed

◆ ~CQueryResultIndex()

CQueryResultIndex::~CQueryResultIndex ( void  )
inline

Destructor.

Member Function Documentation

◆ Reset()

void CQueryResultIndex::Reset ( void  )

Resets the hit-index to the trivial sequence sort-order.

◆ size()

size_t CQueryResultIndex::size ( void  ) const
inline

Wrapper for m_pHitIndex->size()

◆ SortByIndex()

template<typename HitIndexLessThanT >
void CQueryResultIndex::SortByIndex ( HitIndexLessThanT &  HitIndexLess)
inline

sort hit-index by generic index-comparison function

  • HitIndexLessThanT must support an operator() (size_t& a, size_t& b) returning true iff m_Result.m_Hits[a] < m_Result.m_Hits[b]

Referenced by CQueryResult::SortResultsByIndex().

Here is the caller graph for this function:

◆ SortByHit()

template<typename HitLessThanT >
void CQueryResultIndex::SortByHit ( HitLessThanT &  HitLess)
inline

sort hits by generic hit-comparison function

  • HitLessThanT must support an operator() (CHit& a, CHit& b) returning true iff a < b

Referenced by CQueryResult::SortResultsByHit().

Here is the caller graph for this function:

◆ Apply()

void CQueryResultIndex::Apply ( CQueryResult Dst,
size_t  Begin = 0,
size_t  End = (size_t)-1 
)

copy selected source hits in index-order from m_pResult to Dst

  • clobbers current contents of Dst
  • only hits in index-range begin (inclusive) to end (exclusive) are copied
  • End defaults to m_HitIndex.size()

References CQueryResult::m_DebugInfo, CQueryResult::m_HighlightIds, CQueryResult::m_HighlightOccurs, and CQueryResult::m_Hits.

Referenced by CConcSession::GetHits(), CQueryResult::SortResultsByHit(), and CQueryResult::SortResultsByIndex().

Here is the caller graph for this function:

Member Data Documentation

◆ m_Result

const CQueryResult& CQueryResultIndex::m_Result

result-set containing hits to be indexed/sorted

◆ m_pHitIndex

vector<size_t>* CQueryResultIndex::m_pHitIndex

hit index: elements are indices into m_Result.m_Hits, sorted in "logical" order

◆ m_bLocalIndex

bool CQueryResultIndex::m_bLocalIndex

whether m_pHitIndex was created locally (if true, it will be destroyed with this object)


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