F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
DeframerComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title DeframerComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for Deframer component base class
5 // ======================================================================
6 
7 #ifndef Svc_DeframerComponentAc_HPP
8 #define Svc_DeframerComponentAc_HPP
9 
12 #include "FpConfig.hpp"
16 #include "Fw/Com/ComPortAc.hpp"
20 #include "Os/Mutex.hpp"
22 
23 namespace Svc {
24 
32  {
33 
34  // ----------------------------------------------------------------------
35  // Friend classes
36  // ----------------------------------------------------------------------
37 
40 
41  PROTECTED:
42 
43  // ----------------------------------------------------------------------
44  // Constants
45  // ----------------------------------------------------------------------
46 
48  enum {
52  };
53 
55  enum {
62  };
63 
64  public:
65 
66  // ----------------------------------------------------------------------
67  // Component initialization
68  // ----------------------------------------------------------------------
69 
71  void init(
72  FwEnumStoreType instance = 0
73  );
74 
75  public:
76 
77  // ----------------------------------------------------------------------
78  // Getters for typed input ports
79  // ----------------------------------------------------------------------
80 
85  FwIndexType portNum
86  );
87 
92  FwIndexType portNum
93  );
94 
99  FwIndexType portNum
100  );
101 
102  public:
103 
104  // ----------------------------------------------------------------------
105  // Connect typed input ports to typed output ports
106  // ----------------------------------------------------------------------
107 
110  FwIndexType portNum,
112  );
113 
116  FwIndexType portNum,
118  );
119 
122  FwIndexType portNum,
124  );
125 
128  FwIndexType portNum,
129  Fw::InputComPort* port
130  );
131 
134  FwIndexType portNum,
136  );
137 
140  FwIndexType portNum,
142  );
143 
144 #if FW_PORT_SERIALIZATION
145 
146  public:
147 
148  // ----------------------------------------------------------------------
149  // Connect serial input ports to typed output ports
150  // ----------------------------------------------------------------------
151 
154  FwIndexType portNum,
155  Fw::InputSerializePort* port
156  );
157 
160  FwIndexType portNum,
161  Fw::InputSerializePort* port
162  );
163 
166  FwIndexType portNum,
167  Fw::InputSerializePort* port
168  );
169 
172  FwIndexType portNum,
173  Fw::InputSerializePort* port
174  );
175 
176 #endif
177 
178  PROTECTED:
179 
180  // ----------------------------------------------------------------------
181  // Component construction and destruction
182  // ----------------------------------------------------------------------
183 
186  const char* compName = ""
187  );
188 
190  virtual ~DeframerComponentBase();
191 
192  PROTECTED:
193 
194  // ----------------------------------------------------------------------
195  // Getters for numbers of typed input ports
196  // ----------------------------------------------------------------------
197 
202 
207 
212 
213  PROTECTED:
214 
215  // ----------------------------------------------------------------------
216  // Getters for numbers of typed output ports
217  // ----------------------------------------------------------------------
218 
223 
228 
233 
238 
243 
248 
249  PROTECTED:
250 
251  // ----------------------------------------------------------------------
252  // Connection status queries for typed output ports
253  // ----------------------------------------------------------------------
254 
259  FwIndexType portNum
260  );
261 
266  FwIndexType portNum
267  );
268 
273  FwIndexType portNum
274  );
275 
280  FwIndexType portNum
281  );
282 
287  FwIndexType portNum
288  );
289 
294  FwIndexType portNum
295  );
296 
297  PROTECTED:
298 
299  // ----------------------------------------------------------------------
300  // Handlers to implement for typed input ports
301  // ----------------------------------------------------------------------
302 
304  virtual void cmdResponseIn_handler(
305  FwIndexType portNum,
306  FwOpcodeType opCode,
307  U32 cmdSeq,
308  const Fw::CmdResponse& response
309  ) = 0;
310 
312  virtual void framedIn_handler(
313  FwIndexType portNum,
314  Fw::Buffer& recvBuffer,
315  const Drv::RecvStatus& recvStatus
316  ) = 0;
317 
319  virtual void schedIn_handler(
320  FwIndexType portNum,
321  U32 context
322  ) = 0;
323 
324  PROTECTED:
325 
326  // ----------------------------------------------------------------------
327  // Port handler base-class functions for typed input ports
328  //
329  // Call these functions directly to bypass the corresponding ports
330  // ----------------------------------------------------------------------
331 
334  FwIndexType portNum,
335  FwOpcodeType opCode,
336  U32 cmdSeq,
337  const Fw::CmdResponse& response
338  );
339 
342  FwIndexType portNum,
343  Fw::Buffer& recvBuffer,
344  const Drv::RecvStatus& recvStatus
345  );
346 
348  void schedIn_handlerBase(
349  FwIndexType portNum,
350  U32 context
351  );
352 
353  PROTECTED:
354 
355  // ----------------------------------------------------------------------
356  // Invocation functions for typed output ports
357  // ----------------------------------------------------------------------
358 
361  FwIndexType portNum,
362  U32 size
363  );
364 
367  FwIndexType portNum,
368  Fw::Buffer& fwBuffer
369  );
370 
372  void bufferOut_out(
373  FwIndexType portNum,
374  Fw::Buffer& fwBuffer
375  );
376 
378  void comOut_out(
379  FwIndexType portNum,
380  Fw::ComBuffer& data,
381  U32 context
382  );
383 
386  FwIndexType portNum,
387  Fw::Buffer& fwBuffer
388  );
389 
392  FwIndexType portNum,
393  Fw::Buffer& pollBuffer
394  );
395 
396  PROTECTED:
397 
398  // ----------------------------------------------------------------------
399  // Mutex operations for guarded ports
400  //
401  // You can override these operations to provide more sophisticated
402  // synchronization
403  // ----------------------------------------------------------------------
404 
406  virtual void lock();
407 
409  virtual void unLock();
410 
411  PRIVATE:
412 
413  // ----------------------------------------------------------------------
414  // Calls for messages received on typed input ports
415  // ----------------------------------------------------------------------
416 
418  static void m_p_cmdResponseIn_in(
419  Fw::PassiveComponentBase* callComp,
420  FwIndexType portNum,
421  FwOpcodeType opCode,
422  U32 cmdSeq,
423  const Fw::CmdResponse& response
424  );
425 
427  static void m_p_framedIn_in(
428  Fw::PassiveComponentBase* callComp,
429  FwIndexType portNum,
430  Fw::Buffer& recvBuffer,
431  const Drv::RecvStatus& recvStatus
432  );
433 
435  static void m_p_schedIn_in(
436  Fw::PassiveComponentBase* callComp,
437  FwIndexType portNum,
438  U32 context
439  );
440 
441  PRIVATE:
442 
443  // ----------------------------------------------------------------------
444  // Typed input ports
445  // ----------------------------------------------------------------------
446 
448  Fw::InputCmdResponsePort m_cmdResponseIn_InputPort[NUM_CMDRESPONSEIN_INPUT_PORTS];
449 
452 
454  Svc::InputSchedPort m_schedIn_InputPort[NUM_SCHEDIN_INPUT_PORTS];
455 
456  PRIVATE:
457 
458  // ----------------------------------------------------------------------
459  // Typed output ports
460  // ----------------------------------------------------------------------
461 
463  Fw::OutputBufferGetPort m_bufferAllocate_OutputPort[NUM_BUFFERALLOCATE_OUTPUT_PORTS];
464 
466  Fw::OutputBufferSendPort m_bufferDeallocate_OutputPort[NUM_BUFFERDEALLOCATE_OUTPUT_PORTS];
467 
470 
472  Fw::OutputComPort m_comOut_OutputPort[NUM_COMOUT_OUTPUT_PORTS];
473 
475  Fw::OutputBufferSendPort m_framedDeallocate_OutputPort[NUM_FRAMEDDEALLOCATE_OUTPUT_PORTS];
476 
479 
480  PRIVATE:
481 
482  // ----------------------------------------------------------------------
483  // Mutexes
484  // ----------------------------------------------------------------------
485 
487  Os::Mutex m_guardedPortMutex;
488 
489  };
490 
491 }
492 
493 #endif
I32 FwEnumStoreType
Definition: FpConfig.h:51
U32 FwOpcodeType
Definition: FpConfig.h:78
PlatformIndexType FwIndexType
Definition: FpConfig.h:20
C++-compatible configuration header for fprime configuration.
Input ByteStreamPoll port.
Output ByteStreamPoll port.
Status associated with the received data.
Enum representing a command response.
void init()
Object initializer.
Definition: ObjBase.cpp:27
Auto-generated base for Deframer component.
FwIndexType getNum_bufferDeallocate_OutputPorts() const
virtual void unLock()
Unlock the guarded mutex.
void set_bufferDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to bufferDeallocate[portNum].
void bufferDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port bufferDeallocate.
FwIndexType getNum_framedIn_InputPorts() const
FwIndexType getNum_cmdResponseIn_InputPorts() const
void framedDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port framedDeallocate.
virtual void lock()
Lock the guarded mutex.
void set_framedDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to framedDeallocate[portNum].
void set_framedPoll_OutputPort(FwIndexType portNum, Drv::InputByteStreamPollPort *port)
Connect port to framedPoll[portNum].
virtual void schedIn_handler(FwIndexType portNum, U32 context)=0
Handler for input port schedIn.
virtual ~DeframerComponentBase()
Destroy DeframerComponentBase object.
void bufferOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port bufferOut.
Svc::InputSchedPort * get_schedIn_InputPort(FwIndexType portNum)
DeframerComponentBase(const char *compName="")
Construct DeframerComponentBase object.
FwIndexType getNum_bufferOut_OutputPorts() const
Fw::Buffer bufferAllocate_out(FwIndexType portNum, U32 size)
Invoke output port bufferAllocate.
FwIndexType getNum_comOut_OutputPorts() const
virtual void cmdResponseIn_handler(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)=0
Handler for input port cmdResponseIn.
Drv::PollStatus framedPoll_out(FwIndexType portNum, Fw::Buffer &pollBuffer)
Invoke output port framedPoll.
bool isConnected_bufferAllocate_OutputPort(FwIndexType portNum)
bool isConnected_bufferOut_OutputPort(FwIndexType portNum)
void comOut_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port comOut.
virtual void framedIn_handler(FwIndexType portNum, Fw::Buffer &recvBuffer, const Drv::RecvStatus &recvStatus)=0
Handler for input port framedIn.
void schedIn_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port schedIn.
Fw::InputCmdResponsePort * get_cmdResponseIn_InputPort(FwIndexType portNum)
void cmdResponseIn_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Handler base-class function for input port cmdResponseIn.
void set_bufferOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to bufferOut[portNum].
FwIndexType getNum_framedDeallocate_OutputPorts() const
FwIndexType getNum_framedPoll_OutputPorts() const
bool isConnected_bufferDeallocate_OutputPort(FwIndexType portNum)
void set_comOut_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to comOut[portNum].
void framedIn_handlerBase(FwIndexType portNum, Fw::Buffer &recvBuffer, const Drv::RecvStatus &recvStatus)
Handler base-class function for input port framedIn.
friend class DeframerComponentBaseFriend
Friend class for white-box testing.
void set_bufferAllocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to bufferAllocate[portNum].
bool isConnected_framedDeallocate_OutputPort(FwIndexType portNum)
FwIndexType getNum_schedIn_InputPorts() const
FwIndexType getNum_bufferAllocate_OutputPorts() const
bool isConnected_framedPoll_OutputPort(FwIndexType portNum)
bool isConnected_comOut_OutputPort(FwIndexType portNum)
Drv::InputByteStreamRecvPort * get_framedIn_InputPort(FwIndexType portNum)