vdk 2.4.0
Public Member Functions | List of all members
VDKHeap< T > Class Template Reference

provide a templatized Heap More...

#include <vdkheap.h>

Inheritance diagram for VDKHeap< T >:
Inheritance graph
[legend]
Collaboration diagram for VDKHeap< T >:
Collaboration graph
[legend]

Public Member Functions

 VDKHeap ()
 
 VDKHeap (T *source, int size)
 
virtual ~VDKHeap ()
 
void Sort (void)
 
- Public Member Functions inherited from VDKContainer< T >
 VDKContainer (int count=0)
 
T & operator[] (int n)
 
int size ()
 
 VDKContainer (const VDKContainer< T > &c)
 
VDKContainer< T > & operator= (const VDKContainer< T > &c)
 
int operator== (const VDKContainer< T > &c)
 

Detailed Description

template<class T>
class VDKHeap< T >

provide a templatized Heap

Description
VDKHeap<T> class has a value semantic, all objects are copied from original values. All managed type T objects should provide:
  • a default constructor: T::T()
  • a copy initializer: T::T(T& t)
  • an assignement operator: T& T::operator=(T& t)
  • an equality and less-than operators:
  • bool T::operator==(T& t)
  • bool T::operator<(T& t)
Implementation notes
I suggest to use typedef's like:
typedef VDKHeap<someClass> SomeClassHeap;
provide a templatized Heap
Definition: vdkheap.h:57

Constructor & Destructor Documentation

◆ VDKHeap() [1/2]

template<class T >
VDKHeap< T >::VDKHeap ( )
inline

Constructor makes an empty heap

◆ VDKHeap() [2/2]

template<class T >
VDKHeap< T >::VDKHeap ( T *  source,
int  size 
)

Constructor

Parameters
sourcean array of type T obejcts
arraysize

◆ ~VDKHeap()

template<class T >
virtual VDKHeap< T >::~VDKHeap ( )
inlinevirtual

Destructor

Member Function Documentation

◆ Sort()

template<class T >
void VDKHeap< T >::Sort ( void  )

Sorts on nlog(n) time


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