5 #ifndef JODA_CHOOSE_STATE_H
6 #define JODA_CHOOSE_STATE_H
14 template <
typename Input>
19 template <
typename Input>
21 assert(
valProv.first ==
nullptr);
22 assert(
valProv.second ==
nullptr);
25 std::unique_ptr<joda::query::Predicate> pred =
26 std::make_unique<joda::query::ValToPredicate>(
true);
27 qs.
q->setPredicate(std::move(pred));
31 if (
preds.top().second.empty()) {
32 std::unique_ptr<joda::query::Predicate> t =
33 std::make_unique<joda::query::ValToPredicate>(
true);
34 preds.top().second.push_back(std::move(t));
36 assert(
preds.top().second.size() == 1);
37 std::unique_ptr<joda::query::Predicate> tmp =
38 std::move(
preds.top().second[0]);
39 qs.
q->setPredicate(std::move(tmp));
42 inline bool putValProv(std::unique_ptr<joda::query::IValueProvider> &&val) {
43 assert(val !=
nullptr &&
"Should not pass nullptr");
44 if (val ==
nullptr)
return false;
49 if (
valProv.second ==
nullptr) {
50 valProv.second = std::move(val);
53 assert(
false &&
"Should not be full");
58 std::pair<std::unique_ptr<joda::query::IValueProvider>,
59 std::unique_ptr<joda::query::IValueProvider>>
Comparison
Definition: Query_State.h:38
@ NONE
Definition: Query_State.h:38
std::stack< std::pair< stackMod, std::vector< std::unique_ptr< joda::query::Predicate > > > > predStack
Definition: Query_State.h:43
Definition: Choose_State.h:13
chooseState(const Input &in, queryState &qs)
Definition: Choose_State.h:15
Comparison comp
Definition: Choose_State.h:61
void success(const Input &in, queryState &qs)
Definition: Choose_State.h:20
std::string ptr
Definition: Choose_State.h:62
std::pair< std::unique_ptr< joda::query::IValueProvider >, std::unique_ptr< joda::query::IValueProvider > > valProv
Definition: Choose_State.h:60
bool putValProv(std::unique_ptr< joda::query::IValueProvider > &&val)
Definition: Choose_State.h:42
predStack preds
Definition: Choose_State.h:57
Definition: Query_State.h:21
std::shared_ptr< joda::query::Query > q
Definition: Query_State.h:33