5 #ifndef JODA_FUNCTION_STATE_H
6 #define JODA_FUNCTION_STATE_H
25 template <
typename Input>
28 template <
typename Input>
32 assert(prov !=
nullptr &&
"May not be null");
34 assert(b &&
"State should not be full");
40 template <
typename Input>
43 template <
typename Input>
47 assert(prov !=
nullptr &&
"May not be null");
49 assert(b &&
"State should not be full");
55 template <
typename Input>
58 template <
typename Input>
62 assert(prov !=
nullptr &&
"May not be null");
64 assert(b &&
"State should not be full");
70 template <
typename Input>
73 template <
typename Input>
77 assert(prov !=
nullptr &&
"May not be null");
79 assert(b &&
"State should not be full");
85 template <
typename Input>
88 template <
typename Input>
92 assert(prov !=
nullptr &&
"May not be null");
94 assert(b &&
"State should not be full");
99 template <
typename Input>
102 template <
typename Input>
106 assert(prov !=
nullptr &&
"May not be null");
108 assert(b &&
"State should not be full");
111 inline bool putValProv(std::unique_ptr<joda::query::IValueProvider> &&val) {
112 assert(val !=
nullptr &&
"Should not pass nullptr");
113 if (val ==
nullptr)
return false;
114 params.push_back(std::move(val));
118 template <
typename Input>
119 inline std::unique_ptr<joda::query::IValueProvider>
createFunc(
121 std::unique_ptr<joda::query::IValueProvider> prov =
nullptr;
125 DCHECK(prov !=
nullptr)
126 <<
"prov should not be null, except for thrown parsing exceptions";
128 assert(
params.size() == 1);
129 prov = std::move(
params.front());
132 <<
"There should always be either a atom function or factory";
133 throw tao::pegtl::parse_error(
"Unexpected error during query parsing",
138 throw tao::pegtl::parse_error(e.
what(), in);
144 std::function<std::unique_ptr<joda::query::IValueProvider>(
145 std::vector<std::unique_ptr<joda::query::IValueProvider>> &&)>
147 std::vector<std::unique_ptr<joda::query::IValueProvider>>
params;
Definition: IValueProvider.h:46
virtual const char * what() const
Definition: IValueProvider.h:49
Atom_Value
Definition: Function_State.h:12
@ ATOM_BOOL
Definition: Function_State.h:16
@ ATOM_NUMBER
Definition: Function_State.h:15
@ ATOM_NULL
Definition: Function_State.h:18
@ NO_ATOM
Definition: Function_State.h:13
@ ATOM_POINTER
Definition: Function_State.h:17
@ ATOM_STRING
Definition: Function_State.h:14
Definition: Agg_State.h:24
bool putValProv(std::unique_ptr< joda::query::IValueProvider > &&val)
Definition: Agg_State.h:37
Definition: As_State.h:17
bool putValProv(std::unique_ptr< joda::query::IValueProvider > &&val)
Definition: As_State.h:36
Definition: Choose_State.h:13
bool putValProv(std::unique_ptr< joda::query::IValueProvider > &&val)
Definition: Choose_State.h:42
Definition: Function_State.h:21
void success(const Input &in, loadState &qs)
Definition: Function_State.h:29
std::unique_ptr< joda::query::IValueProvider > createFunc(const Input &in)
Definition: Function_State.h:119
bool putValProv(std::unique_ptr< joda::query::IValueProvider > &&val)
Definition: Function_State.h:111
functionState(const Input &in, storeState &qs)
Definition: Function_State.h:41
Atom_Value atom
Definition: Function_State.h:143
void success(const Input &in, aggState &qs)
Definition: Function_State.h:89
functionState(const Input &in, asState &qs)
Definition: Function_State.h:71
void success(const Input &in, asState &qs)
Definition: Function_State.h:74
void success(const Input &in, storeState &qs)
Definition: Function_State.h:44
void success(const Input &in, functionState &qs)
Definition: Function_State.h:103
std::function< std::unique_ptr< joda::query::IValueProvider > std::vector< std::unique_ptr< joda::query::IValueProvider > > &&)> factory
Definition: Function_State.h:146
functionState(const Input &in, chooseState &qs)
Definition: Function_State.h:56
std::vector< std::unique_ptr< joda::query::IValueProvider > > params
Definition: Function_State.h:147
void success(const Input &in, chooseState &qs)
Definition: Function_State.h:59
functionState(const Input &in, functionState &qs)
Definition: Function_State.h:100
functionState(const Input &in, aggState &qs)
Definition: Function_State.h:86
functionState(const Input &in, loadState &qs)
Definition: Function_State.h:26
Definition: Load_State.h:23
bool putValProv(std::unique_ptr< joda::query::IValueProvider > &&val)
Definition: Load_State.h:39
Definition: Store_State.h:11
bool putValProv(std::unique_ptr< joda::query::IValueProvider > &&val)
Definition: Store_State.h:23