F´ Flight Software - C/C++ Documentation  devel
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 
10 #include "FpConfig.hpp"
12 #include "Fw/Com/ComPortAc.hpp"
16 
17 namespace Svc {
18 
25  {
26 
27  // ----------------------------------------------------------------------
28  // Friend classes
29  // ----------------------------------------------------------------------
30 
33 
34  PROTECTED:
35 
36  // ----------------------------------------------------------------------
37  // Constants
38  // ----------------------------------------------------------------------
39 
41  enum {
44  };
45 
47  enum {
51  };
52 
53  public:
54 
55  // ----------------------------------------------------------------------
56  // Component initialization
57  // ----------------------------------------------------------------------
58 
60  void init(
61  FwEnumStoreType instance = 0
62  );
63 
64  public:
65 
66  // ----------------------------------------------------------------------
67  // Getters for typed input ports
68  // ----------------------------------------------------------------------
69 
74  FwIndexType portNum
75  );
76 
81  FwIndexType portNum
82  );
83 
84  public:
85 
86  // ----------------------------------------------------------------------
87  // Connect typed input ports to typed output ports
88  // ----------------------------------------------------------------------
89 
92  FwIndexType portNum,
93  Fw::InputComPort* port
94  );
95 
98  FwIndexType portNum,
99  Fw::InputComPort* port
100  );
101 
104  FwIndexType portNum,
106  );
107 
108 #if FW_PORT_SERIALIZATION
109 
110  public:
111 
112  // ----------------------------------------------------------------------
113  // Connect serial input ports to typed output ports
114  // ----------------------------------------------------------------------
115 
118  FwIndexType portNum,
119  Fw::InputSerializePort* port
120  );
121 
124  FwIndexType portNum,
125  Fw::InputSerializePort* port
126  );
127 
130  FwIndexType portNum,
131  Fw::InputSerializePort* port
132  );
133 
134 #endif
135 
136  PROTECTED:
137 
138  // ----------------------------------------------------------------------
139  // Component construction and destruction
140  // ----------------------------------------------------------------------
141 
144  const char* compName = ""
145  );
146 
148  virtual ~CmdSplitterComponentBase();
149 
150  PROTECTED:
151 
152  // ----------------------------------------------------------------------
153  // Getters for numbers of typed input ports
154  // ----------------------------------------------------------------------
155 
160 
165 
166  PROTECTED:
167 
168  // ----------------------------------------------------------------------
169  // Getters for numbers of typed output ports
170  // ----------------------------------------------------------------------
171 
176 
181 
186 
187  PROTECTED:
188 
189  // ----------------------------------------------------------------------
190  // Connection status queries for typed output ports
191  // ----------------------------------------------------------------------
192 
197  FwIndexType portNum
198  );
199 
204  FwIndexType portNum
205  );
206 
211  FwIndexType portNum
212  );
213 
214  PROTECTED:
215 
216  // ----------------------------------------------------------------------
217  // Handlers to implement for typed input ports
218  // ----------------------------------------------------------------------
219 
221  virtual void CmdBuff_handler(
222  FwIndexType portNum,
223  Fw::ComBuffer& data,
224  U32 context
225  ) = 0;
226 
228  virtual void seqCmdStatus_handler(
229  FwIndexType portNum,
230  FwOpcodeType opCode,
231  U32 cmdSeq,
232  const Fw::CmdResponse& response
233  ) = 0;
234 
235  PROTECTED:
236 
237  // ----------------------------------------------------------------------
238  // Port handler base-class functions for typed input ports
239  //
240  // Call these functions directly to bypass the corresponding ports
241  // ----------------------------------------------------------------------
242 
244  void CmdBuff_handlerBase(
245  FwIndexType portNum,
246  Fw::ComBuffer& data,
247  U32 context
248  );
249 
252  FwIndexType portNum,
253  FwOpcodeType opCode,
254  U32 cmdSeq,
255  const Fw::CmdResponse& response
256  );
257 
258  PROTECTED:
259 
260  // ----------------------------------------------------------------------
261  // Invocation functions for typed output ports
262  // ----------------------------------------------------------------------
263 
265  void LocalCmd_out(
266  FwIndexType portNum,
267  Fw::ComBuffer& data,
268  U32 context
269  );
270 
272  void RemoteCmd_out(
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  PRIVATE:
287 
288  // ----------------------------------------------------------------------
289  // Calls for messages received on typed input ports
290  // ----------------------------------------------------------------------
291 
293  static void m_p_CmdBuff_in(
294  Fw::PassiveComponentBase* callComp,
295  FwIndexType portNum,
296  Fw::ComBuffer& data,
297  U32 context
298  );
299 
301  static void m_p_seqCmdStatus_in(
302  Fw::PassiveComponentBase* callComp,
303  FwIndexType portNum,
304  FwOpcodeType opCode,
305  U32 cmdSeq,
306  const Fw::CmdResponse& response
307  );
308 
309  PRIVATE:
310 
311  // ----------------------------------------------------------------------
312  // Typed input ports
313  // ----------------------------------------------------------------------
314 
316  Fw::InputComPort m_CmdBuff_InputPort[NUM_CMDBUFF_INPUT_PORTS];
317 
319  Fw::InputCmdResponsePort m_seqCmdStatus_InputPort[NUM_SEQCMDSTATUS_INPUT_PORTS];
320 
321  PRIVATE:
322 
323  // ----------------------------------------------------------------------
324  // Typed output ports
325  // ----------------------------------------------------------------------
326 
328  Fw::OutputComPort m_LocalCmd_OutputPort[NUM_LOCALCMD_OUTPUT_PORTS];
329 
331  Fw::OutputComPort m_RemoteCmd_OutputPort[NUM_REMOTECMD_OUTPUT_PORTS];
332 
334  Fw::OutputCmdResponsePort m_forwardSeqCmdStatus_OutputPort[NUM_FORWARDSEQCMDSTATUS_OUTPUT_PORTS];
335 
336  };
337 
338 }
339 
340 #endif
I32 FwEnumStoreType
Definition: FpConfig.h:64
U32 FwOpcodeType
Definition: FpConfig.h:91
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
C++-compatible configuration header for fprime configuration.
Enum representing a command response.
void init()
Object initializer.
Definition: ObjBase.cpp:27
Auto-generated base for CmdSplitter component.
FwIndexType getNum_LocalCmd_OutputPorts() const
FwIndexType getNum_RemoteCmd_OutputPorts() const
void RemoteCmd_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port RemoteCmd.
bool isConnected_RemoteCmd_OutputPort(FwIndexType portNum)
CmdSplitterComponentBase(const char *compName="")
Construct CmdSplitterComponentBase object.
void CmdBuff_handlerBase(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Handler base-class function for input port CmdBuff.
void set_forwardSeqCmdStatus_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to forwardSeqCmdStatus[portNum].
void set_LocalCmd_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to LocalCmd[portNum].
void seqCmdStatus_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Handler base-class function for input port seqCmdStatus.
virtual void CmdBuff_handler(FwIndexType portNum, Fw::ComBuffer &data, U32 context)=0
Handler for input port CmdBuff.
friend class CmdSplitterComponentBaseFriend
Friend class for white-box testing.
virtual ~CmdSplitterComponentBase()
Destroy CmdSplitterComponentBase object.
bool isConnected_forwardSeqCmdStatus_OutputPort(FwIndexType portNum)
void forwardSeqCmdStatus_out(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Invoke output port forwardSeqCmdStatus.
FwIndexType getNum_seqCmdStatus_InputPorts() const
FwIndexType getNum_forwardSeqCmdStatus_OutputPorts() const
bool isConnected_LocalCmd_OutputPort(FwIndexType portNum)
void set_RemoteCmd_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to RemoteCmd[portNum].
virtual void seqCmdStatus_handler(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)=0
Handler for input port seqCmdStatus.
Fw::InputComPort * get_CmdBuff_InputPort(FwIndexType portNum)
Fw::InputCmdResponsePort * get_seqCmdStatus_InputPort(FwIndexType portNum)
void LocalCmd_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port LocalCmd.