// Copyright (c) 2008 Michael Miceli and Christopher Miceli // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef MR_MERGER_HPP #define MR_MERGER_HPP #include #include "type.hpp" #include namespace MapReduce { template void merger(std::vector &list, std::vector fileList) { while(fileList.size() > 0) { boost::iostreams::stream in (fileList.back()); char line[1000]; while(in.getline(line,1000)) { list.push_back(line); } fileList.pop_back(); } std::sort(list.begin(),list.end()); } } // namespace MapReduce #endif // MR_MERGER_HPP