#include <muParserCallback.h>
Public Member Functions | |
ParserCallback (fun_type0 a_pFun, bool a_bAllowOpti) | |
ParserCallback (fun_type1 a_pFun, bool a_bAllowOpti, int a_iPrec=-1, ECmdCode a_iCode=cmFUNC) | |
ParserCallback (fun_type2 a_pFun, bool a_bAllowOpti, int a_iPrec=-1, ECmdCode a_iCode=cmFUNC) | |
ParserCallback (fun_type3 a_pFun, bool a_bAllowOpti) | |
ParserCallback (fun_type4 a_pFun, bool a_bAllowOpti) | |
ParserCallback (fun_type5 a_pFun, bool a_bAllowOpti) | |
ParserCallback (multfun_type a_pFun, bool a_bAllowOpti) | |
ParserCallback (strfun_type1 a_pFun, bool a_bAllowOpti) | |
ParserCallback (strfun_type2 a_pFun, bool a_bAllowOpti) | |
ParserCallback (strfun_type3 a_pFun, bool a_bAllowOpti) | |
ParserCallback () | |
Default constructor. | |
ParserCallback (const ParserCallback &a_Fun) | |
Copy constructor. | |
ParserCallback * | Clone () const |
Clone this instance and return a pointer to the new instance. | |
bool | IsOptimizable () const |
Return tru if the function is conservative. | |
void * | GetAddr () const |
Get the callback address for the parser function. | |
ECmdCode | GetCode () const |
Return the callback code. | |
ETypeCode | GetType () const |
int | GetPri () const |
Return the operator priority. | |
int | GetArgc () const |
Returns the number of function Arguments. | |
Private Attributes | |
void * | m_pFun |
Pointer to the callback function, casted to void. | |
int | m_iArgc |
Number of numeric function arguments. | |
int | m_iPri |
Valid only for binary and infix operators; Operator precedence. | |
ECmdCode | m_iCode |
ETypeCode | m_iType |
bool | m_bAllowOpti |
Flag indication optimizeability. |
Encapsulates the prototyp for numerical parser functions. The class stores the number of arguments for parser functions as well as additional flags indication the function is non optimizeable. The pointer to the callback function pointer is stored as void* and needs to be casted according to the argument count. Negative argument counts indicate a parser function with a variable number of arguments. This class is not used for string function prototyping.
mu::ParserCallback::ParserCallback | ( | ) |
mu::ParserCallback::ParserCallback | ( | const ParserCallback & | a_Fun | ) |
bool mu::ParserCallback::IsOptimizable | ( | ) | const |
Return tru if the function is conservative.
Conservative functions return always the same result for the same argument.
nothrow |
References m_bAllowOpti.
void * mu::ParserCallback::GetAddr | ( | ) | const |
Get the callback address for the parser function.
The type of the address is void. It needs to be recasted according to the argument number to the right type.
nothrow |
References m_pFun.
Referenced by mu::ParserBase::AddCallback(), and mu::ParserToken< MUP_BASETYPE, MUP_STRING_TYPE >::Set().
int mu::ParserCallback::GetPri | ( | ) | const |
Return the operator priority.
Only valid if the callback token is an operator token (binary or infix).
References m_iPri.
int mu::ParserCallback::m_iArgc [private] |
Number of numeric function arguments.
This number is negative for functions with variable number of arguments. in this cases they represent the actual number of arguments found.
Referenced by GetArgc(), and ParserCallback().