...
Code Block |
---|
|
operator ODLSelect(outputMode = "INPUT", minInputPorts = 1, maxInputPorts = 1){
parameter IPredicate predicate;
optional parameter int heartbeatrate;
//...
} |
Note that not every data type can be used for a parameter because each data type must have a corresponding parameter class in Odysseus. The following table shows the available data types:
...
Code Block |
---|
|
operator ODLProject(outputMode ="MODIFIED_INPUT", minInputPorts = 1, maxInputPorts = 1){
parameter(type=ResolvedSDFAttributeParameter) SDFAttribute[] attributes;
//...
} |
Attributes
Besides parameters it is also possible to define attributes to store operator’s data.
Code Block |
---|
|
operator ODLJoin(outputMode = "NEW_ELEMENT", minInputPorts = 2, maxInputPorts = 2){
ITimeIntervalSweepArea[] areas;
IDataMergeFunction dataMerge;
ITransferArea transferFunction;
IMetadataMergeFunction metadataMerge;
//...
} |
Validate methods
Each parameter can have a validate method. This method must return whether the value of the parameter is correct.
Code Block |
---|
|
operator ODLProject(outputMode ="MODIFIED_INPUT", minInputPorts = 1, maxInputPorts = 1){
validate attributes {
if (this.attributes.isEmpty) {
error("attributes have to be set");
return false;
}
return true;
}
//...
} |
There is also a validate method which can be used if a parameter has dependencies to other parameters.
Code Block |
---|
|
operator ODLProject(outputMode ="MODIFIED_INPUT", minInputPorts = 1, maxInputPorts = 1){
validate {
return true;
}
//...
} |