#include <DataFunc.h>

Reads, parses and interprets human readable Infix functions into a Reverse Polish Notation for execution and performs the operations on data.
Definition at line 47 of file DataFunc.h.
Public Types | |
| enum | status { OK, NONENDING_VAR, UNKNOWN_TAG, UNMATCHED_PARENTHESES, NONENDING_OP, TOO_FEW_VARS, INVALID_SEPARATOR } |
Public Member Functions | |
| CDataFunc () | |
| Initialise CDataFunc. | |
| ~CDataFunc () | |
| Destruct CDataFunc. | |
| status | InfixToRPN (char *input) |
| Converts a infix string into RPN stack. | |
| double | Evaluate (double x, double y, double z, int cols, double coldata[]) |
| Evaluates an RPN stack. | |
Public Attributes | |
| bool | valid |
| Valid function? | |
Private Member Functions | |
| int | FindTagID (char *string) |
| Searches the list of tokens for a particular tag. | |
| status | TestEvaluate (void) |
| Simple evaluation check. | |
Private Attributes | |
| struct CDataFunc::token * | queue |
| RPN token entry. | |
| real * | values |
| List of values. | |
| int | nValues |
| Number of values. | |
| int | nQueue |
| Number of tokens in the list. | |
Static Private Attributes | |
| static op * | ops = NULL |
| The list of useable operators. | |
| static int | nOps = 0 |
| Number of operators. | |
| static int | instances = 0 |
| Instances of this class (for cleanup handling). | |
Classes | |
| struct | op |
| Mathematical operator details. More... | |
| struct | token |
| RPN token entry. More... | |
| enum CDataFunc::status |
| OK | |
| NONENDING_VAR | |
| UNKNOWN_TAG | |
| UNMATCHED_PARENTHESES | |
| NONENDING_OP | |
| TOO_FEW_VARS | |
| INVALID_SEPARATOR |
Definition at line 50 of file DataFunc.h.
| CDataFunc::CDataFunc | ( | ) |
| CDataFunc::~CDataFunc | ( | ) |
| int CDataFunc::FindTagID | ( | char * | string | ) | [private] |
Searches the list of tokens for a particular tag.
| string | Name of the operator to search for. |
Definition at line 146 of file DataFunc.cpp.
Referenced by InfixToRPN().

| CDataFunc::status CDataFunc::TestEvaluate | ( | void | ) | [private] |
Simple evaluation check.
Checks that after evaluation we are just left with the answer on the stack.
Definition at line 681 of file DataFunc.cpp.
References CDataFunc::op::args, nQueue, OK, ops, queue, CDataFunc::token::tagid, TOO_FEW_VARS, and valid.
Referenced by InfixToRPN().

| CDataFunc::status CDataFunc::InfixToRPN | ( | char * | input | ) |
Converts a infix string into RPN stack.
| input | Input equation. |
Definition at line 164 of file DataFunc.cpp.
References FindTagID(), INVALID_SEPARATOR, CDataFunc::op::lassociative, CDataFunc::token::next, NONNUMBER, nQueue, nValues, ops, CDataFunc::op::precedence, CDataFunc::token::prev, queue, CDataFunc::token::tagid, TestEvaluate(), UNKNOWN_TAG, UNMATCHED_PARENTHESES, valid, CDataFunc::token::value, and values.
Referenced by DrawPaletteDialog::cmdUpdateAllData(), and GreyLabWindow::renderObjects().


| double CDataFunc::Evaluate | ( | double | x, | |
| double | y, | |||
| double | z, | |||
| int | cols, | |||
| double | coldata[] | |||
| ) |
Evaluates an RPN stack.
Evaluates the RPN stack in CDataFunc::queue.
| x | X coordinate of the datapoint. | |
| y | Y coordinate of the datapoint. | |
| z | Z value of the datapoint. | |
| cols | Number of columns in coldata. | |
| coldata | Values in the other columns of the datapoint. |
Definition at line 450 of file DataFunc.cpp.
References nQueue, queue, CDataFunc::token::value, and values.
Referenced by GreyLabWindow::cmdDAProcess(), and GreyLabWindow::renderObjects().

CDataFunc::op * CDataFunc::ops = NULL [static, private] |
The list of useable operators.
List of operators.
Definition at line 60 of file DataFunc.h.
Referenced by CDataFunc(), FindTagID(), InfixToRPN(), TestEvaluate(), and ~CDataFunc().
int CDataFunc::nOps = 0 [static, private] |
Number of operators.
Number of operators
Definition at line 61 of file DataFunc.h.
Referenced by CDataFunc(), FindTagID(), and ~CDataFunc().
struct CDataFunc::token * CDataFunc::queue [private] |
RPN token entry.
Linked list of tokens
Referenced by CDataFunc(), Evaluate(), InfixToRPN(), TestEvaluate(), and ~CDataFunc().
int CDataFunc::instances = 0 [static, private] |
Instances of this class (for cleanup handling).
Number of instances of this class.
Definition at line 74 of file DataFunc.h.
Referenced by CDataFunc(), and ~CDataFunc().
1.5.3