Pothos  0.4.1-gb758ed46
The Pothos dataflow programming software suite
EvalEnvironment.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 #include <Pothos/Object.hpp>
13 #include <string>
14 #include <vector>
15 #include <memory>
16 
17 namespace Pothos {
18 namespace Util {
19 
26 {
27 public:
28 
33  static std::shared_ptr<EvalEnvironment> make(void);
34 
40  EvalEnvironment(void);
41 
48  Pothos::Object eval(const std::string &expression);
49 
54  void registerConstantExpr(const std::string &key, const std::string &expr);
55 
59  void registerConstantObj(const std::string &key, const Pothos::Object &obj);
60 
64  void unregisterConstant(const std::string &key);
65 
66 private:
67  struct Impl; std::shared_ptr<Impl> _impl;
68 
73  static std::vector<std::string> splitExpr(const std::string &expr, const char tokenizer = '\0');
74 
75  Pothos::Object _evalList(const std::string &expr);
76  Pothos::Object _evalMap(const std::string &expr);
77 };
78 
79 } //namespace Util
80 } //namespace Pothos
Definition: EvalEnvironment.hpp:25
#define POTHOS_API
Definition: Config.hpp:41
Definition: Testing.hpp:134
Definition: Object.hpp:55