MCPcopy Create free account
hub / github.com/RaftLib/RaftLib / Sum

Class Sum

testsuite/allocate.cpp:10–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8
9
10template< typename A, typename B, typename C > class Sum : public raft::kernel
11{
12public:
13 Sum() : raft::kernel()
14 {
15 input.addPort< A >( "input_a" );
16 input.addPort< B >( "input_b" );
17 output.addPort< C >( "sum" );
18 }
19
20 virtual raft::kstatus run()
21 {
22 A a;
23 B b;
24 raft::signal sig_a( raft::none ), sig_b( raft::none );
25 input[ "input_a" ].pop( a, &sig_a );
26 input[ "input_b" ].pop( b, &sig_b );
27 assert( sig_a == sig_b );
28 C c( a + b );
29 output[ "sum" ].push( c , sig_a );
30 if( sig_b == raft::eof )
31 {
32 return( raft::stop );
33 }
34 return( raft::proceed );
35 }
36
37};
38
39
40int

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected