F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
CmdSplitterComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title CmdSplitterComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for CmdSplitter component base class
5 // ======================================================================
6 
7 #ifndef Svc_CmdSplitterComponentAc_HPP
8 #define Svc_CmdSplitterComponentAc_HPP
9 
11 #include "Fw/Com/ComPortAc.hpp"
13 #include "Fw/FPrimeBasicTypes.hpp"
16 
17 namespace Svc {
18 
25  {
26 
27  // ----------------------------------------------------------------------
28  // Friend classes
29  // ----------------------------------------------------------------------
30 
32  friend class CmdSplitterTesterBase;
34  friend class CmdSplitterTester;
35 
36  protected:
37 
38  // ----------------------------------------------------------------------
39  // Constants
40  // ----------------------------------------------------------------------
41 
43  enum {
46  };
47 
49  enum {
53  };
54 
55  public:
56 
57  // ----------------------------------------------------------------------
58  // Component initialization
59  // ----------------------------------------------------------------------
60 
62  void init(
63  FwEnumStoreType instance = 0
64  );
65 
66  public:
67 
68  // ----------------------------------------------------------------------
69  // Getters for typed input ports
70  // ----------------------------------------------------------------------
71 
76  FwIndexType portNum
77  );
78 
83  FwIndexType portNum
84  );
85 
86  public:
87 
88  // ----------------------------------------------------------------------
89  // Connect typed input ports to typed output ports
90  // ----------------------------------------------------------------------
91 
94  FwIndexType portNum,
95  Fw::InputComPort* port
96  );
97 
100  FwIndexType portNum,
101  Fw::InputComPort* port
102  );
103 
106  FwIndexType portNum,
108  );
109 
110 #if FW_PORT_SERIALIZATION
111 
112  public:
113 
114  // ----------------------------------------------------------------------
115  // Connect serial input ports to typed output ports
116  // ----------------------------------------------------------------------
117 
120  FwIndexType portNum,
121  Fw::InputSerializePort* port
122  );
123 
126  FwIndexType portNum,
127  Fw::InputSerializePort* port
128  );
129 
132  FwIndexType portNum,
133  Fw::InputSerializePort* port
134  );
135 
136 #endif
137 
138  protected:
139 
140  // ----------------------------------------------------------------------
141  // Component construction and destruction
142  // ----------------------------------------------------------------------
143 
146  const char* compName = ""
147  );
148 
150  virtual ~CmdSplitterComponentBase();
151 
152  protected:
153 
154  // ----------------------------------------------------------------------
155  // Getters for numbers of typed input ports
156  // ----------------------------------------------------------------------
157 
163  }
164 
170  }
171 
172  protected:
173 
174  // ----------------------------------------------------------------------
175  // Getters for numbers of typed output ports
176  // ----------------------------------------------------------------------
177 
183  }
184 
190  }
191 
197  }
198 
199  protected:
200 
201  // ----------------------------------------------------------------------
202  // Connection status queries for typed output ports
203  // ----------------------------------------------------------------------
204 
209  FwIndexType portNum
210  );
211 
216  FwIndexType portNum
217  );
218 
223  FwIndexType portNum
224  );
225 
226  protected:
227 
228  // ----------------------------------------------------------------------
229  // Handlers to implement for typed input ports
230  // ----------------------------------------------------------------------
231 
233  virtual void CmdBuff_handler(
234  FwIndexType portNum,
235  Fw::ComBuffer& data,
236  U32 context
237  ) = 0;
238 
240  virtual void seqCmdStatus_handler(
241  FwIndexType portNum,
242  FwOpcodeType opCode,
243  U32 cmdSeq,
244  const Fw::CmdResponse& response
245  ) = 0;
246 
247  protected:
248 
249  // ----------------------------------------------------------------------
250  // Port handler base-class functions for typed input ports
251  //
252  // Call these functions directly to bypass the corresponding ports
253  // ----------------------------------------------------------------------
254 
256  void CmdBuff_handlerBase(
257  FwIndexType portNum,
258  Fw::ComBuffer& data,
259  U32 context
260  );
261 
264  FwIndexType portNum,
265  FwOpcodeType opCode,
266  U32 cmdSeq,
267  const Fw::CmdResponse& response
268  );
269 
270  protected:
271 
272  // ----------------------------------------------------------------------
273  // Invocation functions for typed output ports
274  // ----------------------------------------------------------------------
275 
277  void LocalCmd_out(
278  FwIndexType portNum,
279  Fw::ComBuffer& data,
280  U32 context
281  );
282 
284  void RemoteCmd_out(
285  FwIndexType portNum,
286  Fw::ComBuffer& data,
287  U32 context
288  );
289 
292  FwIndexType portNum,
293  FwOpcodeType opCode,
294  U32 cmdSeq,
295  const Fw::CmdResponse& response
296  );
297 
298  private:
299 
300  // ----------------------------------------------------------------------
301  // Calls for messages received on typed input ports
302  // ----------------------------------------------------------------------
303 
305  static void m_p_CmdBuff_in(
306  Fw::PassiveComponentBase* callComp,
307  FwIndexType portNum,
308  Fw::ComBuffer& data,
309  U32 context
310  );
311 
313  static void m_p_seqCmdStatus_in(
314  Fw::PassiveComponentBase* callComp,
315  FwIndexType portNum,
316  FwOpcodeType opCode,
317  U32 cmdSeq,
318  const Fw::CmdResponse& response
319  );
320 
321  private:
322 
323  // ----------------------------------------------------------------------
324  // Typed input ports
325  // ----------------------------------------------------------------------
326 
328  Fw::InputComPort m_CmdBuff_InputPort[NUM_CMDBUFF_INPUT_PORTS];
329 
331  Fw::InputCmdResponsePort m_seqCmdStatus_InputPort[NUM_SEQCMDSTATUS_INPUT_PORTS];
332 
333  private:
334 
335  // ----------------------------------------------------------------------
336  // Typed output ports
337  // ----------------------------------------------------------------------
338 
340  Fw::OutputComPort m_LocalCmd_OutputPort[NUM_LOCALCMD_OUTPUT_PORTS];
341 
343  Fw::OutputComPort m_RemoteCmd_OutputPort[NUM_REMOTECMD_OUTPUT_PORTS];
344 
346  Fw::OutputCmdResponsePort m_forwardSeqCmdStatus_OutputPort[NUM_FORWARDSEQCMDSTATUS_OUTPUT_PORTS];
347 
348  };
349 
350 }
351 
352 #endif
FwIdType FwOpcodeType
The type of a command opcode.
I32 FwEnumStoreType
void LocalCmd_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port LocalCmd.
bool isConnected_forwardSeqCmdStatus_OutputPort(FwIndexType portNum)
Fw::InputCmdResponsePort * get_seqCmdStatus_InputPort(FwIndexType portNum)
CmdSplitterComponentBase(const char *compName="")
Construct CmdSplitterComponentBase object.
Enum representing a command response.
bool isConnected_LocalCmd_OutputPort(FwIndexType portNum)
virtual ~CmdSplitterComponentBase()
Destroy CmdSplitterComponentBase object.
static constexpr FwIndexType getNum_RemoteCmd_OutputPorts()
static constexpr FwIndexType getNum_forwardSeqCmdStatus_OutputPorts()
virtual void CmdBuff_handler(FwIndexType portNum, Fw::ComBuffer &data, U32 context)=0
Handler for input port CmdBuff.
void forwardSeqCmdStatus_out(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Invoke output port forwardSeqCmdStatus.
void init()
Object initializer.
Definition: ObjBase.cpp:24
void set_LocalCmd_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to LocalCmd[portNum].
void set_RemoteCmd_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to RemoteCmd[portNum].
Auto-generated base for CmdSplitter component.
friend class CmdSplitterTesterBase
Friend class tester to support autocoded test harness.
bool isConnected_RemoteCmd_OutputPort(FwIndexType portNum)
void CmdBuff_handlerBase(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Handler base-class function for input port CmdBuff.
static constexpr FwIndexType getNum_seqCmdStatus_InputPorts()
Fw::InputComPort * get_CmdBuff_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_CmdBuff_InputPorts()
void set_forwardSeqCmdStatus_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to forwardSeqCmdStatus[portNum].
PlatformIndexType FwIndexType
void RemoteCmd_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port RemoteCmd.
RateGroupDivider component implementation.
friend class CmdSplitterTester
Friend class tester implementation to support white-box testing.
virtual void seqCmdStatus_handler(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)=0
Handler for input port seqCmdStatus.
void seqCmdStatus_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Handler base-class function for input port seqCmdStatus.
static constexpr FwIndexType getNum_LocalCmd_OutputPorts()