ddc
|
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... | |
NavHint & | operator= (const NavHint &X) |
assignment operator More... | |
NavHint & | operator= (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... | |
navigation hint with respect to local subcorpus tree, for get_first_hits "paging"
|
inline |
default constructor
nDtrs | number of immediate subcorpora |
|
inline |
constructor given local offset and number of daughters
|
inline |
constructor given sort key, offset, and number of subcorpora
|
inline |
full constructor
|
inline |
constructor from string
References NavHintKey::fromString().
|
inline |
clear the hint
Referenced by CRunQueryData::Clear(), CDDCBranchServer::handle__get_hit_strings(), NavHintCache::lower_bound(), and CDDCBranchServer::RunDistributed().
|
inline |
returns true iff this is an empty hint
Referenced by CDDCBranchServer::RunGetFirstHits().
size_t NavHint::OffsetTotal | ( | ) | const |
get sum of daughter offsets
Referenced by CDDCBranchServer::GetFirstHitsFromCorpora().
|
inline |
convenience wrapper: set local offset to sum of daughter offsets
|
inline |
get hint-string for daughter number DtrNo
Referenced by CDDCBranchServer::GetFirstHitsFromCorpora().
|
inline |
get offset for daughter number DtrNo
assignment operator
References m_DtrHints, m_Offset, and m_SortKey.
|
inline |
string assignment wraps fromString()
References NavHintKey::fromString().
|
inline |
assigns SortKey and Offset and resize DtrHints
References NavHintKey::fromString(), NavHintKey::toJson(), and NavHintKey::toString().
string NavHint::toString | ( | bool | includeSortKey = true | ) | const |
serialization: returns a string-form for this hint suitable for parsing with the fromString() method.
OFFSET ("(" DTR_OFFSETS ")")? (" " SORTKEY)?
DTR_OFFSETS
is omitted. $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. "\t" SORTKEY
suffix is omitted. Referenced by CDDCBranchServer::handle__get_hit_strings(), NavHintCache::insert(), and CRunQueryData::toString().
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().
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().
string NavHint::m_SortKey |
minimum sort key from this node or any subcorpus
Referenced by CDDCBranchServer::GetFirstHitsFromCorpora(), CDDCBranchServer::GetHitContexts(), CDDCLeafServer::handle__get_first_hits(), CDDCLeafServer::handle__run_query(), and operator=().
size_t NavHint::m_Offset |
minimum offset for local corpus node
Referenced by CDDCBranchServer::GetHitContexts(), CDDCLeafServer::handle__get_first_hits(), CDDCBranchServer::handle__get_first_hits(), CDDCLeafServer::handle__run_query(), operator=(), and CDDCBranchServer::UpdateNavCache().
vector<string> NavHint::m_DtrHints |
offset hints for immediate daughter subcorpora
Referenced by CDDCBranchServer::GetHitContexts(), and operator=().