F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ComSplitter.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------
2 //
3 // ComSplitter.cpp
4 //
5 // ----------------------------------------------------------------------
6 
9 
10 namespace Svc {
11 
12 // ----------------------------------------------------------------------
13 // Construction, initialization, and destruction
14 // ----------------------------------------------------------------------
15 
16 ComSplitter ::ComSplitter(const char* compName) : ComSplitterComponentBase(compName) {}
17 
19 
20 // ----------------------------------------------------------------------
21 // Handler implementations
22 // ----------------------------------------------------------------------
23 
24 void ComSplitter ::comIn_handler(FwIndexType portNum, Fw::ComBuffer& data, U32 context) {
25  FW_ASSERT(portNum == 0);
26 
28  FW_ASSERT(numPorts > 0);
29 
30  for (FwIndexType i = 0; i < numPorts; i++) {
32  // Need to make a copy because we are passing by reference!:
33  Fw::ComBuffer dataToSend = data;
34  comOut_out(i, dataToSend, 0);
35  }
36  }
37 }
38 
39 } // namespace Svc
bool isConnected_comOut_OutputPort(FwIndexType portNum)
ComSplitter(const char *compName)
Definition: ComSplitter.cpp:16
Auto-generated base for ComSplitter component.
PlatformIndexType FwIndexType
void comOut_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port comOut.
RateGroupDivider component implementation.
#define FW_ASSERT(...)
Definition: Assert.hpp:14