#ifndef CONCORDIA_INDEX_HDR #define CONCORDIA_INDEX_HDR #include #include #include #include #include #include "concordia/common/config.hpp" #include "concordia/example.hpp" #include "concordia/hash_generator.hpp" #include "concordia/concordia_exception.hpp" #include "build/libdivsufsort/include/divsufsort.h" /*! Class for creating and maintaining the index. */ using namespace std; class ConcordiaIndex { public: explicit ConcordiaIndex(const string & hashedIndexFilePath, const string & markersFilePath) throw(ConcordiaException); /*! Destructor. */ virtual ~ConcordiaIndex(); void addExample( boost::shared_ptr hashGenerator, boost::shared_ptr > T, boost::shared_ptr > markers, const Example & example); void addAllExamples( boost::shared_ptr hashGenerator, boost::shared_ptr > T, boost::shared_ptr > markers, const boost::ptr_vector & examples); boost::shared_ptr > generateSuffixArray( boost::shared_ptr hashGenerator, boost::shared_ptr > T); private: // Add example to disk index and update RAM index. void _addSingleExample(ofstream & hashedIndexFile, ofstream & markersFile, boost::shared_ptr hashGenerator, boost::shared_ptr > T, boost::shared_ptr > markers, const Example & example); string _hashedIndexFilePath; string _markersFilePath; }; #endif