Wraps a particular unary operator. More...
#include <elamunary.h>
Public Member Functions | |
| UnaryOperator (const UnaryOperator &) | |
| copy constructor, the instance will access the exact same operator as the original, any setting that is done in the copy is also done in the original and all other copies. | |
| UnaryOperator () | |
| instantiates an empty operator | |
| ~UnaryOperator () | |
| deletes and operator | |
| UnaryOperator & | operator= (const UnaryOperator &op) |
| the operator becomes a shared copy of op and abandones its old link | |
| void | setCallback (UnaryOperatorCall callback, QString type) |
| sets a callback function for the operator and a specific typ | |
| void | setCallback (UnaryOperatorCall callback, int type) |
| sets a callback function for the operator and a specific typ | |
| UnaryOperatorCall | getCallback (QString type) const |
| returns the callback function attached to the type or NULL if there is none | |
| UnaryOperatorCall | getCallback (int type) const |
| returns the callback function attached to the type or NULL if there is none | |
| void | removeCallback (QString) |
| removes the type from this operators list | |
| void | removeCallback (int) |
| removes the type from this operators list | |
| QStringList | getTypeNames () const |
| returns all type names that have a valid callback in this operator | |
| QList< int > | getTypeIds () const |
| returns all type IDs that have a valid callback in this operator | |
| QVariant | execute (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 | |
Wraps a particular unary 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.
| ELAM::UnaryOperator::UnaryOperator | ( | const UnaryOperator & | ) |
copy constructor, the instance will access the exact same operator as the original, any setting that is done in the copy is also done in the original and all other copies.
| ELAM::UnaryOperator::UnaryOperator | ( | ) |
instantiates an empty operator
| ELAM::UnaryOperator::~UnaryOperator | ( | ) |
deletes and operator
| QVariant ELAM::UnaryOperator::execute | ( | const QVariant & | , | |
| Engine & | ||||
| ) | const |
calls the callback function associated with the type of the argument, throws an exception if there is no callback
| UnaryOperatorCall ELAM::UnaryOperator::getCallback | ( | QString | type | ) | const |
returns the callback function attached to the type or NULL if there is none
| UnaryOperatorCall ELAM::UnaryOperator::getCallback | ( | int | type | ) | const |
returns the callback function attached to the type or NULL if there is none
| QList<int> ELAM::UnaryOperator::getTypeIds | ( | ) | const |
returns all type IDs that have a valid callback in this operator
| QStringList ELAM::UnaryOperator::getTypeNames | ( | ) | const |
returns all type names that have a valid callback in this operator
| bool ELAM::UnaryOperator::isNull | ( | ) | const |
true if this operator has no callbacks
| UnaryOperator& ELAM::UnaryOperator::operator= | ( | const UnaryOperator & | op | ) |
the operator becomes a shared copy of op and abandones its old link
| void ELAM::UnaryOperator::removeCallback | ( | int | ) |
removes the type from this operators list
| void ELAM::UnaryOperator::removeCallback | ( | QString | ) |
removes the type from this operators list
| void ELAM::UnaryOperator::setCallback | ( | UnaryOperatorCall | callback, | |
| int | type | |||
| ) |
sets a callback function for the operator and a specific typ
| 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::UnaryOperator::setCallback | ( | UnaryOperatorCall | callback, | |
| QString | type | |||
| ) |
sets a callback function for the operator and a specific typ
| 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 |
1.7.1