00001 #ifndef SortOutput_HPP
00002 #define SortOutput_HPP
00003
00008 #include <algorithm>
00009 #include "io/output/normal/BufferedNormalOutput.hpp"
00010
00017 template <class O = BufferedNormalOutput<> >
00018 class SortOutput : public O
00019 {
00020 public:
00021
00022 typedef typename O::params_t params_t;
00023
00024 SortOutput(const params_t* par) :
00025 O(par) {}
00026
00027
00028
00029 template <typename InputIterator> void writeItemsetAndCounter(
00030 InputIterator first, InputIterator last,
00031 counter_t support )
00032 {
00033 std::vector<item_t> sorted_itemset(first, last);
00034 std::sort(sorted_itemset.begin(), sorted_itemset.end());
00035 O::writeItemsetAndCounter(
00036 sorted_itemset.begin(), sorted_itemset.end(), support);
00037 }
00038 };
00039
00040 #endif