Bridge++
Ver. 1.1.x
Main Page
Namespaces
Classes
Files
File List
File Members
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
22
class
SymbolTable
23
{
24
private
:
25
26
enum
ValueType
{
VARIABLE
,
FUNCTION
, };
27
28
struct
SymbolRecord
29
{
30
ValueType
type
;
31
union
32
{
33
double
val
;
34
function_t
fptr
;
35
}
36
value
;
37
};
38
39
typedef
std::map<std::string, SymbolRecord>
SymbolMap_t
;
40
41
SymbolMap_t
table
;
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
src
Tools
evalexpr_symbol.h
Generated on Tue Jul 23 2013 10:48:50 for Bridge++ by
1.8.3.1