Wraps a particular binary operator.
More...
#include <elambinary.h>
List of all members.
Public Member Functions |
| BinaryOperator (const BinaryOperator &) |
| BinaryOperator () |
| ~BinaryOperator () |
BinaryOperator & | operator= (const BinaryOperator &op) |
| the operator becomes a shared copy of op and abandones its old link
|
void | setCallback (BinaryOperatorCall callback, QString type1, QString type2) |
| sets a callback function for the operator and a specific typ
|
void | setCallback (BinaryOperatorCall callback, int type1, int type2) |
| sets a callback function for the operator and a specific typ
|
BinaryOperatorCall | getCallback (QString type1, QString type2) const |
| returns the callback function attached to the type or NULL if there is none
|
BinaryOperatorCall | getCallback (int type1, int type2) const |
| returns the callback function attached to the type or NULL if there is none
|
void | removeCallback (QString, QString) |
| removes the type from this operators list
|
void | removeCallback (int, int) |
| removes the type from this operators list
|
QList< QPair< QString, QString > > | getTypeNames () const |
| returns all combinations of type names that have a valid callback in this operator
|
QList< QPair< int, int > > | getTypeIds () const |
| returns all combinations of type IDs that have a valid callback in this operator
|
QVariant | execute (const QVariant &, const QVariant &, Engine &) const |
| calls the callback function associated with the type of the argument, throws an exception if there is no callback
|
bool | isNull () const |
| true if this operator has no callbacks
|
Detailed Description
Wraps a particular binary operator.
You can use the methods of this class to change the routines that handle the operator and the types on which it operates. Instances of this class are implicitly shared - meaning calls on a copy of an instance are also visible on the original and all other copies.
Constructor & Destructor Documentation
ELAM::BinaryOperator::BinaryOperator |
( |
|
) |
|
ELAM::BinaryOperator::~BinaryOperator |
( |
|
) |
|
Member Function Documentation
QVariant ELAM::BinaryOperator::execute |
( |
const QVariant & |
, |
|
|
const QVariant & |
, |
|
|
Engine & |
| |
|
) |
| | const |
calls the callback function associated with the type of the argument, throws an exception if there is no callback
BinaryOperatorCall ELAM::BinaryOperator::getCallback |
( |
QString |
type1, |
|
|
QString |
type2 | |
|
) |
| | const |
returns the callback function attached to the type or NULL if there is none
returns the callback function attached to the type or NULL if there is none
QList<QPair<int,int> > ELAM::BinaryOperator::getTypeIds |
( |
|
) |
const |
returns all combinations of type IDs that have a valid callback in this operator
QList<QPair<QString,QString> > ELAM::BinaryOperator::getTypeNames |
( |
|
) |
const |
returns all combinations of type names that have a valid callback in this operator
bool ELAM::BinaryOperator::isNull |
( |
|
) |
const |
true if this operator has no callbacks
the operator becomes a shared copy of op and abandones its old link
void ELAM::BinaryOperator::removeCallback |
( |
int |
, |
|
|
int |
| |
|
) |
| | |
removes the type from this operators list
void ELAM::BinaryOperator::removeCallback |
( |
QString |
, |
|
|
QString |
| |
|
) |
| | |
removes the type from this operators list
void ELAM::BinaryOperator::setCallback |
( |
BinaryOperatorCall |
callback, |
|
|
int |
type1, |
|
|
int |
type2 | |
|
) |
| | |
sets a callback function for the operator and a specific typ
- Parameters:
-
| callback | the function to call, if it is null the type is deleted from this operators type list |
| type | the type of variable to work on, this must be a type registered with QVariant, if this type is already known to the operator its callback is replaced |
void ELAM::BinaryOperator::setCallback |
( |
BinaryOperatorCall |
callback, |
|
|
QString |
type1, |
|
|
QString |
type2 | |
|
) |
| | |
sets a callback function for the operator and a specific typ
- Parameters:
-
| callback | the function to call, if it is null the type is deleted from this operators type list |
| type | the type of variable to work on, this must be a type registered with QVariant, if this type is already known to the operator its callback is replaced |
The documentation for this class was generated from the following file: