Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Public Member Functions | Protected Attributes
alib::CppHeap< T, Comparator > Class Template Reference

heap build using C++ algorithm features More...

#include <CppHeap.h>

Public Member Functions

 CppHeap (Comparator comparator=Comparator())
 
void insert (const T &value)
 
const T & getMax () const
 finds the maximum value in the heap More...
 
extractMax ()
 finds and removes the maximum value from the heap More...
 
void mergeWith (CppHeap< T, Comparator > &&that)
 merges this heap with another heap (!! this is a DESTRUCTIVE merge, heap in argument will be cleared !!) More...
 
size_t size () const
 

Protected Attributes

Comparator m_comparator
 
std::vector< T > m_data
 

Detailed Description

template<typename T, typename Comparator = std::less < T >>
class alib::CppHeap< T, Comparator >

heap build using C++ algorithm features

Constructor & Destructor Documentation

◆ CppHeap()

template<typename T , typename Comparator = std::less < T >>
alib::CppHeap< T, Comparator >::CppHeap ( Comparator  comparator = Comparator ( ))
inline

Member Function Documentation

◆ extractMax()

template<typename T , typename Comparator >
T alib::CppHeap< T, Comparator >::extractMax

finds and removes the maximum value from the heap

◆ getMax()

template<typename T , typename Comparator = std::less < T >>
const T & alib::CppHeap< T, Comparator >::getMax ( ) const
inline

finds the maximum value in the heap

◆ insert()

template<typename T , typename Comparator >
void alib::CppHeap< T, Comparator >::insert ( const T &  value)
Here is the caller graph for this function:

◆ mergeWith()

template<typename T , typename Comparator >
void alib::CppHeap< T, Comparator >::mergeWith ( CppHeap< T, Comparator > &&  that)

merges this heap with another heap (!! this is a DESTRUCTIVE merge, heap in argument will be cleared !!)

Here is the call graph for this function:

◆ size()

template<typename T , typename Comparator = std::less < T >>
size_t alib::CppHeap< T, Comparator >::size ( ) const
inline

Field Documentation

◆ m_comparator

template<typename T , typename Comparator = std::less < T >>
Comparator alib::CppHeap< T, Comparator >::m_comparator
protected

◆ m_data

template<typename T , typename Comparator = std::less < T >>
std::vector< T > alib::CppHeap< T, Comparator >::m_data
protected

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