JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
Store_Actions.h
Go to the documentation of this file.
1 //
2 // Created by Nico on 08/05/2019.
3 //
4 
5 #ifndef JODA_STORE_ACTIONS_H
6 #define JODA_STORE_ACTIONS_H
7 
8 #include "../grammar/Grammar.h"
9 #include "../states/States.h"
10 
12 #include <joda/export/FileExport.h>
13 #include <joda/export/JoinExport.h>
16 
17 template <>
19  template <typename Input>
20  static void apply(const Input &in, storeState &state) {
21  state.exportDest = std::make_unique<StorageExport>(
22  StorageCollection::getInstance().getOrAddStorage(in.string()));
23  }
24 };
25 
26 template <>
28  template <typename Input>
29  static void apply(const Input &in, storeState &state) {
30  std::string pointer = in.string();
31  state.putValProv(std::make_unique<joda::query::PointerProvider>(
32  pointer.substr(1, pointer.size() - 2)));
33  state.exportDest = std::make_unique<JoinExport>(
34  StorageCollection::getInstance().getOrStartJoin(
35  std::make_unique<joda::query::PointerProvider>(
36  pointer.substr(1, pointer.size() - 2))));
37  }
38 };
39 template <>
41  template <typename Input>
42  static void apply(const Input &in, storeState &state) {
43  state.exportDest = std::make_unique<FileExport>(in.string());
44  }
45 };
46 
47 template <>
49  template <typename Input>
50  static void apply(const Input &in, storeState &state) {
51  state.exportDest = std::make_unique<DirectoryExport>(in.string());
52  }
53 };
54 
55 } // namespace joda::queryparsing::grammar
56 #endif // JODA_STORE_ACTIONS_H
static StorageCollection & getInstance()
Definition: StorageCollection.h:32
Definition: Literals.h:27
static void apply(const Input &in, storeState &state)
Definition: Store_Actions.h:29
static void apply(const Input &in, storeState &state)
Definition: Store_Actions.h:42
static void apply(const Input &in, storeState &state)
Definition: Store_Actions.h:50
static void apply(const Input &in, storeState &state)
Definition: Store_Actions.h:20
Definition: Store_State.h:11
std::unique_ptr< IExportDestination > exportDest
Definition: Store_State.h:35
bool putValProv(std::unique_ptr< joda::query::IValueProvider > &&val)
Definition: Store_State.h:23