JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
MemoryJoinManager.h
Go to the documentation of this file.
1 //
2 // Created by Nico Schäfer on 02/04/18.
3 //
4 
5 #ifndef JODA_MEMORYJOINMANAGER_H
6 #define JODA_MEMORYJOINMANAGER_H
7 
9 #include <unordered_map>
10 #include "JoinManager.h"
11 #include "MemoryJoinDoc.h"
12 
18  public:
24  MemoryJoinManager(const std::string &name,
25  std::unique_ptr<joda::query::IValueProvider> &&valProv);
26  ~MemoryJoinManager() override;
31  void join(const RapidJsonDocument &doc) override;
32  const std::string &getName() const override;
33 
38  void loadJoin(std::shared_ptr<JSONStorage> &load);
39 
40  protected:
41  std::mutex mut;
43  std::unordered_map<long, JODA_JOINID> lMap; // Integer as long
44  std::unordered_map<std::string, JODA_JOINID> sMap; // String as String
45  bool trueValCreated = false;
46  bool falseValCreated = false;
47  JODA_JOINID getJoinVal(const RJValue &val);
48 
49  std::unordered_map<JODA_JOINID, std::unique_ptr<MemoryJoinDoc>> docs;
50 };
51 
52 #endif // JODA_MEMORYJOINMANAGER_H
unsigned long JODA_JOINID
Definition: JoinManager.h:14
rapidjson::GenericValue< RJChar, RJMemoryPoolAlloc > RJValue
Definition: RJFwd.h:29
Definition: JoinManager.h:19
@ STARTNORMAL_VAL
Definition: JoinManager.h:53
std::string name
Definition: JoinManager.h:55
std::unique_ptr< joda::query::IValueProvider > valProv
Definition: JoinManager.h:56
Definition: MemoryJoinManager.h:17
bool falseValCreated
Definition: MemoryJoinManager.h:46
std::unordered_map< std::string, JODA_JOINID > sMap
Definition: MemoryJoinManager.h:44
std::unordered_map< JODA_JOINID, std::unique_ptr< MemoryJoinDoc > > docs
Definition: MemoryJoinManager.h:49
std::mutex mut
Definition: MemoryJoinManager.h:41
~MemoryJoinManager() override
MemoryJoinManager(const std::string &name, std::unique_ptr< joda::query::IValueProvider > &&valProv)
Definition: MemoryJoinManager.cpp:11
JODA_JOINID currID
Definition: MemoryJoinManager.h:42
std::unordered_map< long, JODA_JOINID > lMap
Definition: MemoryJoinManager.h:43
const std::string & getName() const override
Definition: MemoryJoinManager.cpp:47
void loadJoin(std::shared_ptr< JSONStorage > &load)
Definition: MemoryJoinManager.cpp:119
void join(const RapidJsonDocument &doc) override
Definition: MemoryJoinManager.cpp:18
bool trueValCreated
Definition: MemoryJoinManager.h:45
JODA_JOINID getJoinVal(const RJValue &val)
Definition: MemoryJoinManager.cpp:51
Definition: RapidJsonDocument.h:22