FirteX-高性能全文索引和检索平台

API Documentation


首页 | 名字空间列表 | 类继承关系 | 组合类型列表 | $(BL\录(B | 文件列表 | 名字空间成员 | 组合类型成员 | 文件成员

firtex::utility::CPriorityQueue< _type >模板类参考

#include <PriorityQueue.h>

所有成员的列表。

公有成员

virtual ~CPriorityQueue ()
void put (_type element)
bool insert (_type element)
_type top ()
_type pop ()
void adjustTop ()
size_t size ()
void clear ()

保护成员

 CPriorityQueue ()
virtual bool lessThan (_type a, _type b)=0
void initialize (const size_t maxSize, bool deleteOnClear)


详细描述

template<class _type>
class firtex::utility::CPriorityQueue< _type >

A CPriorityQueue maintains a partial ordering of its elements such that the least element can always be found in constant time. Put()'s and pop()'s require log(size) time.


构造及析构函数文档

template<class _type>
firtex::utility::CPriorityQueue< _type >::CPriorityQueue  )  [inline, protected]
 

template<class _type>
virtual firtex::utility::CPriorityQueue< _type >::~CPriorityQueue  )  [inline, virtual]
 


成员函数文档

template<class _type>
void firtex::utility::CPriorityQueue< _type >::adjustTop  )  [inline]
 

Should be called when the object at top changes values. Still log(n) worst case, but it's at least twice as fast to

 { pq.top().change(); pq.adjustTop(); }
 
instead of
 { o = pq.pop(); o.change(); pq.push(o); }
 

template<class _type>
void firtex::utility::CPriorityQueue< _type >::clear  )  [inline]
 

Removes all entries from the CPriorityQueue.

template<class _type>
void firtex::utility::CPriorityQueue< _type >::initialize const size_t  maxSize,
bool  deleteOnClear
[inline, protected]
 

Subclass constructors must call this.

template<class _type>
bool firtex::utility::CPriorityQueue< _type >::insert _type  element  )  [inline]
 

Adds element to the CPriorityQueue in log(size) time if either the CPriorityQueue is not full, or not lessThan(element, top()).

参数:
element 
返回:
true if element is added, false otherwise.

template<class _type>
virtual bool firtex::utility::CPriorityQueue< _type >::lessThan _type  a,
_type  b
[protected, pure virtual]
 

Determines the ordering of objects in this priority queue. Subclassesmust define this one method.

firtex::search::CHitQueuefirtex::search::CFieldDocSortedHitQueue内被实现。

template<class _type>
_type firtex::utility::CPriorityQueue< _type >::pop  )  [inline]
 

Removes and returns the least element of the CPriorityQueue in log(size) time.

template<class _type>
void firtex::utility::CPriorityQueue< _type >::put _type  element  )  [inline]
 

Adds an Object to a CPriorityQueue in log(size) time. If one tries to add more objects than m_maxSize from initialize a RuntimeException (ArrayIndexOutOfBound) is thrown.

template<class _type>
size_t firtex::utility::CPriorityQueue< _type >::size  )  [inline]
 

Returns the number of elements currently stored in the CPriorityQueue.

template<class _type>
_type firtex::utility::CPriorityQueue< _type >::top  )  [inline]
 

Returns the least element of the CPriorityQueue in constant time.


该类的文档由以下文件生成:

http://www.firtex.org http://www.sourceforge.net/projects/firtex