Xpace
Xpace::RefListCursor Class Reference

A cursor into a list of references - e.g., a search result A single reference is an array of uint64s. More...

#include <reflist.h>

Classes

class  Sink
 Interface of the functor passed to forEach(). More...
 

Public Member Functions

uint64 getCount () const
 
uint64 getPosition () const
 
bool move (int64 distance=1, bool relative=true)
 move the cursor More...
 
uint64 operator* () const
 
const uint64get () const
 
const uint64get (uint *len) const
 
bool forEach (Sink *sink, uint64 start=0) const
 Enumerate references in the cursor's underlying reference list, starting at start (relative to the whole list), calling the callThis functor for each one. More...
 
bool operator! () const
 
void opOr (RefListCursor *rhs)
 this list OR rhs list More...
 
void opAnd (RefListCursor *rhs)
 this list AND rhs list More...
 
uint64 countAnd (const RefListCursor &rhs) const
 count the refs in this list AND rhs list More...
 
void opNot (uint64 end=0)
 invert a ref list More...
 
bool hasRef (uint64 ref, uint64 *pos=0) const
 Does this reference list have this ref? More...
 
bool hasRef (std::vector< uint64 > &ref, uint64 *pos=0) const
 Does this reference list have this ref? More...
 
void addRef (uint64 ref)
 add a reference to the list More...
 
void addRef (std::vector< uint64 > &ref)
 
void removeRef (uint64 ref)
 remove a reference from the list More...
 
void removeRef (std::vector< uint64 > ref)
 

Static Public Member Functions

static RefListCursor opAnd (std::vector< RefListCursor > *list)
 AND a vector of ref lists. More...
 

Static Public Attributes

static RefListCursor null
 

Detailed Description

A cursor into a list of references - e.g., a search result A single reference is an array of uint64s.

Definition at line 26 of file reflist.h.

Member Function Documentation

uint64 Xpace::RefListCursor::getCount ( ) const
Returns
the number of references in the list
uint64 Xpace::RefListCursor::getPosition ( ) const
Returns
the current cursor position within the list
bool Xpace::RefListCursor::move ( int64  distance = 1,
bool  relative = true 
)

move the cursor

Parameters
distancethe distance to move
relativethe starting point; true = move from current position, false = move from start
Returns
true if move succeeded, false (and do not move) otherwise
uint64 Xpace::RefListCursor::operator* ( ) const
Returns
the first element of the current ref
const uint64* Xpace::RefListCursor::get ( ) const
Returns
a pointer to the array of uint64s that make up the current ref
const uint64* Xpace::RefListCursor::get ( uint len) const
Parameters
len- fillin for the number of elements in the current ref
Returns
a pointer to the array of uint64s that make up the current ref
bool Xpace::RefListCursor::forEach ( Sink sink,
uint64  start = 0 
) const

Enumerate references in the cursor's underlying reference list, starting at start (relative to the whole list), calling the callThis functor for each one.

The cursor itself is unchanged.

Parameters
callThis will be called for each reference in the list
startCall callThis beginning at this ref
Returns
true if all references were iterated, false if iteration was aborted
bool Xpace::RefListCursor::operator! ( ) const
Returns
true if past last ref
void Xpace::RefListCursor::opOr ( RefListCursor rhs)

this list OR rhs list

Parameters
rhsthe other source list
void Xpace::RefListCursor::opAnd ( RefListCursor rhs)

this list AND rhs list

Parameters
rhsthe other source list
static RefListCursor Xpace::RefListCursor::opAnd ( std::vector< RefListCursor > *  list)
static

AND a vector of ref lists.

Parameters
listthe source lists. NB - any of these may be altered
Returns
the result, which may be one of the source lists
uint64 Xpace::RefListCursor::countAnd ( const RefListCursor rhs) const

count the refs in this list AND rhs list

Parameters
rhsthe other source list
Returns
the number of refs
void Xpace::RefListCursor::opNot ( uint64  end = 0)

invert a ref list

Parameters
endthe number of refs in the universe; if 0, get from index
bool Xpace::RefListCursor::hasRef ( uint64  ref,
uint64 pos = 0 
) const

Does this reference list have this ref?

Parameters
reflook for this ref
posfill-in the position in the list of this ref
Returns
true if the list has the ref, false if not

Referenced by Xpace::SortToSink< LIST >::complete().

bool Xpace::RefListCursor::hasRef ( std::vector< uint64 > &  ref,
uint64 pos = 0 
) const

Does this reference list have this ref?

Parameters
reflook for this ref
posfill-in the position in the list of this ref
Returns
true if the list has the ref, false if not
void Xpace::RefListCursor::addRef ( uint64  ref)

add a reference to the list

Parameters
refadd this ref
void Xpace::RefListCursor::addRef ( std::vector< uint64 > &  ref)
Parameters
refadd this ref
void Xpace::RefListCursor::removeRef ( uint64  ref)

remove a reference from the list

Parameters
removethis ref (if it exists)
void Xpace::RefListCursor::removeRef ( std::vector< uint64 ref)
Parameters
removethis ref (if it exists)

Member Data Documentation

RefListCursor Xpace::RefListCursor::null
static

Definition at line 29 of file reflist.h.


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

current as of Wed Jun 10 2026 12:00:06