F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
ComSplitter.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------
2 //
3 // ComSplitter.cpp
4 //
5 // ----------------------------------------------------------------------
6 
8 #include <FpConfig.hpp>
9 
10 namespace Svc {
11 
12  // ----------------------------------------------------------------------
13  // Construction, initialization, and destruction
14  // ----------------------------------------------------------------------
15 
17  ComSplitter(const char* compName) :
18  ComSplitterComponentBase(compName)
19  {
20 
21  }
22 
25  {
26 
27  }
28 
30  init(NATIVE_INT_TYPE instance)
31  {
33  }
34 
35  // ----------------------------------------------------------------------
36  // Handler implementations
37  // ----------------------------------------------------------------------
38 
39  void ComSplitter ::
40  comIn_handler(
41  NATIVE_INT_TYPE portNum,
42  Fw::ComBuffer &data,
43  U32 context
44  )
45  {
46  FW_ASSERT(portNum == 0);
47 
49  FW_ASSERT(numPorts > 0);
50 
51  for(NATIVE_INT_TYPE i = 0; i < numPorts; i++) {
53  // Need to make a copy because we are passing by reference!:
54  Fw::ComBuffer dataToSend = data;
55  comOut_out(i, dataToSend, 0);
56  }
57  }
58  }
59 
60 }
#define FW_ASSERT(...)
Definition: Assert.hpp:14
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:51
C++-compatible configuration header for fprime configuration.
void init()
Object initializer.
Definition: ObjBase.cpp:27
Auto-generated base for ComSplitter component.
bool isConnected_comOut_OutputPort(FwIndexType portNum)
void comOut_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port comOut.
ComSplitter(const char *compName)
Definition: ComSplitter.cpp:17