00001 00009 #ifndef BinaryNormalDecoder_HPP 00010 #define BinaryNormalDecoder_HPP 00011 00012 00013 #include <iterator> 00014 #include "io/codec/decoder/SimpleDecoderBase.hpp" 00015 #include "io/FDRepr.hpp" 00016 00021 template <class FR = FDRepr> 00022 class BinaryNormalDecoder : public SimpleDecoderBase<FR> 00023 { 00024 public: 00025 00026 typedef typename SimpleDecoderBase<FR>::params_t params_t; 00027 BinaryNormalDecoder(const params_t* par) 00028 : SimpleDecoderBase<FR>(par){} 00029 00030 static bool DINLINE isDFO() 00031 { 00032 return false; 00033 } 00034 00035 00036 template <typename InputIterator> 00037 void writeItemsetAndCounter( 00038 InputIterator first, InputIterator last, 00039 const counter_t support ) 00040 { 00041 static std::vector<item_t> decoded_set; 00042 decoded_set.resize(2); 00043 decoded_set[0]=support; 00044 while(first != last) 00045 { 00046 decoded_set.push_back(code_inverse[*first]); 00047 ++first; 00048 } 00049 decoded_set[1]=decoded_set.size()-2; 00050 writeToFile( (char*)&(decoded_set[0]), 00051 decoded_set.size()*sizeof(item_t) ); 00052 }; 00053 00054 #endif