Class for performing a radix sort (fast comparison-less sort based on byte value) on various standard STL containers. More...
#include <OgreRadixSort.h>
Classes | |
struct | SortEntry |
Public Types | |
typedef TContainer::iterator | ContainerIter |
Public Member Functions | |
RadixSort () | |
~RadixSort () | |
template<class TFunction > | |
void | sort (TContainer &container, TFunction func) |
Main sort function. | |
Protected Types | |
typedef std::vector< SortEntry, STLAllocator< SortEntry, GeneralAllocPolicy > > | SortVector |
Temp sort storage. | |
Protected Member Functions | |
void | sortPass (int byteIndex) |
template<typename T > | |
void | finalPass (int byteIndex, T val) |
void | finalPass (int byteIndex, int val) |
void | finalPass (int byteIndex, float val) |
unsigned char | getByte (int byteIndex, TCompValueType val) |
Protected Attributes | |
int | mCounters [4][256] |
Alpha-pass counters of values (histogram) 4 of them so we can radix sort a maximum of a 32bit value. | |
int | mOffsets [256] |
Beta-pass offsets. | |
int | mSortSize |
Sort area size. | |
int | mNumPasses |
Number of passes for this type. | |
SortVector | mSortArea1 |
SortVector | mSortArea2 |
SortVector * | mSrc |
SortVector * | mDest |
TContainer | mTmpContainer |
Class for performing a radix sort (fast comparison-less sort based on byte value) on various standard STL containers.
struct BibbleSortFunctor { float operator()(const Bibble& val) const { return val.getDoobrie(); } }
RadixSort<BibbleList, Bibble, float> radixSorter; BibbleSortFunctor functor; radixSorter.sort(myBibbleList, functor);
Definition at line 88 of file OgreRadixSort.h.
typedef TContainer::iterator Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::ContainerIter |
Definition at line 91 of file OgreRadixSort.h.
typedef std::vector<SortEntry, STLAllocator<SortEntry, GeneralAllocPolicy> > Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::SortVector [protected] |
Temp sort storage.
Definition at line 113 of file OgreRadixSort.h.
Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::RadixSort | ( | ) |
Definition at line 237 of file OgreRadixSort.h.
Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::~RadixSort | ( | ) |
Definition at line 238 of file OgreRadixSort.h.
void Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::finalPass | ( | int | byteIndex, | |
float | val | |||
) | [protected] |
Definition at line 180 of file OgreRadixSort.h.
void Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::finalPass | ( | int | byteIndex, | |
int | val | |||
) | [protected] |
Definition at line 147 of file OgreRadixSort.h.
void Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::finalPass | ( | int | byteIndex, | |
T | val | |||
) | [protected] |
Definition at line 140 of file OgreRadixSort.h.
Referenced by Ogre::RadixSort< RenderablePassList, RenderablePass, uint32 >::sort().
unsigned char Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::getByte | ( | int | byteIndex, | |
TCompValueType | val | |||
) | [protected] |
void Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::sort | ( | TContainer & | container, | |
TFunction | func | |||
) |
Main sort function.
container | A container of the type you declared when declaring | |
func | A functor which returns the value for comparison when given a container value |
Definition at line 246 of file OgreRadixSort.h.
void Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::sortPass | ( | int | byteIndex | ) | [protected] |
Definition at line 121 of file OgreRadixSort.h.
Referenced by Ogre::RadixSort< RenderablePassList, RenderablePass, uint32 >::finalPass(), and Ogre::RadixSort< RenderablePassList, RenderablePass, uint32 >::sort().
int Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mCounters[4][256] [protected] |
Alpha-pass counters of values (histogram) 4 of them so we can radix sort a maximum of a 32bit value.
Definition at line 95 of file OgreRadixSort.h.
Referenced by Ogre::RadixSort< RenderablePassList, RenderablePass, uint32 >::finalPass(), Ogre::RadixSort< RenderablePassList, RenderablePass, uint32 >::sort(), and Ogre::RadixSort< RenderablePassList, RenderablePass, uint32 >::sortPass().
SortVector* Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mDest [protected] |
Definition at line 117 of file OgreRadixSort.h.
Referenced by Ogre::RadixSort< RenderablePassList, RenderablePass, uint32 >::sort().
int Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mNumPasses [protected] |
Number of passes for this type.
Definition at line 101 of file OgreRadixSort.h.
Referenced by Ogre::RadixSort< RenderablePassList, RenderablePass, uint32 >::getByte(), and Ogre::RadixSort< RenderablePassList, RenderablePass, uint32 >::sort().
int Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mOffsets[256] [protected] |
Beta-pass offsets.
Definition at line 97 of file OgreRadixSort.h.
Referenced by Ogre::RadixSort< RenderablePassList, RenderablePass, uint32 >::finalPass(), and Ogre::RadixSort< RenderablePassList, RenderablePass, uint32 >::sortPass().
SortVector Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mSortArea1 [protected] |
Definition at line 114 of file OgreRadixSort.h.
Referenced by Ogre::RadixSort< RenderablePassList, RenderablePass, uint32 >::sort().
SortVector Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mSortArea2 [protected] |
Definition at line 115 of file OgreRadixSort.h.
Referenced by Ogre::RadixSort< RenderablePassList, RenderablePass, uint32 >::sort().
int Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mSortSize [protected] |
Sort area size.
Definition at line 99 of file OgreRadixSort.h.
Referenced by Ogre::RadixSort< RenderablePassList, RenderablePass, uint32 >::finalPass(), Ogre::RadixSort< RenderablePassList, RenderablePass, uint32 >::sort(), and Ogre::RadixSort< RenderablePassList, RenderablePass, uint32 >::sortPass().
SortVector* Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mSrc [protected] |
TContainer Ogre::RadixSort< TContainer, TContainerValueType, TCompValueType >::mTmpContainer [protected] |
Definition at line 118 of file OgreRadixSort.h.
Referenced by Ogre::RadixSort< RenderablePassList, RenderablePass, uint32 >::sort().
Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Fri May 25 23:39:04 2012