2013-10-24 17:08:58 +02:00
|
|
|
#ifndef CONCORDIA_HDR
|
|
|
|
#define CONCORDIA_HDR
|
|
|
|
|
|
|
|
#include <string>
|
2013-11-28 16:47:57 +01:00
|
|
|
#include <vector>
|
2013-10-24 17:08:58 +02:00
|
|
|
#include <boost/shared_ptr.hpp>
|
2014-02-20 10:49:17 +01:00
|
|
|
#include <boost/ptr_container/ptr_vector.hpp>
|
2013-12-14 15:23:17 +01:00
|
|
|
#include <boost/filesystem.hpp>
|
2013-10-24 17:08:58 +02:00
|
|
|
|
2014-02-20 10:49:17 +01:00
|
|
|
#include "concordia/common/config.hpp"
|
|
|
|
#include "concordia/example.hpp"
|
|
|
|
#include "concordia/substring_occurence.hpp"
|
2013-10-24 17:08:58 +02:00
|
|
|
#include "concordia/concordia_config.hpp"
|
2013-11-28 16:47:57 +01:00
|
|
|
#include "concordia/concordia_index.hpp"
|
|
|
|
#include "concordia/index_searcher.hpp"
|
2014-02-20 18:46:04 +01:00
|
|
|
#include "divsufsort.h"
|
2013-11-28 16:47:57 +01:00
|
|
|
|
2013-10-24 17:08:58 +02:00
|
|
|
|
|
|
|
/*!
|
|
|
|
The Concordia class is the main access point to the library.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
class Concordia {
|
|
|
|
public:
|
|
|
|
/*! Constructor.
|
|
|
|
\param configFilePath path to the Concordia configuration file
|
|
|
|
\throws ConcordiaException
|
|
|
|
*/
|
|
|
|
explicit Concordia(const std::string & configFilePath)
|
|
|
|
throw(ConcordiaException);
|
|
|
|
/*! Destructor.
|
|
|
|
*/
|
|
|
|
virtual ~Concordia();
|
|
|
|
|
|
|
|
/*! Getter for version.
|
|
|
|
\returns version of the Concordia library.
|
|
|
|
*/
|
|
|
|
std::string & getVersion();
|
|
|
|
|
2014-02-20 10:49:17 +01:00
|
|
|
void addExample(const Example & example) throw(ConcordiaException);
|
2013-11-28 16:47:57 +01:00
|
|
|
|
2014-02-20 10:49:17 +01:00
|
|
|
void addAllExamples(const boost::ptr_vector<Example > & examples)
|
2013-12-06 22:29:25 +01:00
|
|
|
throw(ConcordiaException);
|
|
|
|
|
2014-02-20 10:49:17 +01:00
|
|
|
boost::ptr_vector<SubstringOccurence> simpleSearch(
|
2013-12-14 15:23:17 +01:00
|
|
|
const std::string & pattern)
|
|
|
|
throw(ConcordiaException);
|
2013-11-28 16:47:57 +01:00
|
|
|
|
2013-12-14 15:23:17 +01:00
|
|
|
void loadRAMIndexFromDisk() throw(ConcordiaException);
|
2013-12-06 22:29:25 +01:00
|
|
|
|
2013-12-14 15:23:17 +01:00
|
|
|
void refreshSAfromRAM() throw(ConcordiaException);
|
2013-11-28 16:47:57 +01:00
|
|
|
|
2013-10-24 17:08:58 +02:00
|
|
|
private:
|
2013-12-14 15:23:17 +01:00
|
|
|
void _initializeIndex() throw(ConcordiaException);
|
|
|
|
|
2013-10-24 17:08:58 +02:00
|
|
|
static std::string _libraryVersion;
|
|
|
|
|
|
|
|
boost::shared_ptr<ConcordiaConfig> _config;
|
2013-11-28 16:47:57 +01:00
|
|
|
|
|
|
|
boost::shared_ptr<ConcordiaIndex> _index;
|
|
|
|
|
|
|
|
boost::shared_ptr<IndexSearcher> _searcher;
|
2013-12-14 15:23:17 +01:00
|
|
|
|
|
|
|
boost::shared_ptr<HashGenerator> _hashGenerator;
|
|
|
|
|
|
|
|
boost::shared_ptr<std::vector<sauchar_t> > _T;
|
|
|
|
|
|
|
|
boost::shared_ptr<std::vector<saidx_t> > _SA;
|
2014-02-20 10:49:17 +01:00
|
|
|
|
|
|
|
boost::shared_ptr<std::vector<SUFFIX_MARKER_TYPE> > _markers;
|
2013-10-24 17:08:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|