Public Member Functions

ELAM::UnaryOperator Class Reference

Wraps a particular unary operator. More...

#include <elamunary.h>

List of all members.

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
UnaryOperatoroperator= (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

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

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::UnaryOperator::setCallback ( UnaryOperatorCall  callback,
QString  type 
)

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:
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Friends