Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

osg::indirector< ContentT, IndexT > Class Template Reference
[STLHelpersString Functions]

#include <OSGBaseFunctions.h>

List of all members.

Public Member Functions

 indirector (ContentT cont)
bool operator() (IndexT a, IndexT b)

Private Attributes

ContentT _cont


Detailed Description

template<class ContentT, class IndexT>
class osg::indirector< ContentT, IndexT >

Indirector

Allows using an indirection field for STL algorithms, e.g. sort.

The idea is to sort an index field instead of the actual data, as the data might be large or immovable.

Example:

std::vector<float> contv; std::vector<int> indv; indirector<std::vector<float>, int> ind(contv);

std::sort(indv.begin(), indv.end(), ind);

Definition at line 508 of file OSGBaseFunctions.h.


Constructor & Destructor Documentation

template<class ContentT, class IndexT>
osg::indirector< ContentT, IndexT >::indirector ContentT  cont  ) 
 

Definition at line 1276 of file OSGBaseFunctions.inl.

01276                                                       : _cont(cont)
01277 {}


Member Function Documentation

template<class ContentT, class IndexT>
bool osg::indirector< ContentT, IndexT >::operator() IndexT  a,
IndexT  b
 

Definition at line 1280 of file OSGBaseFunctions.inl.

References osg::indirector< ContentT, IndexT >::_cont.

01281 {
01282     if(_cont[a] < _cont[b])
01283         return true;
01284 
01285     return false;
01286 }


Member Data Documentation

template<class ContentT, class IndexT>
ContentT osg::indirector< ContentT, IndexT >::_cont [private]
 

Definition at line 518 of file OSGBaseFunctions.h.

Referenced by osg::indirector< ContentT, IndexT >::operator()().


The documentation for this class was generated from the following files:
Generated on Thu Aug 25 04:12:32 2005 for OpenSG by  doxygen 1.4.3