F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
CmdResponsePortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title CmdResponsePortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for CmdResponse port
5 // ======================================================================
6 
7 #ifndef Fw_CmdResponsePortAc_HPP
8 #define Fw_CmdResponsePortAc_HPP
9 
10 #include <cstdio>
11 #include <cstring>
12 
13 #include "FpConfig.hpp"
19 #include "Fw/Types/StringType.hpp"
20 
21 namespace Fw {
22 
26  public Fw::InputPortBase
27  {
28 
29  public:
30 
31  // ----------------------------------------------------------------------
32  // Constants
33  // ----------------------------------------------------------------------
34 
35  enum {
38  sizeof(FwOpcodeType) +
39  sizeof(U32) +
41  };
42 
43  public:
44 
45  // ----------------------------------------------------------------------
46  // Types
47  // ----------------------------------------------------------------------
48 
50  typedef void (*CompFuncPtr)(
51  Fw::PassiveComponentBase* callComp,
52  FwIndexType portNum,
53  FwOpcodeType opCode,
54  U32 cmdSeq,
55  const Fw::CmdResponse& response
56  );
57 
58  public:
59 
60  // ----------------------------------------------------------------------
61  // Input Port Member functions
62  // ----------------------------------------------------------------------
63 
66 
68  void init();
69 
71  void addCallComp(
72  Fw::PassiveComponentBase* callComp,
73  CompFuncPtr funcPtr
74  );
75 
77  void invoke(
78  FwOpcodeType opCode,
79  U32 cmdSeq,
80  const Fw::CmdResponse& response
81  );
82 
83  private:
84 
85 #if FW_PORT_SERIALIZATION == 1
86 
88  Fw::SerializeStatus invokeSerial(Fw::SerializeBufferBase& _buffer);
89 
90 #endif
91 
92  private:
93 
94  // ----------------------------------------------------------------------
95  // Member variables
96  // ----------------------------------------------------------------------
97 
99  CompFuncPtr m_func;
100 
101  };
102 
106  public Fw::OutputPortBase
107  {
108 
109  public:
110 
111  // ----------------------------------------------------------------------
112  // Output Port Member functions
113  // ----------------------------------------------------------------------
114 
117 
119  void init();
120 
122  void addCallPort(
123  InputCmdResponsePort* callPort
124  );
125 
127  void invoke(
128  FwOpcodeType opCode,
129  U32 cmdSeq,
130  const Fw::CmdResponse& response
131  );
132 
133  private:
134 
135  // ----------------------------------------------------------------------
136  // Member variables
137  // ----------------------------------------------------------------------
138 
140  InputCmdResponsePort* m_port;
141 
142  };
143 
144 }
145 
146 #endif
U32 FwOpcodeType
Definition: FpConfig.h:91
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
C++-compatible configuration header for fprime configuration.
Enum representing a command response.
@ SERIALIZED_SIZE
The size of the serial representation.
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Invoke a port interface.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void init()
Initialization function.
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
The port callback function type.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
void init()
Initialization function.
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Invoke a port interface.
SerializeStatus
forward declaration for string