OpenFlexTyper
ftSearch.h
1 #ifndef __FM_SEARCH_H__
2 #define __FM_SEARCH_H__
3 
4 #include <experimental/filesystem>
5 #include <climits>
6 #include "finder.h"
7 #include "ifinder.h"
8 #include "ftMapClass.h"
9 #include "utils.h"
10 #include "iutils.h"
11 #include "writerbridge.h"
12 #include "iwriterbridge.h"
13 #include "queryextractor.h"
14 #include "iqueryextractor.h"
15 
16 namespace fs = std::experimental::filesystem;
17 
22 namespace ft {
23 
28 
29 class FTSearch {
30 public:
32  FTSearch(bool verbose=false);
33 
35  virtual ~FTSearch();
36 
41  void init(const FTProp& ftProp);
42  void printToStdOut(const std::string outputString) const;
43  void checkOutputFile(FTProp ftProps);
45 
48  void overrideUtils(std::shared_ptr<IUtils> utils);
49  void overrideWriterBridge(std::shared_ptr<IWriterBridge> writerBridge);
50  void overrideFinder(std::shared_ptr<IFinder> finder);
51  void overrideQueryExtractor(std::shared_ptr<IQueryExtractor> queryExtractor);
53 
54 private:
58  fs::path _readFile;
59 
60  std::map<std::string, uint> _counter;
61 
62  Utils _ownedUtils;
63  IUtils* _utils;
64 
65  WriterBridge _ownedWriterBridge;
66  IWriterBridge* _writerBridge;
67 
68  Finder _ownedFinder;
69  IFinder* _finder;
70 
71  QueryExtractor _ownedQueryExtractor;
72  IQueryExtractor* _queryExtractor;
73 
74  bool _verbose;
76 };
77 }
78 
79 #endif // __FM_SEARCH_H__
80 
ft::WriterBridge
A class that handles writing the results to file.
Definition: writerbridge.h:16
ft::FTSearch::~FTSearch
virtual ~FTSearch()
Class Destructor.
Definition: ftSearch.cpp:100
ft::QueryExtractor
Read and format query file.
Definition: queryextractor.h:18
ft::Finder
A class that handles the main search functions.
Definition: finder.h:19
ft
This namespace contains all the functions to interact with the search.
Definition: directSearch.h:16
ft::FTSearch
A class that handles the flow of a single search.
Definition: ftSearch.h:29
ft::FTProp
A class that contains all the properties for a FlexTyper instance.
Definition: ftPropsClass.h:63
ft::FTSearch::FTSearch
FTSearch(bool verbose=false)
Constructor.
Definition: ftSearch.cpp:10