mu::ParserCallback Class Reference

Encapsulation of prototypes for a numerical parser function. More...

#include <muParserCallback.h>

List of all members.

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.
ParserCallbackClone () 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.


Detailed Description

Encapsulation of prototypes for a numerical parser function.

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.

Author:
(C) 2004-2007 Ingo Berg

Constructor & Destructor Documentation

mu::ParserCallback::ParserCallback (  ) 

Default constructor.

Exceptions:
nothrow 

Referenced by Clone().

mu::ParserCallback::ParserCallback ( const ParserCallback a_Fun  ) 

Copy constructor.

Exceptions:
nothrow 

References m_bAllowOpti, m_iArgc, m_iCode, m_iPri, m_iType, and m_pFun.


Member Function Documentation

bool mu::ParserCallback::IsOptimizable (  )  const

Return tru if the function is conservative.

Conservative functions return always the same result for the same argument.

Exceptions:
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.

Exceptions:
nothrow 
Returns:
pFun

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.


Member Data Documentation

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().


The documentation for this class was generated from the following files:

Generated on Sun Jun 22 00:57:25 2008 for muParser by  doxygen 1.5.5