1 #ifndef __MODISDATABASE_H__ 2 #define __MODISDATABASE_H__ 8 #include <boost/algorithm/string.hpp> 9 #include <boost/filesystem.hpp> 10 #include <boost/foreach.hpp> 11 #include <boost/lexical_cast.hpp> 13 #include <boost/multi_index_container.hpp> 14 #include <boost/multi_index/member.hpp> 15 #include <boost/multi_index/mem_fun.hpp> 16 #include <boost/multi_index/ordered_index.hpp> 18 #include <boost/regex.hpp> 20 void MSearch(
const boost::filesystem::path& mpath, std::vector<std::string>& fnames);
36 std::cout <<
"File: " <<
filen <<
", product: " <<
product <<
", year: " <<
year <<
" day: " <<
day <<
", H: " <<
h <<
", V: " <<
v << std::endl;
55 typedef boost::multi_index_container
58 boost::multi_index::indexed_by
60 boost::multi_index::ordered_unique<BOOST_MULTI_INDEX_MEMBER(MODISRecord,std::string,filen)>,
61 boost::multi_index::ordered_non_unique<BOOST_MULTI_INDEX_MEMBER(MODISRecord,std::string,product)>,
62 boost::multi_index::ordered_non_unique<BOOST_MULTI_INDEX_MEMBER(MODISRecord,unsigned int,year)>,
63 boost::multi_index::ordered_non_unique<BOOST_MULTI_INDEX_MEMBER(MODISRecord,unsigned int,day)>
80 MODISRecord findByFile(
const std::string& filename)
const;
82 std::vector<MODISRecord> findByProduct(
const std::string&
product)
const;
84 std::vector<MODISRecord> findByYear(
unsigned int year)
const;
86 std::vector<MODISRecord> findByDay(
unsigned int day)
const;
void MSearch(const boost::filesystem::path &mpath, std::vector< std::string > &fnames)
boost::multi_index_container< MODISRecord, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< BOOST_MULTI_INDEX_MEMBER(MODISRecord, std::string, filen)>, boost::multi_index::ordered_non_unique< BOOST_MULTI_INDEX_MEMBER(MODISRecord, std::string, product)>, boost::multi_index::ordered_non_unique< BOOST_MULTI_INDEX_MEMBER(MODISRecord, unsigned int, year)>, boost::multi_index::ordered_non_unique< BOOST_MULTI_INDEX_MEMBER(MODISRecord, unsigned int, day)> > > MODISDb