F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
ComSplitterComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title ComSplitterComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for ComSplitter component base class
5 // ======================================================================
6 
7 #ifndef Svc_ComSplitterComponentAc_HPP
8 #define Svc_ComSplitterComponentAc_HPP
9 
10 #include "Fw/Com/ComPortAc.hpp"
12 #include "Fw/FPrimeBasicTypes.hpp"
15 
16 namespace Svc {
17 
24  {
25 
26  // ----------------------------------------------------------------------
27  // Friend classes
28  // ----------------------------------------------------------------------
29 
31  friend class ComSplitterTesterBase;
33  friend class ComSplitterTester;
34 
35  protected:
36 
37  // ----------------------------------------------------------------------
38  // Constants
39  // ----------------------------------------------------------------------
40 
42  enum {
44  };
45 
47  enum {
49  };
50 
51  public:
52 
53  // ----------------------------------------------------------------------
54  // Component initialization
55  // ----------------------------------------------------------------------
56 
58  void init(
59  FwEnumStoreType instance = 0
60  );
61 
62  public:
63 
64  // ----------------------------------------------------------------------
65  // Getters for typed input ports
66  // ----------------------------------------------------------------------
67 
72  FwIndexType portNum
73  );
74 
75  public:
76 
77  // ----------------------------------------------------------------------
78  // Connect typed input ports to typed output ports
79  // ----------------------------------------------------------------------
80 
83  FwIndexType portNum,
84  Fw::InputComPort* port
85  );
86 
87 #if FW_PORT_SERIALIZATION
88 
89  public:
90 
91  // ----------------------------------------------------------------------
92  // Connect serial input ports to typed output ports
93  // ----------------------------------------------------------------------
94 
97  FwIndexType portNum,
98  Fw::InputSerializePort* port
99  );
100 
101 #endif
102 
103  protected:
104 
105  // ----------------------------------------------------------------------
106  // Component construction and destruction
107  // ----------------------------------------------------------------------
108 
111  const char* compName = ""
112  );
113 
115  virtual ~ComSplitterComponentBase();
116 
117  protected:
118 
119  // ----------------------------------------------------------------------
120  // Getters for numbers of typed input ports
121  // ----------------------------------------------------------------------
122 
127  return NUM_COMIN_INPUT_PORTS;
128  }
129 
130  protected:
131 
132  // ----------------------------------------------------------------------
133  // Getters for numbers of typed output ports
134  // ----------------------------------------------------------------------
135 
141  }
142 
143  protected:
144 
145  // ----------------------------------------------------------------------
146  // Connection status queries for typed output ports
147  // ----------------------------------------------------------------------
148 
153  FwIndexType portNum
154  );
155 
156  protected:
157 
158  // ----------------------------------------------------------------------
159  // Handlers to implement for typed input ports
160  // ----------------------------------------------------------------------
161 
163  virtual void comIn_handler(
164  FwIndexType portNum,
165  Fw::ComBuffer& data,
166  U32 context
167  ) = 0;
168 
169  protected:
170 
171  // ----------------------------------------------------------------------
172  // Port handler base-class functions for typed input ports
173  //
174  // Call these functions directly to bypass the corresponding ports
175  // ----------------------------------------------------------------------
176 
178  void comIn_handlerBase(
179  FwIndexType portNum,
180  Fw::ComBuffer& data,
181  U32 context
182  );
183 
184  protected:
185 
186  // ----------------------------------------------------------------------
187  // Invocation functions for typed output ports
188  // ----------------------------------------------------------------------
189 
191  void comOut_out(
192  FwIndexType portNum,
193  Fw::ComBuffer& data,
194  U32 context
195  );
196 
197  private:
198 
199  // ----------------------------------------------------------------------
200  // Calls for messages received on typed input ports
201  // ----------------------------------------------------------------------
202 
204  static void m_p_comIn_in(
205  Fw::PassiveComponentBase* callComp,
206  FwIndexType portNum,
207  Fw::ComBuffer& data,
208  U32 context
209  );
210 
211  private:
212 
213  // ----------------------------------------------------------------------
214  // Typed input ports
215  // ----------------------------------------------------------------------
216 
218  Fw::InputComPort m_comIn_InputPort[NUM_COMIN_INPUT_PORTS];
219 
220  private:
221 
222  // ----------------------------------------------------------------------
223  // Typed output ports
224  // ----------------------------------------------------------------------
225 
227  Fw::OutputComPort m_comOut_OutputPort[NUM_COMOUT_OUTPUT_PORTS];
228 
229  };
230 
231 }
232 
233 #endif
bool isConnected_comOut_OutputPort(FwIndexType portNum)
Fw::InputComPort * get_comIn_InputPort(FwIndexType portNum)
I32 FwEnumStoreType
virtual ~ComSplitterComponentBase()
Destroy ComSplitterComponentBase object.
void init()
Object initializer.
Definition: ObjBase.cpp:24
void comIn_handlerBase(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Handler base-class function for input port comIn.
friend class ComSplitterTesterBase
Friend class tester to support autocoded test harness.
Auto-generated base for ComSplitter component.
PlatformIndexType FwIndexType
void comOut_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port comOut.
friend class ComSplitterTester
Friend class tester implementation to support white-box testing.
RateGroupDivider component implementation.
static constexpr FwIndexType getNum_comOut_OutputPorts()
static constexpr FwIndexType getNum_comIn_InputPorts()
void set_comOut_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to comOut[portNum].
virtual void comIn_handler(FwIndexType portNum, Fw::ComBuffer &data, U32 context)=0
Handler for input port comIn.
ComSplitterComponentBase(const char *compName="")
Construct ComSplitterComponentBase object.