00001 #ifndef INCLUDE_CHANNELIZER_H
00002 #define INCLUDE_CHANNELIZER_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
00036 #if defined(NO_TEMPLATE_MEMBERS)
00037 #include "PartialList.h"
00038 #endif
00039
00040 #include <memory>
00041
00042
00043 namespace Loris {
00044
00045 class Envelope;
00046 class Partial;
00047
00048
00049
00050
00074
00075 class Channelizer
00076 {
00077
00078 std::auto_ptr< Envelope > _refChannelFreq;
00079 int _refChannelLabel;
00080
00081
00082 public:
00083
00084
00095 Channelizer( const Envelope & refChanFreq, int refChanLabel );
00096
00102 Channelizer( const Channelizer & other );
00103
00109 Channelizer & operator=( const Channelizer & rhs );
00110
00112 ~Channelizer( void );
00113
00114
00115
00120 void channelize( Partial & partial ) const;
00121
00132 #if ! defined(NO_TEMPLATE_MEMBERS)
00133 template<typename Iter>
00134 void channelize( Iter begin, Iter end ) const;
00135 #else
00136 void channelize( PartialList::iterator begin, PartialList::iterator end ) const;
00137 #endif
00138
00140 #if ! defined(NO_TEMPLATE_MEMBERS)
00141 template<typename Iter>
00142 void operator() ( Iter begin, Iter end ) const
00143 #else
00144 inline
00145 void operator() ( PartialList::iterator begin, PartialList::iterator end ) const
00146 #endif
00147 { channelize( begin, end ); }
00148
00149
00150
00172 #if ! defined(NO_TEMPLATE_MEMBERS)
00173 template< typename Iter >
00174 static
00175 void channelize( Iter begin, Iter end,
00176 const Envelope & refChanFreq, int refChanLabel );
00177 #else
00178 static inline
00179 void channelize( PartialList::iterator begin, PartialList::iterator end,
00180 const Envelope & refChanFreq, int refChanLabel );
00181 #endif
00182
00183 };
00184
00185
00186
00187
00198
00199 #if ! defined(NO_TEMPLATE_MEMBERS)
00200 template<typename Iter>
00201 void Channelizer::channelize( Iter begin, Iter end ) const
00202 #else
00203 inline
00204 void Channelizer::channelize( PartialList::iterator begin, PartialList::iterator end ) const
00205 #endif
00206 {
00207 while ( begin != end )
00208 {
00209 channelize( *begin++ );
00210 }
00211 }
00212
00213
00214
00215
00237
00238 #if ! defined(NO_TEMPLATE_MEMBERS)
00239 template< typename Iter >
00240 void Channelizer::channelize( Iter begin, Iter end,
00241 const Envelope & refChanFreq, int refChanLabel )
00242 #else
00243 inline
00244 void Channelizer::channelize( PartialList::iterator begin, PartialList::iterator end,
00245 const Envelope & refChanFreq, int refChanLabel )
00246 #endif
00247 {
00248 Channelizer instance( refChanFreq, refChanLabel );
00249 while ( begin != end )
00250 {
00251 instance.channelize( *begin++ );
00252 }
00253 }
00254
00255
00256
00257 }
00258
00259 #endif