Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

InvDocList Class Reference

#include <InvDocList.hpp>

Inheritance diagram for InvDocList:

DocInfoList InvFPDocList List of all members.

Public Methods

 InvDocList ()
 InvDocList (TERMID_T id, int len)
 InvDocList (MemCache *mc, TERMID_T id, int len)
 constructors for this list getting memory from a MemCache

 InvDocList (MemCache *mc, TERMID_T id, int len, DOCID_T docid, LOC_T location)
 InvDocList (TERMID_T id, int listlen, LOC_T *list, int fr, DOCID_T *ldocid, int len)
 constructor for a list not needing to get any memory

 ~InvDocList ()
void setList (TERMID_T id, int listlen, LOC_T *list, int fr, DOCID_T *ldocid=NULL, int len=0)
void setListSafe (TERMID_T id, int listlen, LOC_T *list, int fr, DOCID_T *ldocid, int len)
void reset ()
void resetFree ()
bool allocMem ()
bool hasNoMem ()
virtual bool addTerm (DOCID_T docid)
 increase count for this docid, we don't care about location

virtual bool append (InvDocList *tail)
 append the given list to the end of this list. watch for overlap of lastdocid of this list and first docid of given list.

virtual void startIteration () const
 prepare iteration

virtual bool hasMore () const
 test if there's any entry

virtual DocInfonextEntry () const
 fetch the next entry, return a pointer to a local static memory, so do not delete it

virtual void nextEntry (DocInfo *info) const
DOCID_T curDocID () const
COUNT_T docFreq () const
int length () const
TERMID_T termID () const
int termLen () const
virtual COUNT_T termCTF () const
int curDocIDdiff () const
int curDocIDtf () const
int memorySize () const
void binWrite (ofstream &of)
 write this object in binary to the given filestream. the stream should support binary writing.

bool binRead (ifstream &inf)
 read an object from the given stream into memory. the stream should be pointing to the correct place, starting exactly where binWrite began writing. this method should be used with the empty constructor, else watch out for mem leaks. returns whether the read was successful

void binWriteC (ofstream &of)
 write this object in binary to the given filestream. the stream should support binary writing. RVL compression is used before writing

bool binReadC (ifstream &inf)
 read an object from the given stream into memory. the stream should be pointing to the correct place, starting exactly where binWrite began writing. this method should be used with the empty constructor, else watch out for mem leaks. returns whether the read was successful. RVL decompression is done.


Protected Methods

virtual DocInfogetElement (DocInfo *elem, POS_T position) const
 set element from position, returns pointer to the element

virtual POS_T beginPosition () const
 position at beginning of list

virtual POS_T endPosition () const
 position at end of list

virtual POS_T nextPosition (POS_T position) const
 advance position

bool getMoreMem ()
int logb2 (int num)
virtual void deltaEncode ()
virtual void deltaDecode ()

Protected Attributes

LOC_Tbegin
LOC_Tlastid
LOC_Tfreq
LOC_Tend
LOC_Titer
int size
int LOC_Tsize
int strlength
TERMID_T uid
COUNT_T df
MemCachecache
bool hascache
bool READ_ONLY

Constructor & Destructor Documentation

InvDocList::InvDocList  
 

InvDocList::InvDocList TERMID_T    id,
int    len
 

constructor for this list using malloc for its own memory usage of InvDocList without MemCache has not been tested

InvDocList::InvDocList MemCache   mc,
TERMID_T    id,
int    len
 

constructors for this list getting memory from a MemCache

InvDocList::InvDocList MemCache   mc,
TERMID_T    id,
int    len,
DOCID_T    docid,
LOC_T    location
 

InvDocList::InvDocList TERMID_T    id,
int    listlen,
LOC_T   list,
int    fr,
DOCID_T   ldocid,
int    len
 

constructor for a list not needing to get any memory

InvDocList::~InvDocList  
 


Member Function Documentation

bool InvDocList::addTerm DOCID_T    docid [virtual]
 

increase count for this docid, we don't care about location

Reimplemented in InvFPDocList.

bool InvDocList::allocMem  
 

bool InvDocList::append InvDocList *    tail [virtual]
 

append the given list to the end of this list. watch for overlap of lastdocid of this list and first docid of given list.

Reimplemented in InvFPDocList.

virtual POS_T InvDocList::beginPosition   const [inline, protected, virtual]
 

position at beginning of list

Implements DocInfoList.

bool InvDocList::binRead ifstream &    inf
 

read an object from the given stream into memory. the stream should be pointing to the correct place, starting exactly where binWrite began writing. this method should be used with the empty constructor, else watch out for mem leaks. returns whether the read was successful

bool InvDocList::binReadC ifstream &    inf
 

read an object from the given stream into memory. the stream should be pointing to the correct place, starting exactly where binWrite began writing. this method should be used with the empty constructor, else watch out for mem leaks. returns whether the read was successful. RVL decompression is done.

void InvDocList::binWrite ofstream &    of
 

write this object in binary to the given filestream. the stream should support binary writing.

void InvDocList::binWriteC ofstream &    of
 

write this object in binary to the given filestream. the stream should support binary writing. RVL compression is used before writing

DOCID_T InvDocList::curDocID   const [inline]
 

int InvDocList::curDocIDdiff   const [inline]
 

int InvDocList::curDocIDtf   const [inline]
 

void InvDocList::deltaDecode   [protected, virtual]
 

delta decode docids from begin through end call after read

Reimplemented in InvFPDocList.

void InvDocList::deltaEncode   [protected, virtual]
 

delta encode docids from begin through end call before write

Reimplemented in InvFPDocList.

COUNT_T InvDocList::docFreq   const [inline]
 

virtual POS_T InvDocList::endPosition   const [inline, protected, virtual]
 

position at end of list

Implements DocInfoList.

DocInfo * InvDocList::getElement DocInfo   elem,
POS_T    position
const [protected, virtual]
 

set element from position, returns pointer to the element

Implements DocInfoList.

Reimplemented in InvFPDocList.

bool InvDocList::getMoreMem   [protected]
 

internal method for allocating more memory to list as needed double what we had before

bool InvDocList::hasMore   [virtual]
 

test if there's any entry

Implements DocInfoList.

bool InvDocList::hasNoMem  
 

int InvDocList::length   const [inline]
 

int InvDocList::logb2 int    num [protected]
 

int InvDocList::memorySize   const [inline]
 

void InvDocList::nextEntry DocInfo   info const [virtual]
 

DocInfo * InvDocList::nextEntry   [virtual]
 

fetch the next entry, return a pointer to a local static memory, so do not delete it

Implements DocInfoList.

Reimplemented in InvFPDocList.

POS_T InvDocList::nextPosition POS_T    position const [protected, virtual]
 

advance position

Implements DocInfoList.

Reimplemented in InvFPDocList.

void InvDocList::reset  
 

reset the list such that it points to nothing. doesn't free the memory be careful when using this to avoid memory leaks. if you are not managing memory, you should probably use resetFree()

See also:
resetFree

void InvDocList::resetFree  
 

reset the list and free the memory being used for it

See also:
reset

void InvDocList::setList TERMID_T    id,
int    listlen,
LOC_T   list,
int    fr,
DOCID_T   ldocid = NULL,
int    len = 0
 

this is meant for use with the empty constructor this allows the DocList values to be set. however it doesn't guarantee that the outsider will be able to set everything properly. thus, when this method is used, the object becomes READ_ONLY such that methods which attempt to append the contents of the list will not be able to

See also:
setListSafe

void InvDocList::setListSafe TERMID_T    id,
int    listlen,
LOC_T   list,
int    fr,
DOCID_T   ldocid,
int    len
 

same as the setList above. however the READ_ONLY flag will not get set. this method should be used only if you really know what you're doing

void InvDocList::startIteration   [virtual]
 

prepare iteration

Implements DocInfoList.

COUNT_T InvDocList::termCTF   [virtual]
 

Reimplemented in InvFPDocList.

TERMID_T InvDocList::termID   const [inline]
 

int InvDocList::termLen   const [inline]
 


Member Data Documentation

LOC_T* InvDocList::begin [protected]
 

MemCache* InvDocList::cache [protected]
 

COUNT_T InvDocList::df [protected]
 

LOC_T* InvDocList::end [protected]
 

LOC_T* InvDocList::freq [protected]
 

bool InvDocList::hascache [protected]
 

LOC_T* InvDocList::iter [protected]
 

LOC_T* InvDocList::lastid [protected]
 

int InvDocList::LOC_Tsize [protected]
 

bool InvDocList::READ_ONLY [protected]
 

int InvDocList::size [protected]
 

int InvDocList::strlength [protected]
 

TERMID_T InvDocList::uid [protected]
 


The documentation for this class was generated from the following files:
Generated on Wed Nov 3 12:59:40 2004 for Lemur Toolkit by doxygen1.2.18