\hypertarget{ompi__rb__tree_8h}{\section{ompi/class/ompi\+\_\+rb\+\_\+tree.h File Reference}
\label{ompi__rb__tree_8h}\index{ompi/class/ompi\+\_\+rb\+\_\+tree.\+h@{ompi/class/ompi\+\_\+rb\+\_\+tree.\+h}}
}


A red black tree.  


{\ttfamily \#include \char`\"{}ompi\+\_\+config.\+h\char`\"{}}\\*
{\ttfamily \#include $<$stdlib.\+h$>$}\\*
{\ttfamily \#include \char`\"{}ompi/constants.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}opal/class/opal\+\_\+object.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}ompi/class/ompi\+\_\+free\+\_\+list.\+h\char`\"{}}\\*
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structompi__rb__tree__node__t}{ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t}
\begin{DoxyCompactList}\small\item\em node data structure \end{DoxyCompactList}\item 
struct \hyperlink{structompi__rb__tree__t}{ompi\+\_\+rb\+\_\+tree\+\_\+t}
\begin{DoxyCompactList}\small\item\em the data structure that holds all the needed information about the tree. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\hypertarget{ompi__rb__tree_8h_a59d60c427ec7ee9b234c5e19315a0527}{typedef struct \hyperlink{structompi__rb__tree__node__t}{ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t} {\bfseries ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t}}\label{ompi__rb__tree_8h_a59d60c427ec7ee9b234c5e19315a0527}

\item 
typedef int($\ast$ \hyperlink{ompi__rb__tree_8h_a756e2f26abb81fb70815412d6bdf5816}{ompi\+\_\+rb\+\_\+tree\+\_\+comp\+\_\+fn\+\_\+t} )(void $\ast$key1, void $\ast$key2)
\begin{DoxyCompactList}\small\item\em the compare function typedef. \end{DoxyCompactList}\item 
\hypertarget{ompi__rb__tree_8h_a4eb003a5d212457c1ff41822d4a02894}{typedef struct \hyperlink{structompi__rb__tree__t}{ompi\+\_\+rb\+\_\+tree\+\_\+t} {\bfseries ompi\+\_\+rb\+\_\+tree\+\_\+t}}\label{ompi__rb__tree_8h_a4eb003a5d212457c1ff41822d4a02894}

\item 
typedef int($\ast$ \hyperlink{ompi__rb__tree_8h_a6bdd8e897733bbc33b9f09f3357a0be2}{ompi\+\_\+rb\+\_\+tree\+\_\+condition\+\_\+fn\+\_\+t} )(void $\ast$)
\begin{DoxyCompactList}\small\item\em this function is used for the ompi\+\_\+rb\+\_\+tree\+\_\+traverse function. \end{DoxyCompactList}\item 
typedef void($\ast$ \hyperlink{ompi__rb__tree_8h_a707c2371a9492d3ada42ab68fbfd5cef}{ompi\+\_\+rb\+\_\+tree\+\_\+action\+\_\+fn\+\_\+t} )(void $\ast$, void $\ast$)
\begin{DoxyCompactList}\small\item\em this function is uused for the user to perform any action on the passed values. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
\hypertarget{ompi__rb__tree_8h_a78f02e4d8ce3e5b9d6b2a85f0fa14691}{enum \hyperlink{ompi__rb__tree_8h_a78f02e4d8ce3e5b9d6b2a85f0fa14691}{ompi\+\_\+rb\+\_\+tree\+\_\+nodecolor\+\_\+t} \{ {\bfseries R\+E\+D}, 
{\bfseries B\+L\+A\+C\+K}
 \}}\label{ompi__rb__tree_8h_a78f02e4d8ce3e5b9d6b2a85f0fa14691}

\begin{DoxyCompactList}\small\item\em red and black enum \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{ompi__rb__tree_8h_a6f4852ff922c21fb777e3fd087165578}{O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C \hyperlink{ompi__rb__tree_8h_a6f4852ff922c21fb777e3fd087165578}{O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+D\+E\+C\+L\+A\+R\+A\+T\+I\+O\+N} (\hyperlink{structompi__rb__tree__node__t}{ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t})}\label{ompi__rb__tree_8h_a6f4852ff922c21fb777e3fd087165578}

\begin{DoxyCompactList}\small\item\em declare the tree node as a class \end{DoxyCompactList}\item 
\hypertarget{ompi__rb__tree_8h_a50421c14f0141de8f375228f7e8f327f}{O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C \hyperlink{ompi__rb__tree_8h_a50421c14f0141de8f375228f7e8f327f}{O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+D\+E\+C\+L\+A\+R\+A\+T\+I\+O\+N} (\hyperlink{structompi__rb__tree__t}{ompi\+\_\+rb\+\_\+tree\+\_\+t})}\label{ompi__rb__tree_8h_a50421c14f0141de8f375228f7e8f327f}

\begin{DoxyCompactList}\small\item\em declare the tree as a class \end{DoxyCompactList}\item 
O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void \hyperlink{ompi__rb__tree_8h_a8a2cd6e577aef5527083b0fd57ede2ad}{ompi\+\_\+rb\+\_\+tree\+\_\+construct} (\hyperlink{structopal__object__t}{opal\+\_\+object\+\_\+t} $\ast$object)
\begin{DoxyCompactList}\small\item\em the construct function. \end{DoxyCompactList}\item 
O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void \hyperlink{ompi__rb__tree_8h_aedb23d8a06d883807a957cdfe06d1563}{ompi\+\_\+rb\+\_\+tree\+\_\+destruct} (\hyperlink{structopal__object__t}{opal\+\_\+object\+\_\+t} $\ast$object)
\begin{DoxyCompactList}\small\item\em the destruct function. \end{DoxyCompactList}\item 
O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{ompi__rb__tree_8h_ab84fbb00842fc7239be6f47e0b539f63}{ompi\+\_\+rb\+\_\+tree\+\_\+init} (\hyperlink{structompi__rb__tree__t}{ompi\+\_\+rb\+\_\+tree\+\_\+t} $\ast$tree, \hyperlink{ompi__rb__tree_8h_a756e2f26abb81fb70815412d6bdf5816}{ompi\+\_\+rb\+\_\+tree\+\_\+comp\+\_\+fn\+\_\+t} comp)
\begin{DoxyCompactList}\small\item\em the function creates a new tree \end{DoxyCompactList}\item 
O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{ompi__rb__tree_8h_aa6def424a95216ff62779aa7873067f6}{ompi\+\_\+rb\+\_\+tree\+\_\+insert} (\hyperlink{structompi__rb__tree__t}{ompi\+\_\+rb\+\_\+tree\+\_\+t} $\ast$tree, void $\ast$key, void $\ast$value)
\begin{DoxyCompactList}\small\item\em inserts a node into the tree \end{DoxyCompactList}\item 
O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void $\ast$ \hyperlink{ompi__rb__tree_8h_a4f60bcc13e5d1f89d826276d56dd05ad}{ompi\+\_\+rb\+\_\+tree\+\_\+find\+\_\+with} (\hyperlink{structompi__rb__tree__t}{ompi\+\_\+rb\+\_\+tree\+\_\+t} $\ast$tree, void $\ast$key, \hyperlink{ompi__rb__tree_8h_a756e2f26abb81fb70815412d6bdf5816}{ompi\+\_\+rb\+\_\+tree\+\_\+comp\+\_\+fn\+\_\+t} compfn)
\begin{DoxyCompactList}\small\item\em finds a value in the tree based on the passed key using passed compare function \end{DoxyCompactList}\item 
static void $\ast$ \hyperlink{ompi__rb__tree_8h_a2d481dcab308433b38a39dc87ca9c56c}{ompi\+\_\+rb\+\_\+tree\+\_\+find} (\hyperlink{structompi__rb__tree__t}{ompi\+\_\+rb\+\_\+tree\+\_\+t} $\ast$tree, void $\ast$key)
\begin{DoxyCompactList}\small\item\em finds a value in the tree based on the passed key \end{DoxyCompactList}\item 
O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{ompi__rb__tree_8h_afbbf510be456128acde81fb627150b13}{ompi\+\_\+rb\+\_\+tree\+\_\+delete} (\hyperlink{structompi__rb__tree__t}{ompi\+\_\+rb\+\_\+tree\+\_\+t} $\ast$tree, void $\ast$key)
\begin{DoxyCompactList}\small\item\em deletes a node based on its key \end{DoxyCompactList}\item 
O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{ompi__rb__tree_8h_a205583f53caeae10471b663902621011}{ompi\+\_\+rb\+\_\+tree\+\_\+destroy} (\hyperlink{structompi__rb__tree__t}{ompi\+\_\+rb\+\_\+tree\+\_\+t} $\ast$tree)
\begin{DoxyCompactList}\small\item\em frees all the nodes on the tree \end{DoxyCompactList}\item 
O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{ompi__rb__tree_8h_a62c7cb372d46a8c7ea152ee709994c19}{ompi\+\_\+rb\+\_\+tree\+\_\+traverse} (\hyperlink{structompi__rb__tree__t}{ompi\+\_\+rb\+\_\+tree\+\_\+t} $\ast$tree, \hyperlink{ompi__rb__tree_8h_a6bdd8e897733bbc33b9f09f3357a0be2}{ompi\+\_\+rb\+\_\+tree\+\_\+condition\+\_\+fn\+\_\+t} cond, \hyperlink{ompi__rb__tree_8h_a707c2371a9492d3ada42ab68fbfd5cef}{ompi\+\_\+rb\+\_\+tree\+\_\+action\+\_\+fn\+\_\+t} action)
\begin{DoxyCompactList}\small\item\em traverses the entire tree, performing the cond function on each of the values and if it returns one it performs the action function on the values \end{DoxyCompactList}\item 
O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{ompi__rb__tree_8h_a174adfd33e1bf947c451639a8c70919b}{ompi\+\_\+rb\+\_\+tree\+\_\+size} (\hyperlink{structompi__rb__tree__t}{ompi\+\_\+rb\+\_\+tree\+\_\+t} $\ast$tree)
\begin{DoxyCompactList}\small\item\em returns the size of the tree \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
A red black tree. 



\subsection{Typedef Documentation}
\hypertarget{ompi__rb__tree_8h_a707c2371a9492d3ada42ab68fbfd5cef}{\index{ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}!ompi\+\_\+rb\+\_\+tree\+\_\+action\+\_\+fn\+\_\+t@{ompi\+\_\+rb\+\_\+tree\+\_\+action\+\_\+fn\+\_\+t}}
\index{ompi\+\_\+rb\+\_\+tree\+\_\+action\+\_\+fn\+\_\+t@{ompi\+\_\+rb\+\_\+tree\+\_\+action\+\_\+fn\+\_\+t}!ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}}
\subsubsection[{ompi\+\_\+rb\+\_\+tree\+\_\+action\+\_\+fn\+\_\+t}]{\setlength{\rightskip}{0pt plus 5cm}typedef void($\ast$ ompi\+\_\+rb\+\_\+tree\+\_\+action\+\_\+fn\+\_\+t)(void $\ast$, void $\ast$)}}\label{ompi__rb__tree_8h_a707c2371a9492d3ada42ab68fbfd5cef}


this function is uused for the user to perform any action on the passed values. 

The first argument is the key and the second is the value. note that this function S\+H\+O\+U\+L\+D N\+O\+T modify the keys, as that would mess up the tree. \hypertarget{ompi__rb__tree_8h_a756e2f26abb81fb70815412d6bdf5816}{\index{ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}!ompi\+\_\+rb\+\_\+tree\+\_\+comp\+\_\+fn\+\_\+t@{ompi\+\_\+rb\+\_\+tree\+\_\+comp\+\_\+fn\+\_\+t}}
\index{ompi\+\_\+rb\+\_\+tree\+\_\+comp\+\_\+fn\+\_\+t@{ompi\+\_\+rb\+\_\+tree\+\_\+comp\+\_\+fn\+\_\+t}!ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}}
\subsubsection[{ompi\+\_\+rb\+\_\+tree\+\_\+comp\+\_\+fn\+\_\+t}]{\setlength{\rightskip}{0pt plus 5cm}typedef int($\ast$ ompi\+\_\+rb\+\_\+tree\+\_\+comp\+\_\+fn\+\_\+t)(void $\ast$key1, void $\ast$key2)}}\label{ompi__rb__tree_8h_a756e2f26abb81fb70815412d6bdf5816}


the compare function typedef. 

This function is used to compare 2 nodes. \hypertarget{ompi__rb__tree_8h_a6bdd8e897733bbc33b9f09f3357a0be2}{\index{ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}!ompi\+\_\+rb\+\_\+tree\+\_\+condition\+\_\+fn\+\_\+t@{ompi\+\_\+rb\+\_\+tree\+\_\+condition\+\_\+fn\+\_\+t}}
\index{ompi\+\_\+rb\+\_\+tree\+\_\+condition\+\_\+fn\+\_\+t@{ompi\+\_\+rb\+\_\+tree\+\_\+condition\+\_\+fn\+\_\+t}!ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}}
\subsubsection[{ompi\+\_\+rb\+\_\+tree\+\_\+condition\+\_\+fn\+\_\+t}]{\setlength{\rightskip}{0pt plus 5cm}typedef int($\ast$ ompi\+\_\+rb\+\_\+tree\+\_\+condition\+\_\+fn\+\_\+t)(void $\ast$)}}\label{ompi__rb__tree_8h_a6bdd8e897733bbc33b9f09f3357a0be2}


this function is used for the ompi\+\_\+rb\+\_\+tree\+\_\+traverse function. 

it is passed a pointer to the value for each node and, if it returns a one, the action function is called on that node. Otherwise, the node is ignored. 

\subsection{Function Documentation}
\hypertarget{ompi__rb__tree_8h_a8a2cd6e577aef5527083b0fd57ede2ad}{\index{ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}!ompi\+\_\+rb\+\_\+tree\+\_\+construct@{ompi\+\_\+rb\+\_\+tree\+\_\+construct}}
\index{ompi\+\_\+rb\+\_\+tree\+\_\+construct@{ompi\+\_\+rb\+\_\+tree\+\_\+construct}!ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}}
\subsubsection[{ompi\+\_\+rb\+\_\+tree\+\_\+construct}]{\setlength{\rightskip}{0pt plus 5cm}O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void ompi\+\_\+rb\+\_\+tree\+\_\+construct (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+object\+\_\+t} $\ast$}]{object}
\end{DoxyParamCaption}
)}}\label{ompi__rb__tree_8h_a8a2cd6e577aef5527083b0fd57ede2ad}


the construct function. 

creates the free list to get the nodes from


\begin{DoxyParams}{Parameters}
{\em object} & the tree that is to be used\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em N\+O\+N\+E} & \\
\hline
\end{DoxyRetVals}


References ompi\+\_\+rb\+\_\+tree\+\_\+t\+::free\+\_\+list, O\+B\+J\+\_\+\+C\+L\+A\+S\+S, O\+B\+J\+\_\+\+C\+O\+N\+S\+T\+R\+U\+C\+T, and ompi\+\_\+rb\+\_\+tree\+\_\+t\+::root\+\_\+ptr.

\hypertarget{ompi__rb__tree_8h_afbbf510be456128acde81fb627150b13}{\index{ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}!ompi\+\_\+rb\+\_\+tree\+\_\+delete@{ompi\+\_\+rb\+\_\+tree\+\_\+delete}}
\index{ompi\+\_\+rb\+\_\+tree\+\_\+delete@{ompi\+\_\+rb\+\_\+tree\+\_\+delete}!ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}}
\subsubsection[{ompi\+\_\+rb\+\_\+tree\+\_\+delete}]{\setlength{\rightskip}{0pt plus 5cm}O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int ompi\+\_\+rb\+\_\+tree\+\_\+delete (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+rb\+\_\+tree\+\_\+t} $\ast$}]{tree, }
\item[{void $\ast$}]{key}
\end{DoxyParamCaption}
)}}\label{ompi__rb__tree_8h_afbbf510be456128acde81fb627150b13}


deletes a node based on its key 


\begin{DoxyParams}{Parameters}
{\em tree} & a pointer to the tree data structure \\
\hline
{\em key} & a pointer to the key\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em O\+M\+P\+I\+\_\+\+S\+U\+C\+C\+E\+S\+S} & if the node is found and deleted \\
\hline
{\em O\+M\+P\+I\+\_\+\+E\+R\+R\+\_\+\+N\+O\+T\+\_\+\+F\+O\+U\+N\+D} & if the node is not found \\
\hline
\end{DoxyRetVals}


References ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t\+::color, ompi\+\_\+rb\+\_\+tree\+\_\+t\+::free\+\_\+list, ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t\+::key, ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t\+::left, ompi\+\_\+rb\+\_\+tree\+\_\+t\+::nill, ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t\+::parent, ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t\+::right, ompi\+\_\+rb\+\_\+tree\+\_\+t\+::root\+\_\+ptr, ompi\+\_\+rb\+\_\+tree\+\_\+t\+::tree\+\_\+size, and ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t\+::value.



Referenced by mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+delete(), and mca\+\_\+rcache\+\_\+vma\+\_\+tree\+\_\+delete().

\hypertarget{ompi__rb__tree_8h_a205583f53caeae10471b663902621011}{\index{ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}!ompi\+\_\+rb\+\_\+tree\+\_\+destroy@{ompi\+\_\+rb\+\_\+tree\+\_\+destroy}}
\index{ompi\+\_\+rb\+\_\+tree\+\_\+destroy@{ompi\+\_\+rb\+\_\+tree\+\_\+destroy}!ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}}
\subsubsection[{ompi\+\_\+rb\+\_\+tree\+\_\+destroy}]{\setlength{\rightskip}{0pt plus 5cm}O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int ompi\+\_\+rb\+\_\+tree\+\_\+destroy (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+rb\+\_\+tree\+\_\+t} $\ast$}]{tree}
\end{DoxyParamCaption}
)}}\label{ompi__rb__tree_8h_a205583f53caeae10471b663902621011}


frees all the nodes on the tree 


\begin{DoxyParams}{Parameters}
{\em tree} & a pointer to the tree data structure\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em O\+M\+P\+I\+\_\+\+S\+U\+C\+C\+E\+S\+S} & \\
\hline
\end{DoxyRetVals}


References ompi\+\_\+rb\+\_\+tree\+\_\+t\+::free\+\_\+list, ompi\+\_\+rb\+\_\+tree\+\_\+t\+::nill, and ompi\+\_\+rb\+\_\+tree\+\_\+t\+::root\+\_\+ptr.



Referenced by ompi\+\_\+rb\+\_\+tree\+\_\+destruct().

\hypertarget{ompi__rb__tree_8h_aedb23d8a06d883807a957cdfe06d1563}{\index{ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}!ompi\+\_\+rb\+\_\+tree\+\_\+destruct@{ompi\+\_\+rb\+\_\+tree\+\_\+destruct}}
\index{ompi\+\_\+rb\+\_\+tree\+\_\+destruct@{ompi\+\_\+rb\+\_\+tree\+\_\+destruct}!ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}}
\subsubsection[{ompi\+\_\+rb\+\_\+tree\+\_\+destruct}]{\setlength{\rightskip}{0pt plus 5cm}O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void ompi\+\_\+rb\+\_\+tree\+\_\+destruct (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+object\+\_\+t} $\ast$}]{object}
\end{DoxyParamCaption}
)}}\label{ompi__rb__tree_8h_aedb23d8a06d883807a957cdfe06d1563}


the destruct function. 

tries to free the tree and destroys the free list


\begin{DoxyParams}{Parameters}
{\em object} & the tree object \\
\hline
\end{DoxyParams}


References O\+B\+J\+\_\+\+D\+E\+S\+T\+R\+U\+C\+T, and ompi\+\_\+rb\+\_\+tree\+\_\+destroy().

\hypertarget{ompi__rb__tree_8h_a2d481dcab308433b38a39dc87ca9c56c}{\index{ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}!ompi\+\_\+rb\+\_\+tree\+\_\+find@{ompi\+\_\+rb\+\_\+tree\+\_\+find}}
\index{ompi\+\_\+rb\+\_\+tree\+\_\+find@{ompi\+\_\+rb\+\_\+tree\+\_\+find}!ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}}
\subsubsection[{ompi\+\_\+rb\+\_\+tree\+\_\+find}]{\setlength{\rightskip}{0pt plus 5cm}static void$\ast$ ompi\+\_\+rb\+\_\+tree\+\_\+find (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+rb\+\_\+tree\+\_\+t} $\ast$}]{tree, }
\item[{void $\ast$}]{key}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{ompi__rb__tree_8h_a2d481dcab308433b38a39dc87ca9c56c}


finds a value in the tree based on the passed key 


\begin{DoxyParams}{Parameters}
{\em tree} & a pointer to the tree data structure \\
\hline
{\em key} & a pointer to the key\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em pointer} & to the value if found \\
\hline
{\em N\+U\+L\+L} & if not found \\
\hline
\end{DoxyRetVals}


References ompi\+\_\+rb\+\_\+tree\+\_\+t\+::comp, and ompi\+\_\+rb\+\_\+tree\+\_\+find\+\_\+with().



Referenced by mca\+\_\+mpool\+\_\+base\+\_\+tree\+\_\+find(), and mca\+\_\+rcache\+\_\+rb\+\_\+tree\+\_\+find().

\hypertarget{ompi__rb__tree_8h_a4f60bcc13e5d1f89d826276d56dd05ad}{\index{ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}!ompi\+\_\+rb\+\_\+tree\+\_\+find\+\_\+with@{ompi\+\_\+rb\+\_\+tree\+\_\+find\+\_\+with}}
\index{ompi\+\_\+rb\+\_\+tree\+\_\+find\+\_\+with@{ompi\+\_\+rb\+\_\+tree\+\_\+find\+\_\+with}!ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}}
\subsubsection[{ompi\+\_\+rb\+\_\+tree\+\_\+find\+\_\+with}]{\setlength{\rightskip}{0pt plus 5cm}O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void$\ast$ ompi\+\_\+rb\+\_\+tree\+\_\+find\+\_\+with (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+rb\+\_\+tree\+\_\+t} $\ast$}]{tree, }
\item[{void $\ast$}]{key, }
\item[{{\bf ompi\+\_\+rb\+\_\+tree\+\_\+comp\+\_\+fn\+\_\+t}}]{compfn}
\end{DoxyParamCaption}
)}}\label{ompi__rb__tree_8h_a4f60bcc13e5d1f89d826276d56dd05ad}


finds a value in the tree based on the passed key using passed compare function 


\begin{DoxyParams}{Parameters}
{\em tree} & a pointer to the tree data structure \\
\hline
{\em key} & a pointer to the key \\
\hline
{\em compare} & function\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em pointer} & to the value if found \\
\hline
{\em N\+U\+L\+L} & if not found \\
\hline
\end{DoxyRetVals}


References ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t\+::key, ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t\+::left, ompi\+\_\+rb\+\_\+tree\+\_\+t\+::nill, ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t\+::right, ompi\+\_\+rb\+\_\+tree\+\_\+t\+::root\+\_\+ptr, and ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t\+::value.



Referenced by mca\+\_\+rcache\+\_\+vma\+\_\+tree\+\_\+delete(), mca\+\_\+rcache\+\_\+vma\+\_\+tree\+\_\+find(), mca\+\_\+rcache\+\_\+vma\+\_\+tree\+\_\+find\+\_\+all(), and ompi\+\_\+rb\+\_\+tree\+\_\+find().

\hypertarget{ompi__rb__tree_8h_ab84fbb00842fc7239be6f47e0b539f63}{\index{ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}!ompi\+\_\+rb\+\_\+tree\+\_\+init@{ompi\+\_\+rb\+\_\+tree\+\_\+init}}
\index{ompi\+\_\+rb\+\_\+tree\+\_\+init@{ompi\+\_\+rb\+\_\+tree\+\_\+init}!ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}}
\subsubsection[{ompi\+\_\+rb\+\_\+tree\+\_\+init}]{\setlength{\rightskip}{0pt plus 5cm}O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int ompi\+\_\+rb\+\_\+tree\+\_\+init (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+rb\+\_\+tree\+\_\+t} $\ast$}]{tree, }
\item[{{\bf ompi\+\_\+rb\+\_\+tree\+\_\+comp\+\_\+fn\+\_\+t}}]{comp}
\end{DoxyParamCaption}
)}}\label{ompi__rb__tree_8h_ab84fbb00842fc7239be6f47e0b539f63}


the function creates a new tree 


\begin{DoxyParams}{Parameters}
{\em tree} & a pointer to an allocated area of memory for the main tree data structure. \\
\hline
{\em comp} & a pointer to the function to use for comaparing 2 nodes\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em O\+M\+P\+I\+\_\+\+S\+U\+C\+C\+E\+S\+S} & if it is successful \\
\hline
{\em O\+M\+P\+I\+\_\+\+E\+R\+R\+\_\+\+T\+E\+M\+P\+\_\+\+O\+U\+T\+\_\+\+O\+F\+\_\+\+R\+E\+S\+O\+U\+R\+C\+E} & if unsuccessful \\
\hline
\end{DoxyRetVals}


References ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t\+::color, ompi\+\_\+rb\+\_\+tree\+\_\+t\+::comp, ompi\+\_\+rb\+\_\+tree\+\_\+t\+::free\+\_\+list, ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t\+::left, ompi\+\_\+rb\+\_\+tree\+\_\+t\+::nill, ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t\+::parent, ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t\+::right, ompi\+\_\+rb\+\_\+tree\+\_\+t\+::root\+\_\+ptr, and ompi\+\_\+rb\+\_\+tree\+\_\+t\+::tree\+\_\+size.

\hypertarget{ompi__rb__tree_8h_aa6def424a95216ff62779aa7873067f6}{\index{ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}!ompi\+\_\+rb\+\_\+tree\+\_\+insert@{ompi\+\_\+rb\+\_\+tree\+\_\+insert}}
\index{ompi\+\_\+rb\+\_\+tree\+\_\+insert@{ompi\+\_\+rb\+\_\+tree\+\_\+insert}!ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}}
\subsubsection[{ompi\+\_\+rb\+\_\+tree\+\_\+insert}]{\setlength{\rightskip}{0pt plus 5cm}O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int ompi\+\_\+rb\+\_\+tree\+\_\+insert (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+rb\+\_\+tree\+\_\+t} $\ast$}]{tree, }
\item[{void $\ast$}]{key, }
\item[{void $\ast$}]{value}
\end{DoxyParamCaption}
)}}\label{ompi__rb__tree_8h_aa6def424a95216ff62779aa7873067f6}


inserts a node into the tree 


\begin{DoxyParams}{Parameters}
{\em tree} & a pointer to the tree data structure \\
\hline
{\em key} & the key for the node \\
\hline
{\em value} & the value for the node\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em O\+M\+P\+I\+\_\+\+S\+U\+C\+C\+E\+S\+S} & \\
\hline
{\em O\+M\+P\+I\+\_\+\+E\+R\+R\+\_\+\+T\+E\+M\+P\+\_\+\+O\+U\+T\+\_\+\+O\+F\+\_\+\+R\+E\+S\+O\+U\+R\+C\+E} & if unsuccessful \\
\hline
\end{DoxyRetVals}


References ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t\+::color, ompi\+\_\+rb\+\_\+tree\+\_\+t\+::free\+\_\+list, ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t\+::key, ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t\+::left, ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t\+::parent, ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t\+::right, ompi\+\_\+rb\+\_\+tree\+\_\+t\+::root\+\_\+ptr, and ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t\+::value.

\hypertarget{ompi__rb__tree_8h_a174adfd33e1bf947c451639a8c70919b}{\index{ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}!ompi\+\_\+rb\+\_\+tree\+\_\+size@{ompi\+\_\+rb\+\_\+tree\+\_\+size}}
\index{ompi\+\_\+rb\+\_\+tree\+\_\+size@{ompi\+\_\+rb\+\_\+tree\+\_\+size}!ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}}
\subsubsection[{ompi\+\_\+rb\+\_\+tree\+\_\+size}]{\setlength{\rightskip}{0pt plus 5cm}O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int ompi\+\_\+rb\+\_\+tree\+\_\+size (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+rb\+\_\+tree\+\_\+t} $\ast$}]{tree}
\end{DoxyParamCaption}
)}}\label{ompi__rb__tree_8h_a174adfd33e1bf947c451639a8c70919b}


returns the size of the tree 


\begin{DoxyParams}{Parameters}
{\em tree} & a pointer to the tree data structure\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em int} & the nuber of items on the tree \\
\hline
\end{DoxyRetVals}


References ompi\+\_\+rb\+\_\+tree\+\_\+t\+::tree\+\_\+size.

\hypertarget{ompi__rb__tree_8h_a62c7cb372d46a8c7ea152ee709994c19}{\index{ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}!ompi\+\_\+rb\+\_\+tree\+\_\+traverse@{ompi\+\_\+rb\+\_\+tree\+\_\+traverse}}
\index{ompi\+\_\+rb\+\_\+tree\+\_\+traverse@{ompi\+\_\+rb\+\_\+tree\+\_\+traverse}!ompi\+\_\+rb\+\_\+tree.\+h@{ompi\+\_\+rb\+\_\+tree.\+h}}
\subsubsection[{ompi\+\_\+rb\+\_\+tree\+\_\+traverse}]{\setlength{\rightskip}{0pt plus 5cm}O\+M\+P\+I\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int ompi\+\_\+rb\+\_\+tree\+\_\+traverse (
\begin{DoxyParamCaption}
\item[{{\bf ompi\+\_\+rb\+\_\+tree\+\_\+t} $\ast$}]{tree, }
\item[{{\bf ompi\+\_\+rb\+\_\+tree\+\_\+condition\+\_\+fn\+\_\+t}}]{cond, }
\item[{{\bf ompi\+\_\+rb\+\_\+tree\+\_\+action\+\_\+fn\+\_\+t}}]{action}
\end{DoxyParamCaption}
)}}\label{ompi__rb__tree_8h_a62c7cb372d46a8c7ea152ee709994c19}


traverses the entire tree, performing the cond function on each of the values and if it returns one it performs the action function on the values 


\begin{DoxyParams}{Parameters}
{\em tree} & a pointer to the tree \\
\hline
{\em cond} & a pointer to the condition function \\
\hline
{\em action} & a pointer to the action function\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em O\+M\+P\+I\+\_\+\+S\+U\+C\+C\+E\+S\+S} & \\
\hline
{\em O\+M\+P\+I\+\_\+\+E\+R\+R\+O\+R} & if there is an error \\
\hline
\end{DoxyRetVals}


References ompi\+\_\+rb\+\_\+tree\+\_\+node\+\_\+t\+::left, and ompi\+\_\+rb\+\_\+tree\+\_\+t\+::root\+\_\+ptr.

