NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
mu::ParserCallback Class Reference

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

#include <muParserCallback.h>

Collaboration diagram for mu::ParserCallback:

Public Member Functions

 ParserCallback (fun_type0 a_pFun, bool optimizeAway)
 
 ParserCallback (fun_type1 a_pFun, bool optimizeAway, int a_iPrec=-1, ECmdCode a_iCode=cmFUNC)
 
 ParserCallback (fun_type2 a_pFun, bool optimizeAway, int a_iPrec, EOprtAssociativity a_eAssociativity)
 Constructor for constructing binary operator callbacks. More...
 
 ParserCallback (fun_type2 a_pFun, bool optimizeAway)
 Constructor for constructing funcstion callbacks taking two arguments. More...
 
 ParserCallback (fun_type3 a_pFun, bool optimizeAway)
 
 ParserCallback (fun_type4 a_pFun, bool optimizeAway)
 
 ParserCallback (fun_type5 a_pFun, bool optimizeAway)
 
 ParserCallback (fun_type6 a_pFun, bool optimizeAway)
 
 ParserCallback (fun_type7 a_pFun, bool optimizeAway)
 
 ParserCallback (fun_type8 a_pFun, bool optimizeAway)
 
 ParserCallback (fun_type9 a_pFun, bool optimizeAway)
 
 ParserCallback (fun_type10 a_pFun, bool optimizeAway)
 
 ParserCallback (bulkfun_type0 a_pFun, bool optimizeAway)
 
 ParserCallback (bulkfun_type1 a_pFun, bool optimizeAway)
 
 ParserCallback (bulkfun_type2 a_pFun, bool optimizeAway)
 Constructor for constructing funcstion callbacks taking two arguments. More...
 
 ParserCallback (bulkfun_type3 a_pFun, bool optimizeAway)
 
 ParserCallback (bulkfun_type4 a_pFun, bool optimizeAway)
 
 ParserCallback (bulkfun_type5 a_pFun, bool optimizeAway)
 
 ParserCallback (bulkfun_type6 a_pFun, bool optimizeAway)
 
 ParserCallback (bulkfun_type7 a_pFun, bool optimizeAway)
 
 ParserCallback (bulkfun_type8 a_pFun, bool optimizeAway)
 
 ParserCallback (bulkfun_type9 a_pFun, bool optimizeAway)
 
 ParserCallback (bulkfun_type10 a_pFun, bool optimizeAway)
 
 ParserCallback (multfun_type a_pFun, bool optimizeAway)
 
 ParserCallback (strfun_type1 a_pFun, bool optimizeAway)
 
 ParserCallback (strfun_type2 a_pFun, bool optimizeAway)
 
 ParserCallback (strfun_type3 a_pFun, bool optimizeAway)
 
 ParserCallback ()
 Default constructor. More...
 
 ParserCallback (const ParserCallback &a_Fun)
 Copy constructor. More...
 
ParserCallbackClone () const
 Clone this instance and return a pointer to the new instance. More...
 
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. More...
 
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. More...
 

Private Attributes

void * m_pFun
 Pointer to the callback function, casted to void. More...
 
int m_iArgc
 Number of numeric function arguments. More...
 
int m_iPri
 Valid only for binary and infix operators; Operator precedence. More...
 
EOprtAssociativity m_eOprtAsct
 Operator associativity; Valid only for binary operators. More...
 
ECmdCode m_iCode
 
ETypeCode m_iType
 
bool m_bAllowOpti
 Flag indication optimizeability. More...
 

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.

Author
(C) 2004-2011 Ingo Berg

Definition at line 50 of file muParserCallback.h.

Constructor & Destructor Documentation

◆ ParserCallback() [1/29]

mu::ParserCallback::ParserCallback ( fun_type0  a_pFun,
bool  optimizeAway 
)

Definition at line 36 of file muParserCallback.cpp.

◆ ParserCallback() [2/29]

mu::ParserCallback::ParserCallback ( fun_type1  a_pFun,
bool  optimizeAway,
int  a_iPrec = -1,
ECmdCode  a_iCode = cmFUNC 
)

Definition at line 47 of file muParserCallback.cpp.

◆ ParserCallback() [3/29]

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

Constructor for constructing binary operator callbacks.

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

Definition at line 80 of file muParserCallback.cpp.

◆ ParserCallback() [4/29]

mu::ParserCallback::ParserCallback ( fun_type2  a_pFun,
bool  optimizeAway 
)

Constructor for constructing funcstion callbacks taking two arguments.

Exceptions
nothrow

Definition at line 62 of file muParserCallback.cpp.

◆ ParserCallback() [5/29]

mu::ParserCallback::ParserCallback ( fun_type3  a_pFun,
bool  optimizeAway 
)

Definition at line 94 of file muParserCallback.cpp.

◆ ParserCallback() [6/29]

mu::ParserCallback::ParserCallback ( fun_type4  a_pFun,
bool  optimizeAway 
)

Definition at line 106 of file muParserCallback.cpp.

◆ ParserCallback() [7/29]

mu::ParserCallback::ParserCallback ( fun_type5  a_pFun,
bool  optimizeAway 
)

Definition at line 118 of file muParserCallback.cpp.

◆ ParserCallback() [8/29]

mu::ParserCallback::ParserCallback ( fun_type6  a_pFun,
bool  optimizeAway 
)

Definition at line 129 of file muParserCallback.cpp.

◆ ParserCallback() [9/29]

mu::ParserCallback::ParserCallback ( fun_type7  a_pFun,
bool  optimizeAway 
)

Definition at line 140 of file muParserCallback.cpp.

◆ ParserCallback() [10/29]

mu::ParserCallback::ParserCallback ( fun_type8  a_pFun,
bool  optimizeAway 
)

Definition at line 151 of file muParserCallback.cpp.

◆ ParserCallback() [11/29]

mu::ParserCallback::ParserCallback ( fun_type9  a_pFun,
bool  optimizeAway 
)

Definition at line 162 of file muParserCallback.cpp.

◆ ParserCallback() [12/29]

mu::ParserCallback::ParserCallback ( fun_type10  a_pFun,
bool  optimizeAway 
)

Definition at line 173 of file muParserCallback.cpp.

◆ ParserCallback() [13/29]

mu::ParserCallback::ParserCallback ( bulkfun_type0  a_pFun,
bool  optimizeAway 
)

Definition at line 184 of file muParserCallback.cpp.

◆ ParserCallback() [14/29]

mu::ParserCallback::ParserCallback ( bulkfun_type1  a_pFun,
bool  optimizeAway 
)

Definition at line 195 of file muParserCallback.cpp.

◆ ParserCallback() [15/29]

mu::ParserCallback::ParserCallback ( bulkfun_type2  a_pFun,
bool  optimizeAway 
)

Constructor for constructing funcstion callbacks taking two arguments.

Exceptions
nothrow

Definition at line 210 of file muParserCallback.cpp.

◆ ParserCallback() [16/29]

mu::ParserCallback::ParserCallback ( bulkfun_type3  a_pFun,
bool  optimizeAway 
)

Definition at line 221 of file muParserCallback.cpp.

◆ ParserCallback() [17/29]

mu::ParserCallback::ParserCallback ( bulkfun_type4  a_pFun,
bool  optimizeAway 
)

Definition at line 233 of file muParserCallback.cpp.

◆ ParserCallback() [18/29]

mu::ParserCallback::ParserCallback ( bulkfun_type5  a_pFun,
bool  optimizeAway 
)

Definition at line 245 of file muParserCallback.cpp.

◆ ParserCallback() [19/29]

mu::ParserCallback::ParserCallback ( bulkfun_type6  a_pFun,
bool  optimizeAway 
)

Definition at line 256 of file muParserCallback.cpp.

◆ ParserCallback() [20/29]

mu::ParserCallback::ParserCallback ( bulkfun_type7  a_pFun,
bool  optimizeAway 
)

Definition at line 267 of file muParserCallback.cpp.

◆ ParserCallback() [21/29]

mu::ParserCallback::ParserCallback ( bulkfun_type8  a_pFun,
bool  optimizeAway 
)

Definition at line 278 of file muParserCallback.cpp.

◆ ParserCallback() [22/29]

mu::ParserCallback::ParserCallback ( bulkfun_type9  a_pFun,
bool  optimizeAway 
)

Definition at line 289 of file muParserCallback.cpp.

◆ ParserCallback() [23/29]

mu::ParserCallback::ParserCallback ( bulkfun_type10  a_pFun,
bool  optimizeAway 
)

Definition at line 300 of file muParserCallback.cpp.

◆ ParserCallback() [24/29]

mu::ParserCallback::ParserCallback ( multfun_type  a_pFun,
bool  optimizeAway 
)

Definition at line 312 of file muParserCallback.cpp.

◆ ParserCallback() [25/29]

mu::ParserCallback::ParserCallback ( strfun_type1  a_pFun,
bool  optimizeAway 
)

Definition at line 324 of file muParserCallback.cpp.

◆ ParserCallback() [26/29]

mu::ParserCallback::ParserCallback ( strfun_type2  a_pFun,
bool  optimizeAway 
)

Definition at line 336 of file muParserCallback.cpp.

◆ ParserCallback() [27/29]

mu::ParserCallback::ParserCallback ( strfun_type3  a_pFun,
bool  optimizeAway 
)

Definition at line 348 of file muParserCallback.cpp.

◆ ParserCallback() [28/29]

mu::ParserCallback::ParserCallback ( )

Default constructor.

Exceptions
nothrow

Definition at line 363 of file muParserCallback.cpp.

Referenced by Clone().

◆ ParserCallback() [29/29]

mu::ParserCallback::ParserCallback ( const ParserCallback ref)

Copy constructor.

Exceptions
nothrow

Definition at line 378 of file muParserCallback.cpp.

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

Member Function Documentation

◆ Clone()

ParserCallback * mu::ParserCallback::Clone ( ) const

Clone this instance and return a pointer to the new instance.

Definition at line 391 of file muParserCallback.cpp.

References ParserCallback().

Here is the call graph for this function:

◆ GetAddr()

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 416 of file muParserCallback.cpp.

References m_pFun.

Referenced by mu::ParserBase::AddCallback(), mu::ParserBase::evaluateTemporaryVectors(), and mu::ParserToken< TBase, TString >::Set().

◆ GetArgc()

int mu::ParserCallback::GetArgc ( ) const

Returns the number of function Arguments.

Definition at line 459 of file muParserCallback.cpp.

References m_iArgc.

◆ GetAssociativity()

EOprtAssociativity mu::ParserCallback::GetAssociativity ( ) const

Return the operators associativity.

Exceptions
nothrown

Only valid if the callback token is a binary operator token.

Definition at line 452 of file muParserCallback.cpp.

References m_eOprtAsct.

◆ GetCode()

ECmdCode mu::ParserCallback::GetCode ( ) const

Return the callback code.

Definition at line 423 of file muParserCallback.cpp.

References m_iCode.

Referenced by mu::ParserBase::CheckOprt(), and mu::ParserToken< TBase, TString >::Set().

◆ GetPri()

int mu::ParserCallback::GetPri ( ) const

Return the operator precedence.

Exceptions
nothrown

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

Definition at line 441 of file muParserCallback.cpp.

References m_iPri.

◆ GetType()

ETypeCode mu::ParserCallback::GetType ( ) const

Definition at line 429 of file muParserCallback.cpp.

References m_iType.

◆ IsOptimizable()

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 402 of file muParserCallback.cpp.

References m_bAllowOpti.

Member Data Documentation

◆ m_bAllowOpti

bool mu::ParserCallback::m_bAllowOpti
private

Flag indication optimizeability.

Definition at line 108 of file muParserCallback.h.

Referenced by IsOptimizable(), and ParserCallback().

◆ m_eOprtAsct

EOprtAssociativity mu::ParserCallback::m_eOprtAsct
private

Operator associativity; Valid only for binary operators.

Definition at line 105 of file muParserCallback.h.

Referenced by GetAssociativity(), and ParserCallback().

◆ m_iArgc

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.

Definition at line 103 of file muParserCallback.h.

Referenced by GetArgc(), and ParserCallback().

◆ m_iCode

ECmdCode mu::ParserCallback::m_iCode
private

Definition at line 106 of file muParserCallback.h.

Referenced by GetCode(), and ParserCallback().

◆ m_iPri

int mu::ParserCallback::m_iPri
private

Valid only for binary and infix operators; Operator precedence.

Definition at line 104 of file muParserCallback.h.

Referenced by GetPri(), and ParserCallback().

◆ m_iType

ETypeCode mu::ParserCallback::m_iType
private

Definition at line 107 of file muParserCallback.h.

Referenced by GetType(), and ParserCallback().

◆ m_pFun

void* mu::ParserCallback::m_pFun
private

Pointer to the callback function, casted to void.

Definition at line 96 of file muParserCallback.h.

Referenced by GetAddr(), and ParserCallback().


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