Rosetta
Public Member Functions | Private Member Functions | Private Attributes | List of all members
HeapContainer< T, Comparator > Class Template Reference

Public Member Functions

 HeapContainer ()
 default constructor for HeapContainer. Sets max_values to 100. More...
 
 HeapContainer (Size const max)
 constructor. More...
 
Size max_values () const
 Returns the maximum number of values that this HeapContainer will hold. More...
 
void max_values (Size new_max)
 Sets the maximum number of values that this HeapContainer will hold. More...
 
void add_value (T val)
 Add a value to his HeapContainer. If it's greater than any of the values already inside, it will be added to the HeapContainer. Only max_values() values are stored. More...
 
Size size () const
 Returns the number of values currently in this object. More...
 
T operator[] (Size idx)
 Access the value at index idx. More...
 

Private Member Functions

T worst ()
 
void sort_myself ()
 

Private Attributes

core::Size max_values_
 
bool is_sorted_
 
utility::vector1< Tvalues_
 

Constructor & Destructor Documentation

◆ HeapContainer() [1/2]

template<typename T , class Comparator >
HeapContainer< T, Comparator >::HeapContainer ( )
inline

default constructor for HeapContainer. Sets max_values to 100.

◆ HeapContainer() [2/2]

template<typename T , class Comparator >
HeapContainer< T, Comparator >::HeapContainer ( Size const  max)
inline

constructor.

Member Function Documentation

◆ add_value()

template<typename T , class Comparator >
void HeapContainer< T, Comparator >::add_value ( T  val)
inline

◆ max_values() [1/2]

template<typename T , class Comparator >
Size HeapContainer< T, Comparator >::max_values ( ) const
inline

Returns the maximum number of values that this HeapContainer will hold.

References HeapContainer< T, Comparator >::max_values_.

Referenced by HeapContainer< T, Comparator >::add_value().

◆ max_values() [2/2]

template<typename T , class Comparator >
void HeapContainer< T, Comparator >::max_values ( Size  new_max)
inline

Sets the maximum number of values that this HeapContainer will hold.

References HeapContainer< T, Comparator >::max_values_.

◆ operator[]()

template<typename T , class Comparator >
T HeapContainer< T, Comparator >::operator[] ( Size  idx)
inline

◆ size()

template<typename T , class Comparator >
Size HeapContainer< T, Comparator >::size ( ) const
inline

Returns the number of values currently in this object.

References HeapContainer< T, Comparator >::values_.

◆ sort_myself()

template<typename T , class Comparator >
void HeapContainer< T, Comparator >::sort_myself ( )
inlineprivate

◆ worst()

template<typename T , class Comparator >
T HeapContainer< T, Comparator >::worst ( )
inlineprivate

Member Data Documentation

◆ is_sorted_

template<typename T , class Comparator >
bool HeapContainer< T, Comparator >::is_sorted_
private

◆ max_values_

template<typename T , class Comparator >
core::Size HeapContainer< T, Comparator >::max_values_
private

◆ values_

template<typename T , class Comparator >
utility::vector1< T > HeapContainer< T, Comparator >::values_
private

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