JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
Store_State.h
Go to the documentation of this file.
1 //
2 // Created by Nico on 08/05/2019.
3 //
4 
5 #ifndef JODA_STORE_STATE_H
6 #define JODA_STORE_STATE_H
7 
9 #include "Query_State.h"
11 struct storeState {
12  template <typename Input>
13  inline storeState(const Input &in, queryState &qs) {}
14 
15  template <typename Input>
16  inline void success(const Input &in, queryState &qs) {
17  // Set LoadJoinManager
18  qs.q->setStoreJoinManager(StorageCollection::getInstance().getOrStartJoin(
19  std::move(groupvalprov)));
20  qs.q->setExportDestination(std::move(exportDest));
21  }
22 
23  inline bool putValProv(std::unique_ptr<joda::query::IValueProvider> &&val) {
24  DCHECK(val != nullptr && "Should not pass nullptr");
25  if (val == nullptr) return false;
26  if (groupvalprov == nullptr) {
27  groupvalprov = std::move(val);
28  return true;
29  }
30  DCHECK(false) << "Should not be full";
31  return false;
32  }
33 
34  std::unique_ptr<joda::query::IValueProvider> groupvalprov;
35  std::unique_ptr<IExportDestination> exportDest;
36 };
37 } // namespace joda::queryparsing::grammar
38 #endif // JODA_STORE_STATE_H
static StorageCollection & getInstance()
Definition: StorageCollection.h:32
Definition: Query_State.h:21
std::shared_ptr< joda::query::Query > q
Definition: Query_State.h:33
Definition: Store_State.h:11
std::unique_ptr< joda::query::IValueProvider > groupvalprov
Definition: Store_State.h:34
storeState(const Input &in, queryState &qs)
Definition: Store_State.h:13
std::unique_ptr< IExportDestination > exportDest
Definition: Store_State.h:35
bool putValProv(std::unique_ptr< joda::query::IValueProvider > &&val)
Definition: Store_State.h:23
void success(const Input &in, queryState &qs)
Definition: Store_State.h:16