Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
evalexpr_symbol.h
Go to the documentation of this file.
1 
14 #ifndef EVALEXPR_SYMBOL_INCLUDED
15 #define EVALEXPR_SYMBOL_INCLUDED
16 
17 #include <map>
18 #include <string>
19 #include "IO/bridgeIO.h"
20 
21 typedef double (*function_t)(double);
22 
24 {
25  private:
26 
28 
29  struct SymbolRecord
30  {
32  union
33  {
34  double val;
36  }
37  value;
38  };
39 
40  typedef std::map<std::string, SymbolRecord> SymbolMap_t;
41 
43 
44  public:
45 
46  bool find_symbol(const std::string& name);
47 
48  bool put_symbol(const std::string& name, const double value);
49  bool put_symbol(const std::string& name, const function_t tptr);
50 
51  double get_symbol_value(const std::string& name) const;
52  function_t get_symbol_function(const std::string& name) const;
53 
54  void print() const;
55 };
56 #endif
function_t get_symbol_function(const std::string &name) const
std::map< std::string, SymbolRecord > SymbolMap_t
bool put_symbol(const std::string &name, const double value)
union SymbolTable::SymbolRecord::@1 value
double get_symbol_value(const std::string &name) const
SymbolMap_t table
void print() const
double(* function_t)(double)
bool find_symbol(const std::string &name)