00001 #ifndef INCLUDE_SIEVE_H
00002 #define INCLUDE_SIEVE_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #if defined(NO_TEMPLATE_MEMBERS)
00036 #include "PartialList.h"
00037 #endif
00038
00039 #include "PartialPtrs.h"
00040
00041
00042 namespace Loris {
00043
00044
00045
00046
00065
00066 class Sieve
00067 {
00068
00069
00070 double _fadeTime;
00071
00072
00073
00074
00075 public:
00076
00077
00088 explicit Sieve( double partialFadeTime = 0.001 );
00089
00090
00091
00092
00093
00106 #if ! defined(NO_TEMPLATE_MEMBERS)
00107 template<typename Iter>
00108 void sift( Iter sift_begin, Iter sift_end );
00109 #else
00110 inline
00111 void sift( PartialList::iterator sift_begin, PartialList::iterator sift_end );
00112 #endif
00113
00114
00115
00133 #if ! defined(NO_TEMPLATE_MEMBERS)
00134 template< typename Iter >
00135 static
00136 void sift( Iter sift_begin, Iter sift_end,
00137 double partialFadeTime );
00138 #else
00139 static inline
00140 void sift( PartialList::iterator sift_begin, PartialList::iterator sift_end,
00141 double partialFadeTime );
00142 #endif
00143
00144
00145 private:
00146
00156 void sift_ptrs( PartialPtrs & ptrs );
00157
00158 };
00159
00160
00161
00162
00175 #if ! defined(NO_TEMPLATE_MEMBERS)
00176 template< typename Iter >
00177 void Sieve::sift( Iter sift_begin, Iter sift_end )
00178 #else
00179 inline
00180 void Sieve::sift( PartialList::iterator sift_begin, PartialList::iterator sift_end )
00181 #endif
00182 {
00183 PartialPtrs ptrs;
00184 fillPartialPtrs( sift_begin, sift_end, ptrs );
00185 sift_ptrs( ptrs );
00186 }
00187
00188
00189
00190
00208 #if ! defined(NO_TEMPLATE_MEMBERS)
00209 template< typename Iter >
00210 void Sieve::sift( Iter sift_begin, Iter sift_end,
00211 double partialFadeTime )
00212 #else
00213 inline
00214 void Sieve::sift( PartialList::iterator sift_begin, PartialList::iterator sift_end,
00215 double partialFadeTime )
00216 #endif
00217 {
00218 Sieve instance( partialFadeTime );
00219 instance.sift( sift_begin, sift_end );
00220 }
00221
00222 }
00223
00224 #endif