NCBI C++ ToolKit
Public Member Functions | Private Attributes | List of all members
mu::ParserCallback Class Reference

Search Toolkit Book for mu::ParserCallback

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

#include <gui/utils/muparser/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. 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 priority. 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...
 
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. This class is not used for string function prototyping.

Author
(C) 2004-2007 Ingo Berg

Definition at line 51 of file muParserCallback.h.

Constructor & Destructor Documentation

◆ ParserCallback() [1/12]

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

Definition at line 36 of file muParserCallback.cpp.

◆ ParserCallback() [2/12]

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

Definition at line 46 of file muParserCallback.cpp.

◆ ParserCallback() [3/12]

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

Definition at line 57 of file muParserCallback.cpp.

◆ ParserCallback() [4/12]

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

Definition at line 68 of file muParserCallback.cpp.

◆ ParserCallback() [5/12]

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

Definition at line 79 of file muParserCallback.cpp.

◆ ParserCallback() [6/12]

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

Definition at line 90 of file muParserCallback.cpp.

◆ ParserCallback() [7/12]

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

Definition at line 101 of file muParserCallback.cpp.

◆ ParserCallback() [8/12]

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

Definition at line 112 of file muParserCallback.cpp.

◆ ParserCallback() [9/12]

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

Definition at line 123 of file muParserCallback.cpp.

◆ ParserCallback() [10/12]

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

Definition at line 134 of file muParserCallback.cpp.

◆ ParserCallback() [11/12]

mu::ParserCallback::ParserCallback ( )

Default constructor.

Exceptions
nothrow

Definition at line 149 of file muParserCallback.cpp.

Referenced by Clone().

◆ ParserCallback() [12/12]

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

Copy constructor.

Exceptions
nothrow

Definition at line 163 of file muParserCallback.cpp.

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

Member Function Documentation

◆ Clone()

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

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

Definition at line 176 of file muParserCallback.cpp.

References ParserCallback().

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

References m_pFun.

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

◆ GetArgc()

int mu::ParserCallback::GetArgc ( ) const

Returns the number of function Arguments.

Definition at line 237 of file muParserCallback.cpp.

References m_iArgc.

◆ GetCode()

ECmdCode mu::ParserCallback::GetCode ( void  ) const

Return the callback code.

Definition at line 211 of file muParserCallback.cpp.

References m_iCode.

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

◆ GetPri()

int mu::ParserCallback::GetPri ( ) const

Return the operator priority.

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

Definition at line 229 of file muParserCallback.cpp.

References m_iPri.

◆ GetType()

ETypeCode mu::ParserCallback::GetType ( void  ) const

Definition at line 218 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 188 of file muParserCallback.cpp.

References m_bAllowOpti.

Member Data Documentation

◆ m_bAllowOpti

bool mu::ParserCallback::m_bAllowOpti
private

Flag indication optimizeability.

Definition at line 88 of file muParserCallback.h.

Referenced by IsOptimizable(), 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 84 of file muParserCallback.h.

Referenced by GetArgc(), and ParserCallback().

◆ m_iCode

ECmdCode mu::ParserCallback::m_iCode
private

Definition at line 86 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 85 of file muParserCallback.h.

Referenced by GetPri(), and ParserCallback().

◆ m_iType

ETypeCode mu::ParserCallback::m_iType
private

Definition at line 87 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 77 of file muParserCallback.h.

Referenced by GetAddr(), and ParserCallback().


The documentation for this class was generated from the following files:
Modified on Sat Apr 13 11:50:33 2024 by modify_doxy.py rev. 669887