41 template<
typename OutputBuffer >
42 template<
typename Iterator>
46 const unsigned int max_encodable = output.max_encodable();
47 const unsigned int min_interesting = output.min_interesting();
48 raw_buffer_type raw_buffer;
50 assert( max_encodable > 0 );
54 unsigned int count = 1;
56 Iterator saved_it = first;
61 while ( ok && (first != last) && (count < max_encodable) )
62 if (*first == pattern)
71 if ( count >= min_interesting )
73 if ( !raw_buffer.empty() )
75 output.raw( raw_buffer.begin(), raw_buffer.end() );
79 output.encode( count, pattern );
82 raw_buffer.insert( raw_buffer.end(), saved_it, first );
86 if ( !raw_buffer.empty() )
87 output.raw( raw_buffer.begin(), raw_buffer.end() );
OutputBuffer output_buffer_type
The type of the output buffer.
output_buffer_type::pattern_type pattern_type
The type of the stored data.
void encode(Iterator first, Iterator last, output_buffer_type &output) const
Encode a range of datas.
Fuction object to get the first element of a std::pair.