| 22 | output.template addPort< T >( "sum" ); |
| 23 | } |
| 24 | virtual raft::kstatus run() |
| 25 | { |
| 26 | T a,b; |
| 27 | input[ "input_a" ].pop( a ); |
| 28 | input[ "input_b" ].pop( b ); |
| 29 | /** allocate mem directly on queue **/ |
| 30 | auto c( output[ "sum" ].template allocate_s< T >() ); |
| 31 | (*c) = a + b; |
| 32 | /** mem automatically freed upon scope exit **/ |
| 33 | return( raft::proceed ); |
| 34 | } |
| 35 | |
| 36 | }; |
| 37 |