muParser API -  1.35
Public Member Functions | List of all members
mu::ParserCallback Class Referencefinal

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

#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, EOprtAssociativity a_eAssociativity)
 Constructor for constructing binary operator callbacks. More...
 
 ParserCallback (fun_type2 a_pFun, bool a_bAllowOpti)
 Constructor for constructing function callbacks taking two arguments. More...
 
 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 (fun_type6 a_pFun, bool a_bAllowOpti)
 
 ParserCallback (fun_type7 a_pFun, bool a_bAllowOpti)
 
 ParserCallback (fun_type8 a_pFun, bool a_bAllowOpti)
 
 ParserCallback (fun_type9 a_pFun, bool a_bAllowOpti)
 
 ParserCallback (fun_type10 a_pFun, bool a_bAllowOpti)
 
 ParserCallback (bulkfun_type0 a_pFun, bool a_bAllowOpti)
 
 ParserCallback (bulkfun_type1 a_pFun, bool a_bAllowOpti)
 
 ParserCallback (bulkfun_type2 a_pFun, bool a_bAllowOpti)
 Constructor for constructing function callbacks taking two arguments. More...
 
 ParserCallback (bulkfun_type3 a_pFun, bool a_bAllowOpti)
 
 ParserCallback (bulkfun_type4 a_pFun, bool a_bAllowOpti)
 
 ParserCallback (bulkfun_type5 a_pFun, bool a_bAllowOpti)
 
 ParserCallback (bulkfun_type6 a_pFun, bool a_bAllowOpti)
 
 ParserCallback (bulkfun_type7 a_pFun, bool a_bAllowOpti)
 
 ParserCallback (bulkfun_type8 a_pFun, bool a_bAllowOpti)
 
 ParserCallback (bulkfun_type9 a_pFun, bool a_bAllowOpti)
 
 ParserCallback (bulkfun_type10 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 (strfun_type4 a_pFun, bool a_bAllowOpti)
 
 ParserCallback (strfun_type5 a_pFun, bool a_bAllowOpti)
 
 ParserCallback ()
 Default constructor. More...
 
 ParserCallback (const ParserCallback &a_Fun)
 Copy constructor. More...
 
ParserCallbackoperator= (const ParserCallback &a_Fun)
 
ParserCallbackClone () const
 Clone this instance and return a pointer to the new instance.
 
bool IsOptimizable () const
 Return tru if the function is conservative. More...
 
void * GetAddr () const
 Get the callback address for the parser function. More...
 
ECmdCode GetCode () const
 Return the callback code.
 
ETypeCode GetType () const
 
int GetPri () const
 Return the operator precedence. More...
 
EOprtAssociativity GetAssociativity () const
 Return the operators associativity. More...
 
int GetArgc () const
 Returns the number of function Arguments.
 

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.

Definition at line 52 of file muParserCallback.h.

Constructor & Destructor Documentation

mu::ParserCallback::ParserCallback ( fun_type2  a_pFun,
bool  a_bAllowOpti,
int  a_iPrec,
EOprtAssociativity  a_eOprtAsct 
)

Constructor for constructing binary operator callbacks.

Parameters
a_pFunPointer to a static function taking two arguments
a_bAllowOptiA flag indicating this function can be optimized
a_iPrecThe operator precedence
a_eOprtAsctThe operators associativity
Exceptions
nothrow

Definition at line 87 of file muParserCallback.cpp.

91  :m_pFun((void*)a_pFun)
92  , m_iArgc(2)
93  , m_iPri(a_iPrec)
94  , m_eOprtAsct(a_eOprtAsct)
95  , m_iCode(cmOPRT_BIN)
96  , m_iType(tpDBL)
97  , m_bAllowOpti(a_bAllowOpti)
98  {}
user defined binary operator
Definition: muParserDef.h:174
Floating point variables.
Definition: muParserDef.h:186
mu::ParserCallback::ParserCallback ( fun_type2  a_pFun,
bool  a_bAllowOpti 
)

Constructor for constructing function callbacks taking two arguments.

Exceptions
nothrow

Definition at line 69 of file muParserCallback.cpp.

70  :m_pFun((void*)a_pFun)
71  , m_iArgc(2)
72  , m_iPri(-1)
73  , m_eOprtAsct(oaNONE)
74  , m_iCode(cmFUNC)
75  , m_iType(tpDBL)
76  , m_bAllowOpti(a_bAllowOpti)
77  {}
Code for a generic function item.
Definition: muParserDef.h:170
Floating point variables.
Definition: muParserDef.h:186
mu::ParserCallback::ParserCallback ( bulkfun_type2  a_pFun,
bool  a_bAllowOpti 
)

Constructor for constructing function callbacks taking two arguments.

Exceptions
nothrow

Definition at line 214 of file muParserCallback.cpp.

215  :m_pFun((void*)a_pFun)
216  , m_iArgc(2)
217  , m_iPri(-1)
218  , m_eOprtAsct(oaNONE)
219  , m_iCode(cmFUNC_BULK)
220  , m_iType(tpDBL)
221  , m_bAllowOpti(a_bAllowOpti)
222  {}
Special callbacks for Bulk mode with an additional parameter for the bulk index.
Definition: muParserDef.h:172
Floating point variables.
Definition: muParserDef.h:186
mu::ParserCallback::ParserCallback ( )

Default constructor.

Exceptions
nothrow

Definition at line 382 of file muParserCallback.cpp.

Referenced by Clone().

383  :m_pFun(0)
384  , m_iArgc(0)
385  , m_iPri(-1)
386  , m_eOprtAsct(oaNONE)
387  , m_iCode(cmUNKNOWN)
388  , m_iType(tpVOID)
389  , m_bAllowOpti(0)
390  {}
Undefined type.
Definition: muParserDef.h:187
uninitialized item
Definition: muParserDef.h:178
mu::ParserCallback::ParserCallback ( const ParserCallback ref)

Copy constructor.

Exceptions
nothrow

Definition at line 396 of file muParserCallback.cpp.

397  {
398  m_pFun = ref.m_pFun;
399  m_iArgc = ref.m_iArgc;
400  m_bAllowOpti = ref.m_bAllowOpti;
401  m_iCode = ref.m_iCode;
402  m_iType = ref.m_iType;
403  m_iPri = ref.m_iPri;
404  m_eOprtAsct = ref.m_eOprtAsct;
405  }

Member Function Documentation

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

Definition at line 448 of file muParserCallback.cpp.

Referenced by mu::ParserToken< value_type, string_type >::Set().

449  {
450  return m_pFun;
451  }
EOprtAssociativity mu::ParserCallback::GetAssociativity ( ) const

Return the operators associativity.

Exceptions
nothrownOnly valid if the callback token is a binary operator token.

Definition at line 483 of file muParserCallback.cpp.

484  {
485  return m_eOprtAsct;
486  }
int mu::ParserCallback::GetPri ( ) const

Return the operator precedence.

Exceptions
nothrownOnly valid if the callback token is an operator token (binary or infix).

Definition at line 472 of file muParserCallback.cpp.

473  {
474  return m_iPri;
475  }
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

Definition at line 434 of file muParserCallback.cpp.

435  {
436  return m_bAllowOpti;
437  }

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