Public Member Functions | Public Attributes | List of all members
ibis::util::heap< T, C > Struct Template Reference

A simple heap based on std::push_heap and std::pop_heap. More...

#include <utilidor.h>

Public Member Functions

bool empty () const
 Is the heap empty. Returns true if yes.
 
 heap ()
 The default constructor. More...
 
void pop ()
 Remove the top element from the heap.
 
void push (T *v)
 Add a new element to the heap.
 
void reserve (size_t n)
 Reserve space.
 
size_t size () const
 The number of elements in the heap.
 
T * top () const
 The top element. No error checking!
 

Public Attributes

const C comp_
 An object of the comparator type.
 
std::vector< T * > data_
 A vector to hold pointers to the underlying data.
 

Detailed Description

template<typename T, class C>
struct ibis::util::heap< T, C >

A simple heap based on std::push_heap and std::pop_heap.

Constructor & Destructor Documentation

template<typename T, class C>
ibis::util::heap< T, C >::heap ( )
inline

The default constructor.

It creates an empty vector with the specified type and a comparator object.


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

Make It A Bit Faster
Contact us
Disclaimers
FastBit source code
FastBit mailing list archive