\hypertarget{classHeap}{\section{\-Heap$<$ \-\_\-\-Tp, \-\_\-\-Val $>$ \-Class \-Template \-Reference}
\label{classHeap}\index{\-Heap$<$ \-\_\-\-Tp, \-\_\-\-Val $>$@{\-Heap$<$ \-\_\-\-Tp, \-\_\-\-Val $>$}}
}


{\ttfamily \#include $<$\-Heap.\-h$>$}

\subsection*{\-Public \-Member \-Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classHeap_a7d0290aff75552ca49e9ba7f60ebbf92}{\-Heap} (bool is\-Min\-Heap=false)
\item 
\hyperlink{classHeap_a090efa49ed653e3df9b77bb912478549}{$\sim$\-Heap} ()
\item 
void \hyperlink{classHeap_a884cbfb1913798e14fe1ed4094fafd10}{push} (std\-::pair$<$ \-\_\-\-Tp, \-\_\-\-Val $>$ x)
\item 
void \hyperlink{classHeap_a6455a7e2e25de2445f152e1afd9e7ac2}{pop} ()
\item 
const std\-::pair$<$ \-\_\-\-Tp, \-\_\-\-Val $>$ \& \hyperlink{classHeap_a9becc7f03645225c3fa4357a7c9b00b4}{top} () const 
\item 
bool \hyperlink{classHeap_a5b6d651e63b4c7fe7fa65914a1746ac0}{set} (\-\_\-\-Tp \&x, \-\_\-\-Val \&v)
\item 
const \-\_\-\-Val \& \hyperlink{classHeap_a898772829d23d5038987e701d239add6}{get} (\-\_\-\-Tp \&x) const 
\item 
bool \hyperlink{classHeap_aa7a3b432f93a6c0949fac006fadd4fdd}{contains} (\-\_\-\-Tp \&x) const 
\item 
bool \hyperlink{classHeap_a7057e58a15431d641eace02e50c01f8e}{empty} () const 
\item 
int \hyperlink{classHeap_a7342e664d74ab21c694fa2fae0ad8700}{size} () const 
\item 
void \hyperlink{classHeap_a95287fd3b5c0076d169504b898b3c152}{clear} ()
\item 
bool \hyperlink{classHeap_a78d67426e06a38ced1b7fe67a0b72dbe}{erase} (\-\_\-\-Tp \&x)
\end{DoxyCompactItemize}


\subsection{\-Detailed \-Description}
\subsubsection*{template$<$class \-\_\-\-Tp, class \-\_\-\-Val$>$class Heap$<$ \-\_\-\-Tp, \-\_\-\-Val $>$}

\-An associated heap class with the ability to read and change the values of arbitrary objects in the heap. \-Note\-: \-Objects in the heap must be unique, however any number of objects can have the same value 

\subsection{\-Constructor \& \-Destructor \-Documentation}
\hypertarget{classHeap_a7d0290aff75552ca49e9ba7f60ebbf92}{\index{\-Heap@{\-Heap}!\-Heap@{\-Heap}}
\index{\-Heap@{\-Heap}!Heap@{\-Heap}}
\subsubsection[{\-Heap}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class \-\_\-\-Tp, class \-\_\-\-Val$>$ {\bf \-Heap}$<$ \-\_\-\-Tp, \-\_\-\-Val $>$\-::{\bf \-Heap} (
\begin{DoxyParamCaption}
\item[{bool}]{is\-Min\-Heap = {\ttfamily false}}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}\label{classHeap_a7d0290aff75552ca49e9ba7f60ebbf92}
\hypertarget{classHeap_a090efa49ed653e3df9b77bb912478549}{\index{\-Heap@{\-Heap}!$\sim$\-Heap@{$\sim$\-Heap}}
\index{$\sim$\-Heap@{$\sim$\-Heap}!Heap@{\-Heap}}
\subsubsection[{$\sim$\-Heap}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class \-\_\-\-Tp, class \-\_\-\-Val$>$ {\bf \-Heap}$<$ \-\_\-\-Tp, \-\_\-\-Val $>$\-::$\sim${\bf \-Heap} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}\label{classHeap_a090efa49ed653e3df9b77bb912478549}


\subsection{\-Member \-Function \-Documentation}
\hypertarget{classHeap_a95287fd3b5c0076d169504b898b3c152}{\index{\-Heap@{\-Heap}!clear@{clear}}
\index{clear@{clear}!Heap@{\-Heap}}
\subsubsection[{clear}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class \-\_\-\-Tp , class \-\_\-\-Val $>$ void {\bf \-Heap}$<$ \-\_\-\-Tp, \-\_\-\-Val $>$\-::{\bf clear} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classHeap_a95287fd3b5c0076d169504b898b3c152}
\-Removes all of the elements in the heap \hypertarget{classHeap_aa7a3b432f93a6c0949fac006fadd4fdd}{\index{\-Heap@{\-Heap}!contains@{contains}}
\index{contains@{contains}!Heap@{\-Heap}}
\subsubsection[{contains}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class \-\_\-\-Tp, class \-\_\-\-Val $>$ bool {\bf \-Heap}$<$ \-\_\-\-Tp, \-\_\-\-Val $>$\-::{\bf contains} (
\begin{DoxyParamCaption}
\item[{\-\_\-\-Tp \&}]{x}
\end{DoxyParamCaption}
) const}}\label{classHeap_aa7a3b432f93a6c0949fac006fadd4fdd}
\-Returns true if the heap contains the given element, false otherwise \hypertarget{classHeap_a7057e58a15431d641eace02e50c01f8e}{\index{\-Heap@{\-Heap}!empty@{empty}}
\index{empty@{empty}!Heap@{\-Heap}}
\subsubsection[{empty}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class \-\_\-\-Tp , class \-\_\-\-Val $>$ bool {\bf \-Heap}$<$ \-\_\-\-Tp, \-\_\-\-Val $>$\-::{\bf empty} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{classHeap_a7057e58a15431d641eace02e50c01f8e}
\-Returns true if the heap has no elements, false otherwise 

\-Here is the caller graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classHeap_a7057e58a15431d641eace02e50c01f8e_icgraph}
\end{center}
\end{figure}


\hypertarget{classHeap_a78d67426e06a38ced1b7fe67a0b72dbe}{\index{\-Heap@{\-Heap}!erase@{erase}}
\index{erase@{erase}!Heap@{\-Heap}}
\subsubsection[{erase}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class \-\_\-\-Tp, class \-\_\-\-Val $>$ bool {\bf \-Heap}$<$ \-\_\-\-Tp, \-\_\-\-Val $>$\-::{\bf erase} (
\begin{DoxyParamCaption}
\item[{\-\_\-\-Tp \&}]{x}
\end{DoxyParamCaption}
)}}\label{classHeap_a78d67426e06a38ced1b7fe67a0b72dbe}
\-Deletes the given object from the heap 
\begin{DoxyParams}{\-Parameters}
{\em an} & object that already exists in the heap \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{\-Returns}
boolean based on the success of the deletion 
\end{DoxyReturn}
\hypertarget{classHeap_a898772829d23d5038987e701d239add6}{\index{\-Heap@{\-Heap}!get@{get}}
\index{get@{get}!Heap@{\-Heap}}
\subsubsection[{get}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class \-\_\-\-Tp, class \-\_\-\-Val $>$ const \-\_\-\-Val \& {\bf \-Heap}$<$ \-\_\-\-Tp, \-\_\-\-Val $>$\-::{\bf get} (
\begin{DoxyParamCaption}
\item[{\-\_\-\-Tp \&}]{x}
\end{DoxyParamCaption}
) const}}\label{classHeap_a898772829d23d5038987e701d239add6}
\-Looks up the given object and returns its value 
\begin{DoxyParams}{\-Parameters}
{\em object} & to look up \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{\-Returns}
the value of the object 
\end{DoxyReturn}
\hypertarget{classHeap_a6455a7e2e25de2445f152e1afd9e7ac2}{\index{\-Heap@{\-Heap}!pop@{pop}}
\index{pop@{pop}!Heap@{\-Heap}}
\subsubsection[{pop}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class \-\_\-\-Tp , class \-\_\-\-Val $>$ void {\bf \-Heap}$<$ \-\_\-\-Tp, \-\_\-\-Val $>$\-::{\bf pop} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classHeap_a6455a7e2e25de2445f152e1afd9e7ac2}
\-Pops the top of the heap 

\-Here is the caller graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classHeap_a6455a7e2e25de2445f152e1afd9e7ac2_icgraph}
\end{center}
\end{figure}


\hypertarget{classHeap_a884cbfb1913798e14fe1ed4094fafd10}{\index{\-Heap@{\-Heap}!push@{push}}
\index{push@{push}!Heap@{\-Heap}}
\subsubsection[{push}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class \-\_\-\-Tp, class \-\_\-\-Val$>$ void {\bf \-Heap}$<$ \-\_\-\-Tp, \-\_\-\-Val $>$\-::{\bf push} (
\begin{DoxyParamCaption}
\item[{std\-::pair$<$ \-\_\-\-Tp, \-\_\-\-Val $>$}]{x}
\end{DoxyParamCaption}
)}}\label{classHeap_a884cbfb1913798e14fe1ed4094fafd10}
\-Pushes an object associated with the given value onto the heap 
\begin{DoxyParams}{\-Parameters}
{\em \-The} & object-\/value pair to push onto the heap \\
\hline
\end{DoxyParams}
\hypertarget{classHeap_a5b6d651e63b4c7fe7fa65914a1746ac0}{\index{\-Heap@{\-Heap}!set@{set}}
\index{set@{set}!Heap@{\-Heap}}
\subsubsection[{set}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class \-\_\-\-Tp, class \-\_\-\-Val$>$ bool {\bf \-Heap}$<$ \-\_\-\-Tp, \-\_\-\-Val $>$\-::{\bf set} (
\begin{DoxyParamCaption}
\item[{\-\_\-\-Tp \&}]{x, }
\item[{\-\_\-\-Val \&}]{v}
\end{DoxyParamCaption}
)}}\label{classHeap_a5b6d651e63b4c7fe7fa65914a1746ac0}
\-Updates the given object with the given value and moves the object to the appropiate place in the heap 
\begin{DoxyParams}{\-Parameters}
{\em an} & object that exists in the heap \\
\hline
{\em the} & new value for that object \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{\-Returns}
boolean based on the success of the update 
\end{DoxyReturn}
\hypertarget{classHeap_a7342e664d74ab21c694fa2fae0ad8700}{\index{\-Heap@{\-Heap}!size@{size}}
\index{size@{size}!Heap@{\-Heap}}
\subsubsection[{size}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class \-\_\-\-Tp , class \-\_\-\-Val $>$ int {\bf \-Heap}$<$ \-\_\-\-Tp, \-\_\-\-Val $>$\-::{\bf size} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{classHeap_a7342e664d74ab21c694fa2fae0ad8700}
\-Returns the number of elements in the heap \hypertarget{classHeap_a9becc7f03645225c3fa4357a7c9b00b4}{\index{\-Heap@{\-Heap}!top@{top}}
\index{top@{top}!Heap@{\-Heap}}
\subsubsection[{top}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class \-\_\-\-Tp , class \-\_\-\-Val $>$ const std\-::pair$<$ \-\_\-\-Tp, \-\_\-\-Val $>$ \& {\bf \-Heap}$<$ \-\_\-\-Tp, \-\_\-\-Val $>$\-::{\bf top} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{classHeap_a9becc7f03645225c3fa4357a7c9b00b4}
\-Returns a reference to the object-\/value pair at the top of the heap 

\-Here is the caller graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classHeap_a9becc7f03645225c3fa4357a7c9b00b4_icgraph}
\end{center}
\end{figure}




\-The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
\-Snippy\-Hollo\-W-\/\-Broodwar\-Bot\-Q-\/f01ab56/src/\-Macro/\hyperlink{Heap_8h}{\-Heap.\-h}\end{DoxyCompactItemize}
