- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# /Users/fpy/titan-1-5-MBARI/Mers/Utils/Containers/DynamicHeap.h

    00001
    00002 //
    00003 // Copyright (c) 2004           Model-based Embedded and Robotic Systems Group
    00004 // All Rights Reserved          Massachusetts Institute of Technology
    00005 //
    00006 // This software is provided as is. Model-based Embedded and Robotic Systems
    00007 // (MERS) group does not assume any responsibility.
    00008 //
    00009 // Organization:        Model-based Embedded and Robotic Systems Group
    00010 //                                      Massachusetts Institute of Technology
    00011 //
    00013
    00014 #if !defined(AFX_DYNAMICHEAP_H__E571DD4C_9470_4E6A_ABFD_9EF57BE1CEA8__INCLUDED_)
    00015 #define AFX_DYNAMICHEAP_H__E571DD4C_9470_4E6A_ABFD_9EF57BE1CEA8__INCLUDED_
    00016
    00017 #if _MSC_VER > 1000
    00018 #pragma once
    00019 #endif // _MSC_VER > 1000
    00020
    00021 #include "DynamicArray.h"
    00022
    00023 namespace Mers {
    00024         namespace Utils {
    00025                 namespace Containers {
    00026
    00034                         class DynamicHeap : public DynamicArray
    00035                         {
    00036                         public:
    00037                                 //-----------------------------------------
    00038                                 // Constructors
    00039                                 //-----------------------------------------
    00040
    00054                                 DynamicHeap(bool myLargestFirstHeap, DynamicArray::DynamicArrayType myHeapType,
    00055                                                                                 bool myOwnershipStatus);
    00056
    00057                                 //-----------------------------------------
    00058                                 // Destructors
    00059                                 //-----------------------------------------
    00060
    00064                                 virtual ~DynamicHeap();
    00065
    00066                         protected:
    00067                                 //-----------------------------------------
    00068                                 // Copy constructors
    00069                                 //-----------------------------------------
    00070
    00077                                 DynamicHeap(DynamicHeap const &other);
    00084                                 DynamicHeap(DynamicHeap const * other);
    00085
    00086                                 //-----------------------------------------
    00087                                 // Functions
    00088                                 //-----------------------------------------
    00089
    00097                                 void heapify(unsigned int elementIndex);
    00098
    00108                                 int insert(void * element);
    00118                                 int peekFirst(void * &element);
    00129                                 int getFirst(void * &element);
    00130
    00142                                 virtual bool greaterThan(void const * e1, void const * e2) const = 0;
    00154                                 virtual bool lessThan(void const * e1, void const * e2) const = 0;
    00155
    00156                         protected:
    00159                                 bool largestFirst;
    00160                         };
    00161                 }
    00162         }
    00163 }
    00164
    00165 #endif // !defined(AFX_DYNAMICHEAP_H__E571DD4C_9470_4E6A_ABFD_9EF57BE1CEA8__INCLUDED_)