Bridge++  Ver. 1.2.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
evalexpr_symbol.h
Go to the documentation of this file.
1 
13 #ifndef CALC_SYMBOL_H
14 #define CALC_SYMBOL_H
15 
16 #include <map>
17 #include <string>
18 #include "bridgeIO.h"
19 
20 typedef double (*function_t)(double);
21 
23 {
24  private:
25 
27 
28  struct SymbolRecord
29  {
31  union
32  {
33  double val;
35  }
36  value;
37  };
38 
39  typedef std::map<std::string, SymbolRecord> SymbolMap_t;
40 
42 
43  public:
44 
45  bool find_symbol(const std::string& name);
46 
47  bool put_symbol(const std::string& name, const double value);
48  bool put_symbol(const std::string& name, const function_t tptr);
49 
50  double get_symbol_value(const std::string& name) const;
51  function_t get_symbol_function(const std::string& name) const;
52 
53  void dump() const;
54 };
55 #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)
double get_symbol_value(const std::string &name) const
void dump() const
SymbolMap_t table
union SymbolTable::SymbolRecord::@2 value
double(* function_t)(double)
bool find_symbol(const std::string &name)