Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

lemur::index::InvDocList Class Reference

#include <InvDocList.hpp>

Inheritance diagram for lemur::index::InvDocList:

lemur::api::DocInfoList lemur::index::InvFPDocList List of all members.

Public Member Functions

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

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

 ~InvDocList ()
void setList (lemur::api::TERMID_T id, int listlen, lemur::api::LOC_T *list, int fr, lemur::api::DOCID_T *ldocid=NULL, int len=0)
void setListSafe (lemur::api::TERMID_T id, int listlen, lemur::api::LOC_T *list, int fr, lemur::api::DOCID_T *ldocid, int len)
void reset ()
void resetFree ()
bool allocMem ()
bool hasNoMem ()
virtual bool addTerm (lemur::api::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 lemur::api::DocInfonextEntry () const
 fetch the next entry, return a pointer to a local static memory, so do not delete it

virtual void nextEntry (lemur::api::DocInfo *info) const
lemur::api::DOCID_T curDocID () const
lemur::api::COUNT_T docFreq () const
int length () const
lemur::api::TERMID_T termID () const
int termLen () const
virtual lemur::api::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 Member Functions

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

virtual lemur::api::POS_T beginPosition () const
 position at beginning of list

virtual lemur::api::POS_T endPosition () const
 position at end of list

virtual lemur::api::POS_T nextPosition (lemur::api::POS_T position) const
 advance position

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

Protected Attributes

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

Private Attributes

lemur::api::DocInfo entry

Constructor & Destructor Documentation

lemur::index::InvDocList::InvDocList  ) 
 

lemur::index::InvDocList::InvDocList lemur::api::TERMID_T  id,
int  len
 

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

lemur::index::InvDocList::InvDocList lemur::utility::MemCache mc,
lemur::api::TERMID_T  id,
int  len
 

constructors for this list getting memory from a MemCache

lemur::index::InvDocList::InvDocList lemur::utility::MemCache mc,
lemur::api::TERMID_T  id,
int  len,
lemur::api::DOCID_T  docid,
lemur::api::LOC_T  location
 

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

constructor for a list not needing to get any memory

lemur::index::InvDocList::~InvDocList  ) 
 


Member Function Documentation

bool lemur::index::InvDocList::addTerm lemur::api::DOCID_T  docid  )  [virtual]
 

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

Reimplemented in lemur::index::InvFPDocList.

bool lemur::index::InvDocList::allocMem  ) 
 

bool lemur::index::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 lemur::index::InvFPDocList.

virtual lemur::api::POS_T lemur::index::InvDocList::beginPosition  )  const [inline, protected, virtual]
 

position at beginning of list

Implements lemur::api::DocInfoList.

bool lemur::index::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 lemur::index::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 lemur::index::InvDocList::binWrite ofstream &  of  ) 
 

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

void lemur::index::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

lemur::api::DOCID_T lemur::index::InvDocList::curDocID  )  const [inline]
 

int lemur::index::InvDocList::curDocIDdiff  )  const [inline]
 

int lemur::index::InvDocList::curDocIDtf  )  const [inline]
 

void lemur::index::InvDocList::deltaDecode  )  [protected, virtual]
 

delta decode docids from begin through end call after read

Reimplemented in lemur::index::InvFPDocList.

void lemur::index::InvDocList::deltaEncode  )  [protected, virtual]
 

delta encode docids from begin through end call before write

Reimplemented in lemur::index::InvFPDocList.

lemur::api::COUNT_T lemur::index::InvDocList::docFreq  )  const [inline]
 

virtual lemur::api::POS_T lemur::index::InvDocList::endPosition  )  const [inline, protected, virtual]
 

position at end of list

Implements lemur::api::DocInfoList.

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

set element from position, returns pointer to the element

Implements lemur::api::DocInfoList.

Reimplemented in lemur::index::InvFPDocList.

bool lemur::index::InvDocList::getMoreMem  )  [protected]
 

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

bool lemur::index::InvDocList::hasMore  )  const [virtual]
 

test if there's any entry

Implements lemur::api::DocInfoList.

bool lemur::index::InvDocList::hasNoMem  ) 
 

int lemur::index::InvDocList::length  )  const [inline]
 

int lemur::index::InvDocList::logb2 int  num  )  [protected]
 

int lemur::index::InvDocList::memorySize  )  const [inline]
 

void lemur::index::InvDocList::nextEntry lemur::api::DocInfo info  )  const [virtual]
 

Reimplemented in lemur::index::InvFPDocList.

lemur::api::DocInfo * lemur::index::InvDocList::nextEntry  )  const [virtual]
 

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

Implements lemur::api::DocInfoList.

Reimplemented in lemur::index::InvFPDocList.

lemur::api::POS_T lemur::index::InvDocList::nextPosition lemur::api::POS_T  position  )  const [protected, virtual]
 

advance position

Implements lemur::api::DocInfoList.

Reimplemented in lemur::index::InvFPDocList.

void lemur::index::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 lemur::index::InvDocList::resetFree  ) 
 

reset the list and free the memory being used for it

See also:
reset

void lemur::index::InvDocList::setList lemur::api::TERMID_T  id,
int  listlen,
lemur::api::LOC_T list,
int  fr,
lemur::api::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 lemur::index::InvDocList::setListSafe lemur::api::TERMID_T  id,
int  listlen,
lemur::api::LOC_T list,
int  fr,
lemur::api::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 lemur::index::InvDocList::startIteration  )  const [virtual]
 

prepare iteration

Implements lemur::api::DocInfoList.

lemur::api::COUNT_T lemur::index::InvDocList::termCTF  )  const [virtual]
 

Reimplemented in lemur::index::InvFPDocList.

lemur::api::TERMID_T lemur::index::InvDocList::termID  )  const [inline]
 

int lemur::index::InvDocList::termLen  )  const [inline]
 


Member Data Documentation

lemur::api::LOC_T* lemur::index::InvDocList::begin [protected]
 

lemur::utility::MemCache* lemur::index::InvDocList::cache [protected]
 

lemur::api::COUNT_T lemur::index::InvDocList::df [protected]
 

lemur::api::LOC_T* lemur::index::InvDocList::end [protected]
 

lemur::api::DocInfo lemur::index::InvDocList::entry [mutable, private]
 

Reimplemented in lemur::index::InvFPDocList.

lemur::api::LOC_T* lemur::index::InvDocList::freq [protected]
 

bool lemur::index::InvDocList::hascache [protected]
 

lemur::api::LOC_T* lemur::index::InvDocList::iter [mutable, protected]
 

lemur::api::LOC_T* lemur::index::InvDocList::lastid [protected]
 

int lemur::index::InvDocList::LOC_Tsize [protected]
 

bool lemur::index::InvDocList::READ_ONLY [protected]
 

int lemur::index::InvDocList::size [protected]
 

int lemur::index::InvDocList::strlength [protected]
 

lemur::api::TERMID_T lemur::index::InvDocList::uid [protected]
 


The documentation for this class was generated from the following files:
Generated on Tue Jun 15 11:03:05 2010 for Lemur by doxygen 1.3.4