Seamly2D
Code documentation
qmu::QmuParserCallback Class Reference

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

#include <qmuparsercallback.h>

Collaboration diagram for qmu::QmuParserCallback:

Public Member Functions

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

Constructor & Destructor Documentation

◆ QmuParserCallback() [1/29]

qmu::QmuParserCallback::QmuParserCallback ( fun_type0  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 36 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [2/29]

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

Definition at line 45 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [3/29]

qmu::QmuParserCallback::QmuParserCallback ( 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 funcation can be optimized
a_iPrecThe operator precedence
a_eOprtAsctThe operators associativity
Exceptions
nothrow

Definition at line 75 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [4/29]

qmu::QmuParserCallback::QmuParserCallback ( fun_type2  a_pFun,
bool  a_bAllowOpti 
)

Constructor for constructing funcstion callbacks taking two arguments.

Exceptions
nothrow

Definition at line 58 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [5/29]

qmu::QmuParserCallback::QmuParserCallback ( fun_type3  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 84 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [6/29]

qmu::QmuParserCallback::QmuParserCallback ( fun_type4  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 94 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [7/29]

qmu::QmuParserCallback::QmuParserCallback ( fun_type5  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 104 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [8/29]

qmu::QmuParserCallback::QmuParserCallback ( fun_type6  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 113 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [9/29]

qmu::QmuParserCallback::QmuParserCallback ( fun_type7  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 122 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [10/29]

qmu::QmuParserCallback::QmuParserCallback ( fun_type8  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 131 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [11/29]

qmu::QmuParserCallback::QmuParserCallback ( fun_type9  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 140 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [12/29]

qmu::QmuParserCallback::QmuParserCallback ( fun_type10  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 149 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [13/29]

qmu::QmuParserCallback::QmuParserCallback ( bulkfun_type0  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 158 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [14/29]

qmu::QmuParserCallback::QmuParserCallback ( bulkfun_type1  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 167 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [15/29]

qmu::QmuParserCallback::QmuParserCallback ( bulkfun_type2  a_pFun,
bool  a_bAllowOpti 
)

Constructor for constructing funcstion callbacks taking two arguments.

Exceptions
nothrow

Definition at line 180 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [16/29]

qmu::QmuParserCallback::QmuParserCallback ( bulkfun_type3  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 189 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [17/29]

qmu::QmuParserCallback::QmuParserCallback ( bulkfun_type4  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 198 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [18/29]

qmu::QmuParserCallback::QmuParserCallback ( bulkfun_type5  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 207 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [19/29]

qmu::QmuParserCallback::QmuParserCallback ( bulkfun_type6  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 216 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [20/29]

qmu::QmuParserCallback::QmuParserCallback ( bulkfun_type7  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 225 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [21/29]

qmu::QmuParserCallback::QmuParserCallback ( bulkfun_type8  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 234 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [22/29]

qmu::QmuParserCallback::QmuParserCallback ( bulkfun_type9  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 243 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [23/29]

qmu::QmuParserCallback::QmuParserCallback ( bulkfun_type10  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 252 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [24/29]

qmu::QmuParserCallback::QmuParserCallback ( multfun_type  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 261 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [25/29]

qmu::QmuParserCallback::QmuParserCallback ( strfun_type1  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 270 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [26/29]

qmu::QmuParserCallback::QmuParserCallback ( strfun_type2  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 279 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [27/29]

qmu::QmuParserCallback::QmuParserCallback ( strfun_type3  a_pFun,
bool  a_bAllowOpti 
)

Definition at line 288 of file qmuparsercallback.cpp.

◆ QmuParserCallback() [28/29]

qmu::QmuParserCallback::QmuParserCallback ( )

Default constructor.

Exceptions
nothrow

Definition at line 298 of file qmuparsercallback.cpp.

Referenced by Clone().

◆ QmuParserCallback() [29/29]

qmu::QmuParserCallback::QmuParserCallback ( const QmuParserCallback a_Fun)

Copy constructor.

Exceptions
nothrow

Definition at line 308 of file qmuparsercallback.cpp.

Member Function Documentation

◆ Clone()

QmuParserCallback * qmu::QmuParserCallback::Clone ( ) const
inline

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

Definition at line 121 of file qmuparsercallback.h.

References QmuParserCallback().

◆ GetAddr()

void * qmu::QmuParserCallback::GetAddr ( ) const
inline

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 148 of file qmuparsercallback.h.

References m_pFun.

Referenced by qmu::QmuParserBase::AddCallback(), and qmu::QmuParserToken< TBase, TString >::Set().

◆ GetArgc()

int qmu::QmuParserCallback::GetArgc ( ) const
inline

Returns the number of function Arguments.

Definition at line 196 of file qmuparsercallback.h.

References m_iArgc.

◆ GetAssociativity()

EOprtAssociativity qmu::QmuParserCallback::GetAssociativity ( ) const
inline

Return the operators associativity.

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

Definition at line 187 of file qmuparsercallback.h.

References m_eOprtAsct.

◆ GetCode()

ECmdCode qmu::QmuParserCallback::GetCode ( ) const
inline

Return the callback code.

Definition at line 157 of file qmuparsercallback.h.

References m_iCode.

Referenced by qmu::QmuParserBase::CheckOprt(), and qmu::QmuParserToken< TBase, TString >::Set().

◆ GetPri()

int qmu::QmuParserCallback::GetPri ( ) const
inline

Return the operator precedence.

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

Definition at line 175 of file qmuparsercallback.h.

References m_iPri.

◆ GetType()

ETypeCode qmu::QmuParserCallback::GetType ( ) const
inline

Definition at line 163 of file qmuparsercallback.h.

References m_iType.

◆ IsOptimizable()

bool qmu::QmuParserCallback::IsOptimizable ( ) const
inline

Return true if the function is conservative.

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

Exceptions
nothrow

Definition at line 134 of file qmuparsercallback.h.

References m_bAllowOpti.

◆ operator=()

QmuParserCallback & qmu::QmuParserCallback::operator= ( const QmuParserCallback a_Fun)

Definition at line 314 of file qmuparsercallback.cpp.

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

Member Data Documentation

◆ m_bAllowOpti

bool qmu::QmuParserCallback::m_bAllowOpti
private

Flag indication optimizeability.

Definition at line 108 of file qmuparsercallback.h.

Referenced by IsOptimizable(), and operator=().

◆ m_eOprtAsct

EOprtAssociativity qmu::QmuParserCallback::m_eOprtAsct
private

Operator associativity; Valid only for binary operators.

Definition at line 105 of file qmuparsercallback.h.

Referenced by GetAssociativity(), and operator=().

◆ m_iArgc

int qmu::QmuParserCallback::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 qmuparsercallback.h.

Referenced by GetArgc(), and operator=().

◆ m_iCode

ECmdCode qmu::QmuParserCallback::m_iCode
private

Definition at line 106 of file qmuparsercallback.h.

Referenced by GetCode(), and operator=().

◆ m_iPri

int qmu::QmuParserCallback::m_iPri
private

Valid only for binary and infix operators; Operator precedence.

Definition at line 104 of file qmuparsercallback.h.

Referenced by GetPri(), and operator=().

◆ m_iType

ETypeCode qmu::QmuParserCallback::m_iType
private

Definition at line 107 of file qmuparsercallback.h.

Referenced by GetType(), and operator=().

◆ m_pFun

void* qmu::QmuParserCallback::m_pFun
private

Pointer to the callback function, casted to void.

Definition at line 95 of file qmuparsercallback.h.

Referenced by GetAddr(), and operator=().


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