OSSIA
Open Scenario System for Interactive Application
math_expression.hpp
1 #pragma once
2 #include <ossia/detail/config.hpp>
3 
4 #include <ossia/network/value/value.hpp>
5 
6 #include <string>
7 #include <vector>
8 
9 namespace ossia
10 {
11 class OSSIA_EXPORT math_expression
12 {
13 public:
14  math_expression();
15  ~math_expression();
16 
17  void add_variable(const std::string& var, double& value);
18  void add_constant(const std::string& var, double& value);
19  void add_vector(const std::string& var, std::vector<double>& value);
20  void remove_vector(const std::string& var);
21  void add_constants();
22  void register_symbol_table();
23  void update_symbol_table();
24 
25  bool set_expression(const std::string& expr);
26  bool recompile();
27 
28  bool has_variable(std::string_view var) const noexcept;
29  std::string error() const;
30 
31  double value();
32 
33  ossia::value result();
34 
35 private:
36  math_expression(const math_expression&) = delete;
37  math_expression(math_expression&&) = delete;
38  math_expression& operator=(const math_expression&) = delete;
39  math_expression& operator=(math_expression&&) = delete;
40 
41  struct impl;
42  impl* impl{};
43 };
44 }
The value class.
Definition: value.hpp:173
Definition: git_info.h:7