#ifndef CONCORDIA_INDEX_HDR #define CONCORDIA_INDEX_HDR #include #include #include #include #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) throw(ConcordiaException); /*! Destructor. */ virtual ~ConcordiaIndex(); void addSentence( boost::shared_ptr hashGenerator, boost::shared_ptr > T, const string & sentence); void addAllSentences( boost::shared_ptr hashGenerator, boost::shared_ptr > T, boost::shared_ptr > sentences); boost::shared_ptr > generateSuffixArray( boost::shared_ptr hashGenerator, boost::shared_ptr > T); private: // Add sentence to disk index and update RAM index. void _addSingleSentence(ofstream & hashedIndexFile, boost::shared_ptr hashGenerator, boost::shared_ptr > T, const string & sentence); string _hashedIndexFilePath; }; #endif