highlighter application  1.1
HCE project utils : highlighter
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
ContentsStorageBase.hpp
Go to the documentation of this file.
1 
13 #ifndef CONTENTS_STORAGE_BASE_HPP
14 #define CONTENTS_STORAGE_BASE_HPP
15 
16 #include <Poco/Condition.h>
17 #include <Poco/Mutex.h>
18 #include <Poco/SharedPtr.h>
19 
20 #include <vector>
21 
22 #include "CRC64.h"
23 #include "CWords.hpp"
24 #include "InDataRefine.hpp"
25 #include "OutDataRefine.hpp"
26 #include "Refine.hpp"
27 #include "WordPos.hpp"
28 
30 {
31  public:
32  typedef Poco::SharedPtr<HCE::component::Refine> RefinePtrType;
33 // typedef Poco::SharedPtr<std::map<unsigned long long, std::vector<WordPos> > > WordPosPtrType;
34  typedef Poco::SharedPtr<std::vector<std::map<unsigned long long, std::vector<WordPos> > > > WordPosPtrType;
35  private:
36  Poco::FastMutex componentMutex;
37  Poco::FastMutex refinesVectorMutex;
38  Poco::Condition conditionVar;
39  std::vector<std::pair<RefinePtrType, bool > > refinesVector;
40  protected:
42  void refineRelease(RefinePtrType &refinePtr);
43  public:
44  ContentsStorageBase(unsigned int refinesCount);
45  virtual WordPosPtrType wordMapExctract(unsigned long long key, std::string &incomeContent/*, unsigned char normalization, unsigned char subjectMask*/) = 0;
46  virtual void wordMapRelease(unsigned long long key, WordPosPtrType &refinePtr) = 0;
47  virtual ~ContentsStorageBase();
48 };
49 
50 #endif