Alida-C++ 0.1
|
Simple demo operator. More...
#include <DemoOperator.h>
Public Member Functions | |
DemoOperator () | |
Default constructor. | |
virtual | ~DemoOperator () |
Default destructor. | |
void | operate () |
Method to implement the operator's functionality. | |
void | validateCustom () |
Operator specific validation of parameters. |
Simple demo operator.
This operator class just demonstrates the built-in functionality of Alida. It declares parameters of several native data types, however, does not perform any serious manipulations on the data.
Definition at line 51 of file DemoOperator.h.
DemoOperator::DemoOperator | ( | ) |
Default constructor.
The constructor of an operator is supposed to take care of proper parameter registration. Using the macro DEFINE_PARAMETER defined in the file of class ALDOperator each parameter that should be visible from outside needs to be declared.
For this operator as a toy example four input parameters of native data types are defined and one output parameter of type double.
Note that each parameter definition is supposed to provide information about
Definition at line 72 of file DemoOperator.cc.
References DEFINE_PARAMETER, Alida::PARAMETER_IN, and Alida::PARAMETER_OUT.
virtual DemoOperator::~DemoOperator | ( | ) | [inline, virtual] |
Default destructor.
Definition at line 59 of file DemoOperator.h.
void DemoOperator::operate | ( | ) | [virtual] |
Method to implement the operator's functionality.
This function implements its abstract counterpart from the operator base class and contains the functional core of this operator.
In this specific example the function does nothing reasonable, but just demonstrates how to access defined input parameters, and how to correctly fill the operator's output parameters.
Implements Alida::ALDOperator.
Definition at line 98 of file DemoOperator.cc.
void DemoOperator::validateCustom | ( | ) | [virtual] |
Operator specific validation of parameters.
Demonstrate custom validation, just require floatval to be non-negativ
Reimplemented from Alida::ALDOperator.
Definition at line 121 of file DemoOperator.cc.