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"
14 #if !FW_DIRECT_PORT_CALLS
16 #endif
17 #if !FW_DIRECT_PORT_CALLS
19 #endif
20 
21 namespace Svc {
22 
29  {
30 
31  // ----------------------------------------------------------------------
32  // Friend classes
33  // ----------------------------------------------------------------------
34 
36  friend class CmdSplitterTesterBase;
38  friend class CmdSplitterTester;
39 
40  protected:
41 
42  // ----------------------------------------------------------------------
43  // Constants
44  // ----------------------------------------------------------------------
45 
47  enum {
50  };
51 
53  enum {
57  };
58 
59  public:
60 
61  // ----------------------------------------------------------------------
62  // Component initialization
63  // ----------------------------------------------------------------------
64 
66  void init(
67  FwEnumStoreType instance = 0
68  );
69 
70 #if !FW_DIRECT_PORT_CALLS
71 
72  public:
73 
74  // ----------------------------------------------------------------------
75  // Getters for typed input ports
76  // ----------------------------------------------------------------------
77 
82  FwIndexType portNum
83  );
84 
89  FwIndexType portNum
90  );
91 
92 #endif
93 
94 #if !FW_DIRECT_PORT_CALLS
95 
96  public:
97 
98  // ----------------------------------------------------------------------
99  // Connect typed input ports to typed output ports
100  // ----------------------------------------------------------------------
101 
104  FwIndexType portNum,
105  Fw::InputComPort* port
106  );
107 
110  FwIndexType portNum,
111  Fw::InputComPort* port
112  );
113 
116  FwIndexType portNum,
118  );
119 
120 #endif
121 
122 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
123 
124  public:
125 
126  // ----------------------------------------------------------------------
127  // Connect serial input ports to typed output ports
128  // ----------------------------------------------------------------------
129 
132  FwIndexType portNum,
133  Fw::InputSerializePort* port
134  );
135 
138  FwIndexType portNum,
139  Fw::InputSerializePort* port
140  );
141 
144  FwIndexType portNum,
145  Fw::InputSerializePort* port
146  );
147 
148 #endif
149 
150  protected:
151 
152  // ----------------------------------------------------------------------
153  // Component construction and destruction
154  // ----------------------------------------------------------------------
155 
158  const char* compName = ""
159  );
160 
162  virtual ~CmdSplitterComponentBase();
163 
164  protected:
165 
166  // ----------------------------------------------------------------------
167  // Getters for numbers of typed input ports
168  // ----------------------------------------------------------------------
169 
175  }
176 
182  }
183 
184  protected:
185 
186  // ----------------------------------------------------------------------
187  // Getters for numbers of typed output ports
188  // ----------------------------------------------------------------------
189 
195  }
196 
202  }
203 
209  }
210 
211  protected:
212 
213  // ----------------------------------------------------------------------
214  // Connection status queries for typed output ports
215  // ----------------------------------------------------------------------
216 
221  FwIndexType portNum
222  ) const;
223 
228  FwIndexType portNum
229  ) const;
230 
235  FwIndexType portNum
236  ) const;
237 
238  protected:
239 
240  // ----------------------------------------------------------------------
241  // Handlers to implement for typed input ports
242  // ----------------------------------------------------------------------
243 
245  virtual void CmdBuff_handler(
246  FwIndexType portNum,
247  Fw::ComBuffer& data,
248  U32 context
249  ) = 0;
250 
252  virtual void seqCmdStatus_handler(
253  FwIndexType portNum,
254  FwOpcodeType opCode,
255  U32 cmdSeq,
256  const Fw::CmdResponse& response
257  ) = 0;
258 
259 #if FW_DIRECT_PORT_CALLS
260  public:
261 #else
262  protected:
263 #endif
264 
265  // ----------------------------------------------------------------------
266  // Port handler base-class functions for typed input ports
267  //
268  // Call these functions directly to bypass the corresponding ports
269  // ----------------------------------------------------------------------
270 
272  void CmdBuff_handlerBase(
273  FwIndexType portNum,
274  Fw::ComBuffer& data,
275  U32 context
276  );
277 
280  FwIndexType portNum,
281  FwOpcodeType opCode,
282  U32 cmdSeq,
283  const Fw::CmdResponse& response
284  );
285 
286  protected:
287 
288  // ----------------------------------------------------------------------
289  // Invocation functions for typed output ports
290  // ----------------------------------------------------------------------
291 
293  void LocalCmd_out(
294  FwIndexType portNum,
295  Fw::ComBuffer& data,
296  U32 context
297  ) const;
298 
300  void RemoteCmd_out(
301  FwIndexType portNum,
302  Fw::ComBuffer& data,
303  U32 context
304  ) const;
305 
308  FwIndexType portNum,
309  FwOpcodeType opCode,
310  U32 cmdSeq,
311  const Fw::CmdResponse& response
312  ) const;
313 
314  private:
315 
316  // ----------------------------------------------------------------------
317  // Calls for messages received on typed input ports
318  // ----------------------------------------------------------------------
319 
321  static void m_p_CmdBuff_in(
322  Fw::PassiveComponentBase* callComp,
323  FwIndexType portNum,
324  Fw::ComBuffer& data,
325  U32 context
326  );
327 
329  static void m_p_seqCmdStatus_in(
330  Fw::PassiveComponentBase* callComp,
331  FwIndexType portNum,
332  FwOpcodeType opCode,
333  U32 cmdSeq,
334  const Fw::CmdResponse& response
335  );
336 
337 #if !FW_DIRECT_PORT_CALLS
338 
339  private:
340 
341  // ----------------------------------------------------------------------
342  // Typed input ports
343  // ----------------------------------------------------------------------
344 
346  Fw::InputComPort m_CmdBuff_InputPort[NUM_CMDBUFF_INPUT_PORTS];
347 
349  Fw::InputCmdResponsePort m_seqCmdStatus_InputPort[NUM_SEQCMDSTATUS_INPUT_PORTS];
350 
351 #endif
352 
353 #if !FW_DIRECT_PORT_CALLS
354 
355  private:
356 
357  // ----------------------------------------------------------------------
358  // Typed output ports
359  // ----------------------------------------------------------------------
360 
362  Fw::OutputComPort m_LocalCmd_OutputPort[NUM_LOCALCMD_OUTPUT_PORTS];
363 
365  Fw::OutputComPort m_RemoteCmd_OutputPort[NUM_REMOTECMD_OUTPUT_PORTS];
366 
368  Fw::OutputCmdResponsePort m_forwardSeqCmdStatus_OutputPort[NUM_FORWARDSEQCMDSTATUS_OUTPUT_PORTS];
369 
370 #endif
371 
372  };
373 
374 }
375 
376 #endif
FwIdType FwOpcodeType
The type of a command opcode.
I32 FwEnumStoreType
Fw::InputCmdResponsePort * get_seqCmdStatus_InputPort(FwIndexType portNum)
CmdSplitterComponentBase(const char *compName="")
Construct CmdSplitterComponentBase object.
Enum representing a command response.
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.
bool isConnected_forwardSeqCmdStatus_OutputPort(FwIndexType portNum) const
void forwardSeqCmdStatus_out(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
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.
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)
bool isConnected_LocalCmd_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_CmdBuff_InputPorts()
void set_forwardSeqCmdStatus_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to forwardSeqCmdStatus[portNum].
void RemoteCmd_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context) const
Invoke output port RemoteCmd.
PlatformIndexType FwIndexType
void LocalCmd_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context) const
Invoke output port LocalCmd.
RateGroupDivider component implementation.
friend class CmdSplitterTester
Friend class tester implementation to support white-box testing.
bool isConnected_RemoteCmd_OutputPort(FwIndexType portNum) const
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()