28 enum FindQuerySelection {
36 FindQuery(
const std::string &expr_string,
const std::string &scope_string);
38 std::string serializeBooleanExpression()
const;
39 std::string serializeScope()
const;
41 void deserializeBooleanExpression(
const std::string &expr_string);
42 void deserializeScope(
const std::string &scope_string);
44 FuzzyValue evaluate(
NodeData &data,
bool all_information_present,
const uint64_t ×tamp_now);
45 std::vector<NodeData::Key> evaluateMissingAttributes(
NodeData &data,
46 uint64_t
const ×tamp_now)
const;
47 std::vector<NodeData::Key> getRelevantAttributes()
const;
48 std::vector<NodeData::Key> getRelevantTopicAttributes()
const;
50 FindQueryScope getScope()
const;
51 void setScope(
const FindQueryScope &scope);
53 std::shared_ptr<BooleanExpression> getBooleanExpression()
const;
54 void setBooleanExpression(std::shared_ptr<BooleanExpression> expr);
56 void setRequestingNode(
const NodeInfo &requesting_node);
59 uint64_t getValidityThreshold()
const;
60 void setValidityThreshold(
const uint64_t &validity_threshold);
62 bool getInquireUnknownAttributes()
const;
63 void setInquireUnknownAttributes(
bool inquire_unknown_attributes);
65 bool getInquireOutdatedAttributes()
const;
66 void setInquireOutdatedAttributes(
bool inquire_outdated_attributes);
68 bool getPermissive()
const;
69 void setPermissive(
bool permissive);
71 FindQuerySelection getSelection()
const;
72 void setSelection(
const FindQuerySelection &selection);
74 std::vector<NodeData::Key> getSelectedAttributeKeys()
const;
75 void setSelectedAttributeKeys(
const std::vector<NodeData::Key> &keys);
77 template <
class Archive>
void save(Archive &archive)
const {
79 throw std::runtime_error(
"Expression in FindQuery is empty!");
81 archive(validity_threshold_, serializeBooleanExpression(), scope_, requesting_node_,
82 inquire_unknown_attributes_, inquire_outdated_attributes_, permissive_, selection_,
83 selected_attribute_keys_);
86 template <
class Archive>
void load(Archive &archive) {
87 std::string expr_string;
88 archive(validity_threshold_, expr_string, scope_, requesting_node_, inquire_unknown_attributes_,
89 inquire_outdated_attributes_, permissive_, selection_, selected_attribute_keys_);
90 deserializeBooleanExpression(expr_string);
95 const uint64_t ×tamp_now)
const;
98 std::shared_ptr<BooleanExpression> expr_;
101 FindQueryScope scope_ = FindQuery::FindQueryScope::kAll;
107 uint64_t validity_threshold_ = 0;
111 bool inquire_unknown_attributes_;
116 bool inquire_outdated_attributes_;
120 FindQuerySelection selection_;
123 std::vector<NodeData::Key> selected_attribute_keys_;