ELAM
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
ELAM::UnaryOperator Class Reference

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. More...
 
 UnaryOperator ()
 instantiates an empty operator More...
 
 ~UnaryOperator ()
 deletes and operator More...
 
UnaryOperatoroperator= (const UnaryOperator &op)
 the operator becomes a shared copy of op and abandones its old link More...
 
void setCallback (UnaryOperatorCall callback, QString type)
 sets a callback function for the operator and a specific typ More...
 
void setCallback (UnaryOperatorCall callback, int type)
 sets a callback function for the operator and a specific typ More...
 
UnaryOperatorCall getCallback (QString type) const
 returns the callback function attached to the type or NULL if there is none More...
 
UnaryOperatorCall getCallback (int type) const
 returns the callback function attached to the type or NULL if there is none More...
 
void removeCallback (QString)
 removes the type from this operators list More...
 
void removeCallback (int)
 removes the type from this operators list More...
 
QStringList getTypeNames () const
 returns all type names that have a valid callback in this operator More...
 
QList< int > getTypeIds () const
 returns all type IDs that have a valid callback in this operator More...
 
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 More...
 
bool isNull () const
 true if this operator has no callbacks More...
 

Detailed Description

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.

Constructor & Destructor Documentation

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

Member Function Documentation

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 ( QString  )

removes the type from this operators list

void ELAM::UnaryOperator::removeCallback ( int  )

removes the type from this operators list

void ELAM::UnaryOperator::setCallback ( UnaryOperatorCall  callback,
QString  type 
)

sets a callback function for the operator and a specific typ

Parameters
callbackthe function to call, if it is null the type is deleted from this operators type list
typethe 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,
int  type 
)

sets a callback function for the operator and a specific typ

Parameters
callbackthe function to call, if it is null the type is deleted from this operators type list
typethe 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: