Runtime APIs

Primitive operators provide native process functions for input tuples:

void process(Tuple& tuple, unsigned inputPortNumber) {
     //can inspect actual tuple type at runtime
     //can reflectively forward attributes from input to output
}

Process functions can be implemented in either reflective or non-reflective style. To work in non-reflective style, cast the tuple to the specific type:

void process(Tuple& tuple, unsigned inputPortNumber) {
   switch(port) {
     case 0: {
       IPort0Type& p0tuple = static_cast<IPort0Type&>(tuple);
       ...
       break;
     }
     ...
   }
 }
        
The types IPort0Type, IPort1Type, and so on, are defined to be exactly the types of the tuples that can arrive on the input streams. Primitive operators call native submit functions for output tuples:
submit(tuple, outputPortNumber);