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

navigation hint with respect to local subcorpus tree, for get_first_hits "paging" More...

#include <NavHint.h>

Public Member Functions

 NavHint (size_t nDtrs=0)
 
 NavHint (size_t Offset, size_t nDtrs)
 constructor given local offset and number of daughters More...
 
 NavHint (const string &SortKey, size_t Offset, size_t nDtrs)
 constructor given sort key, offset, and number of subcorpora More...
 
 NavHint (const string &SortKey, size_t Offset, const vector< string > DtrHints)
 full constructor More...
 
 NavHint (const string &HintStr)
 constructor from string More...
 
void clear (size_t nDtrs=0)
 clear the hint More...
 
bool empty () const
 returns true iff this is an empty hint More...
 
size_t OffsetTotal () const
 get sum of daughter offsets More...
 
void UpdateOffset ()
 convenience wrapper: set local offset to sum of daughter offsets More...
 
const char * DtrHint (size_t DtrNo) const
 get hint-string for daughter number DtrNo More...
 
size_t DtrOffset (size_t DtrNo) const
 get offset for daughter number DtrNo More...
 
NavHintoperator= (const NavHint &X)
 assignment operator More...
 
NavHintoperator= (const string &S)
 string assignment wraps fromString() More...
 
void update (const string &SortKey, size_t Offset, size_t nDtrs)
 assigns SortKey and Offset and resize DtrHints More...
 
string toString (bool includeSortKey=true) const
 
void fromString (const string &Str)
 de-serialization: parses a string hint as returned by the toString() method, which see for details on the accepted syntax. More...
 
string toJson () const
 debug: JSON stringification More...
 

Public Attributes

string m_SortKey
 minimum sort key from this node or any subcorpus More...
 
size_t m_Offset
 minimum offset for local corpus node More...
 
vector< string > m_DtrHints
 offset hints for immediate daughter subcorpora More...
 

Detailed Description

navigation hint with respect to local subcorpus tree, for get_first_hits "paging"

Constructor & Destructor Documentation

◆ NavHint() [1/5]

NavHint::NavHint ( size_t  nDtrs = 0)
inline

default constructor

Parameters
nDtrsnumber of immediate subcorpora

◆ NavHint() [2/5]

NavHint::NavHint ( size_t  Offset,
size_t  nDtrs 
)
inline

constructor given local offset and number of daughters

◆ NavHint() [3/5]

NavHint::NavHint ( const string &  SortKey,
size_t  Offset,
size_t  nDtrs 
)
inline

constructor given sort key, offset, and number of subcorpora

◆ NavHint() [4/5]

NavHint::NavHint ( const string &  SortKey,
size_t  Offset,
const vector< string >  DtrHints 
)
inline

full constructor

◆ NavHint() [5/5]

NavHint::NavHint ( const string &  HintStr)
inline

constructor from string

References NavHintKey::fromString().

Here is the call graph for this function:

Member Function Documentation

◆ clear()

void NavHint::clear ( size_t  nDtrs = 0)
inline

clear the hint

Referenced by CRunQueryData::Clear(), CDDCBranchServer::handle__get_hit_strings(), NavHintCache::lower_bound(), and CDDCBranchServer::RunDistributed().

Here is the caller graph for this function:

◆ empty()

bool NavHint::empty ( void  ) const
inline

returns true iff this is an empty hint

Referenced by CDDCBranchServer::RunGetFirstHits().

Here is the caller graph for this function:

◆ OffsetTotal()

size_t NavHint::OffsetTotal ( ) const

get sum of daughter offsets

Referenced by CDDCBranchServer::GetFirstHitsFromCorpora().

Here is the caller graph for this function:

◆ UpdateOffset()

void NavHint::UpdateOffset ( )
inline

convenience wrapper: set local offset to sum of daughter offsets

◆ DtrHint()

const char* NavHint::DtrHint ( size_t  DtrNo) const
inline

get hint-string for daughter number DtrNo

Referenced by CDDCBranchServer::GetFirstHitsFromCorpora().

Here is the caller graph for this function:

◆ DtrOffset()

size_t NavHint::DtrOffset ( size_t  DtrNo) const
inline

get offset for daughter number DtrNo

◆ operator=() [1/2]

NavHint& NavHint::operator= ( const NavHint X)
inline

assignment operator

References m_DtrHints, m_Offset, and m_SortKey.

◆ operator=() [2/2]

NavHint& NavHint::operator= ( const string &  S)
inline

string assignment wraps fromString()

References NavHintKey::fromString().

Here is the call graph for this function:

◆ update()

void NavHint::update ( const string &  SortKey,
size_t  Offset,
size_t  nDtrs 
)
inline

assigns SortKey and Offset and resize DtrHints

References NavHintKey::fromString(), NavHintKey::toJson(), and NavHintKey::toString().

Here is the call graph for this function:

◆ toString()

string NavHint::toString ( bool  includeSortKey = true) const

serialization: returns a string-form for this hint suitable for parsing with the fromString() method.

  • returned string is of the form OFFSET ("(" DTR_OFFSETS ")")? (" " SORTKEY)?
  • if the local node has no daughters, the daughter offset hint DTR_OFFSETS is omitted.
  • if the local node is a branch-node, $DTR_OFFSETS is a "+"-separated list of subcorpus-wise daughter offset hints of the form DTR_OFFSET_1 "+" DTR_OFFSET_2 "+" ... "+" DTR_OFFSET_N, and each DTR_OFFSET_i item is a nested hint DTR_OFFSET ("(" DTR_DTR_OFFSETS ")")? appropriate for the respective daughter subcorpus.
  • if m_SortKey is empty, the "\t" SORTKEY suffix is omitted.

Referenced by CDDCBranchServer::handle__get_hit_strings(), NavHintCache::insert(), and CRunQueryData::toString().

Here is the caller graph for this function:

◆ fromString()

void NavHint::fromString ( const string &  Str)

de-serialization: parses a string hint as returned by the toString() method, which see for details on the accepted syntax.

References NavHintKey::clear().

Here is the call graph for this function:

◆ toJson()

string NavHint::toJson ( ) const

debug: JSON stringification

References Format(), and jsonStr().

Referenced by CDDCLeafServer::handle__get_first_hits(), CDDCLeafServer::handle__run_query(), CDDCBranchServer::RunGetFirstHits(), and CDDCBranchServer::UpdateNavCache().

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

Member Data Documentation

◆ m_SortKey

string NavHint::m_SortKey

◆ m_Offset

size_t NavHint::m_Offset

◆ m_DtrHints

vector<string> NavHint::m_DtrHints

offset hints for immediate daughter subcorpora

Referenced by CDDCBranchServer::GetHitContexts(), and operator=().


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