\hypertarget{class_ogre_1_1_radix_sort}{}\section{Ogre\+:\+:Radix\+Sort$<$ T\+Container, T\+Container\+Value\+Type, T\+Comp\+Value\+Type $>$ Class Template Reference}
\label{class_ogre_1_1_radix_sort}\index{Ogre\+::\+Radix\+Sort$<$ T\+Container, T\+Container\+Value\+Type, T\+Comp\+Value\+Type $>$@{Ogre\+::\+Radix\+Sort$<$ T\+Container, T\+Container\+Value\+Type, T\+Comp\+Value\+Type $>$}}


Class for performing a radix sort (fast comparison-\/less sort based on byte value) on various standard S\+TL containers.  




{\ttfamily \#include $<$Ogre\+Radix\+Sort.\+h$>$}

\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
typedef T\+Container\+::iterator \hyperlink{class_ogre_1_1_radix_sort_ae6832006de9925d59d8795d4f708f08f}{Container\+Iter}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_ogre_1_1_radix_sort_a2c982200600a22b21906e3f43a0a962d}{Radix\+Sort} ()
\item 
\hyperlink{class_ogre_1_1_radix_sort_a8f49cae4360e7c83b6ca7cf5714db761}{$\sim$\+Radix\+Sort} ()
\item 
{\footnotesize template$<$class T\+Function $>$ }\\void \hyperlink{class_ogre_1_1_radix_sort_a4fc283b678dfda772eb6600436d97579}{sort} (T\+Container \&container, T\+Function func)
\begin{DoxyCompactList}\small\item\em Main sort function. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$class T\+Container, class T\+Container\+Value\+Type, typename T\+Comp\+Value\+Type$>$\newline
class Ogre\+::\+Radix\+Sort$<$ T\+Container, T\+Container\+Value\+Type, T\+Comp\+Value\+Type $>$}

Class for performing a radix sort (fast comparison-\/less sort based on byte value) on various standard S\+TL containers. 

\begin{DoxyRemark}{Remarks}
A radix sort is a very fast sort algorithm. It doesn\textquotesingle{}t use comparisons and thus is able to break the theoretical minimum O(\+N$\ast$log\+N) complexity. Radix sort is complexity O(k$\ast$\+N), where k is a constant. Note that radix sorting is not in-\/place, it requires additional storage, so it trades memory for speed. The overhead of copying means that it is only faster for fairly large datasets, so you are advised to only use it for collections of at least a few hundred items. 
\end{DoxyRemark}
\begin{DoxyParagraph}{}
This is a template class to allow it to deal with a variety of containers, and a variety of value types to sort on. In addition to providing the container and value type on construction, you also need to supply a functor object which will retrieve the value to compare on for each item in the list. For example, if you had an std\+::vector of by-\/value instances of an object of class \textquotesingle{}Bibble\textquotesingle{}, and you wanted to sort on Bibble\+::get\+Doobrie(), you\textquotesingle{}d have to firstly create a functor like this\+: 
\begin{DoxyCode}
\textcolor{keyword}{struct }BibbleSortFunctor
\{
    \textcolor{keywordtype}{float} operator()(\textcolor{keyword}{const} Bibble& val)\textcolor{keyword}{ const}
\textcolor{keyword}{    }\{
        \textcolor{keywordflow}{return} val.getDoobrie();
    \}
\}
\end{DoxyCode}
 Then, you need to declare a \hyperlink{class_ogre_1_1_radix_sort}{Radix\+Sort} class which names the container type, the value type in the container, and the type of the value you want to sort by. You can then call the sort function. E.\+g. 
\begin{DoxyCode}
RadixSort<BibbleList, Bibble, float> radixSorter;
BibbleSortFunctor functor;

radixSorter.sort(myBibbleList, functor);
\end{DoxyCode}
 You should try to reuse \hyperlink{class_ogre_1_1_radix_sort}{Radix\+Sort} instances, since repeated allocation of the internal storage is then avoided. 
\end{DoxyParagraph}
\begin{DoxyNote}{Note}
Radix sorting is often associated with just unsigned integer values. Our implementation can handle both unsigned and signed integers, as well as floats (which are often not supported by other radix sorters). doubles are not supported; you will need to implement your functor object to convert to float if you wish to use this sort routine. 
\end{DoxyNote}


\subsection{Member Typedef Documentation}
\mbox{\Hypertarget{class_ogre_1_1_radix_sort_ae6832006de9925d59d8795d4f708f08f}\label{class_ogre_1_1_radix_sort_ae6832006de9925d59d8795d4f708f08f}} 
\index{Ogre\+::\+Radix\+Sort@{Ogre\+::\+Radix\+Sort}!Container\+Iter@{Container\+Iter}}
\index{Container\+Iter@{Container\+Iter}!Ogre\+::\+Radix\+Sort@{Ogre\+::\+Radix\+Sort}}
\subsubsection{\texorpdfstring{Container\+Iter}{ContainerIter}}
{\footnotesize\ttfamily template$<$class T\+Container, class T\+Container\+Value\+Type, typename T\+Comp\+Value\+Type$>$ \\
typedef T\+Container\+::iterator \hyperlink{class_ogre_1_1_radix_sort}{Ogre\+::\+Radix\+Sort}$<$ T\+Container, T\+Container\+Value\+Type, T\+Comp\+Value\+Type $>$\+::\hyperlink{class_ogre_1_1_radix_sort_ae6832006de9925d59d8795d4f708f08f}{Container\+Iter}}



\subsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{class_ogre_1_1_radix_sort_a2c982200600a22b21906e3f43a0a962d}\label{class_ogre_1_1_radix_sort_a2c982200600a22b21906e3f43a0a962d}} 
\index{Ogre\+::\+Radix\+Sort@{Ogre\+::\+Radix\+Sort}!Radix\+Sort@{Radix\+Sort}}
\index{Radix\+Sort@{Radix\+Sort}!Ogre\+::\+Radix\+Sort@{Ogre\+::\+Radix\+Sort}}
\subsubsection{\texorpdfstring{Radix\+Sort()}{RadixSort()}}
{\footnotesize\ttfamily template$<$class T\+Container, class T\+Container\+Value\+Type, typename T\+Comp\+Value\+Type$>$ \\
\hyperlink{class_ogre_1_1_radix_sort}{Ogre\+::\+Radix\+Sort}$<$ T\+Container, T\+Container\+Value\+Type, T\+Comp\+Value\+Type $>$\+::\hyperlink{class_ogre_1_1_radix_sort}{Radix\+Sort} (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

\mbox{\Hypertarget{class_ogre_1_1_radix_sort_a8f49cae4360e7c83b6ca7cf5714db761}\label{class_ogre_1_1_radix_sort_a8f49cae4360e7c83b6ca7cf5714db761}} 
\index{Ogre\+::\+Radix\+Sort@{Ogre\+::\+Radix\+Sort}!````~Radix\+Sort@{$\sim$\+Radix\+Sort}}
\index{````~Radix\+Sort@{$\sim$\+Radix\+Sort}!Ogre\+::\+Radix\+Sort@{Ogre\+::\+Radix\+Sort}}
\subsubsection{\texorpdfstring{$\sim$\+Radix\+Sort()}{~RadixSort()}}
{\footnotesize\ttfamily template$<$class T\+Container, class T\+Container\+Value\+Type, typename T\+Comp\+Value\+Type$>$ \\
\hyperlink{class_ogre_1_1_radix_sort}{Ogre\+::\+Radix\+Sort}$<$ T\+Container, T\+Container\+Value\+Type, T\+Comp\+Value\+Type $>$\+::$\sim$\hyperlink{class_ogre_1_1_radix_sort}{Radix\+Sort} (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_ogre_1_1_radix_sort_a4fc283b678dfda772eb6600436d97579}\label{class_ogre_1_1_radix_sort_a4fc283b678dfda772eb6600436d97579}} 
\index{Ogre\+::\+Radix\+Sort@{Ogre\+::\+Radix\+Sort}!sort@{sort}}
\index{sort@{sort}!Ogre\+::\+Radix\+Sort@{Ogre\+::\+Radix\+Sort}}
\subsubsection{\texorpdfstring{sort()}{sort()}}
{\footnotesize\ttfamily template$<$class T\+Container, class T\+Container\+Value\+Type, typename T\+Comp\+Value\+Type$>$ \\
template$<$class T\+Function $>$ \\
void \hyperlink{class_ogre_1_1_radix_sort}{Ogre\+::\+Radix\+Sort}$<$ T\+Container, T\+Container\+Value\+Type, T\+Comp\+Value\+Type $>$\+::sort (\begin{DoxyParamCaption}\item[{T\+Container \&}]{container,  }\item[{T\+Function}]{func }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Main sort function. 


\begin{DoxyParams}{Parameters}
{\em container} & A container of the type you declared when declaring \\
\hline
{\em func} & A functor which returns the value for comparison when given a container value \\
\hline
\end{DoxyParams}


The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\hyperlink{_ogre_radix_sort_8h}{Ogre\+Radix\+Sort.\+h}\end{DoxyCompactItemize}
