F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
CmdRegPortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title CmdRegPortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for CmdReg port
5 // ======================================================================
6 
7 #ifndef Fw_CmdRegPortAc_HPP
8 #define Fw_CmdRegPortAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
13 #if !FW_DIRECT_PORT_CALLS
17 #endif
18 
19 namespace Fw {
20 
25  {
26 
27  public:
28 
29  // ----------------------------------------------------------------------
30  // Public constants for CmdRegPortBuffer
31  // ----------------------------------------------------------------------
32 
35  static constexpr FwSizeType CAPACITY =
36  sizeof(FwOpcodeType);
37 
38  public:
39 
40  // ----------------------------------------------------------------------
41  // Public member functions for CmdRegPortBuffer
42  // ----------------------------------------------------------------------
43 
46 
47  }
48 
49  private:
50 
51  // ----------------------------------------------------------------------
52  // Private member variables
53  // ----------------------------------------------------------------------
54 
55  U8 m_buff[CAPACITY];
56 
57  };
58 
62 
63  public:
64 
65  // ----------------------------------------------------------------------
66  // Public constructors for CmdRegPortSerializer
67  // ----------------------------------------------------------------------
68 
71 
72  public:
73 
74  // ----------------------------------------------------------------------
75  // Public member functions for CmdRegPortSerializer
76  // ----------------------------------------------------------------------
77 
80  Fw::SerialBufferBase& _buffer
81  );
82 
83  public:
84 
85  // ----------------------------------------------------------------------
86  // Public static functions for CmdRegPortSerializer
87  // ----------------------------------------------------------------------
88 
91  FwOpcodeType opCode,
92  Fw::SerialBufferBase& _buffer
93  );
94 
95  public:
96 
97  // ----------------------------------------------------------------------
98  // Public member variables for CmdRegPortSerializer
99  // ----------------------------------------------------------------------
100 
102 
103  };
104 
105 #if !FW_DIRECT_PORT_CALLS
106 
110  public Fw::InputPortBase
111  {
112 
113  public:
114 
115  // ----------------------------------------------------------------------
116  // Public types for InputCmdRegPort
117  // ----------------------------------------------------------------------
118 
120  typedef void (*CompFuncPtr)(
121  Fw::PassiveComponentBase* callComp,
122  FwIndexType portNum,
123  FwOpcodeType opCode
124  );
125 
126  public:
127 
128  // ----------------------------------------------------------------------
129  // Public constructors for InputCmdRegPort
130  // ----------------------------------------------------------------------
131 
133  InputCmdRegPort();
134 
135  public:
136 
137  // ----------------------------------------------------------------------
138  // Public member functions for InputCmdRegPort
139  // ----------------------------------------------------------------------
140 
142  void init();
143 
145  void addCallComp(
146  Fw::PassiveComponentBase* callComp,
147  CompFuncPtr funcPtr
148  );
149 
151  void invoke(
152  FwOpcodeType opCode
153  );
154 
155  private:
156 
157  // ----------------------------------------------------------------------
158  // Private member functions for InputCmdRegPort
159  // ----------------------------------------------------------------------
160 
161 #if FW_PORT_SERIALIZATION == 1
162 
165  Fw::SerializeStatus invokeSerial(
166  Fw::LinearBufferBase& _buffer
167  );
168 
169 #endif
170 
171  private:
172 
173  // ----------------------------------------------------------------------
174  // Private member variables for InputCmdRegPort
175  // ----------------------------------------------------------------------
176 
178  CompFuncPtr m_func;
179 
180  };
181 
185  public Fw::OutputPortBase
186  {
187 
188  public:
189 
190  // ----------------------------------------------------------------------
191  // Public constructors for OutputCmdRegPort
192  // ----------------------------------------------------------------------
193 
196 
197  public:
198 
199  // ----------------------------------------------------------------------
200  // Public member functions for OutputCmdRegPort
201  // ----------------------------------------------------------------------
202 
204  void init();
205 
207  void addCallPort(
208  InputCmdRegPort* callPort
209  );
210 
212  void invoke(
213  FwOpcodeType opCode
214  ) const;
215 
216  private:
217 
218  // ----------------------------------------------------------------------
219  // Private member variables for OutputCmdRegPort
220  // ----------------------------------------------------------------------
221 
223  InputCmdRegPort* m_port;
224 
225  };
226 
227 #endif
228 
229 }
230 
231 #endif
InputCmdRegPort()
Constructor.
FwIdType FwOpcodeType
The type of a command opcode.
PlatformSizeType FwSizeType
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, FwOpcodeType opCode)
The port callback function type.
OutputCmdRegPort()
Constructor.
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
SerializeStatus
forward declaration for string
void invoke(FwOpcodeType opCode) const
Invoke a port connection.
void init()
Initialization function.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
void invoke(FwOpcodeType opCode)
Invoke a port interface.
static Fw::SerializeStatus serializePortArgs(FwOpcodeType opCode, Fw::SerialBufferBase &_buffer)
Serialize port arguments into a buffer.
PlatformIndexType FwIndexType
Fw::SerializeStatus deserializePortArgs(Fw::SerialBufferBase &_buffer)
Deserialze port arguments into members.
static constexpr FwSizeType CAPACITY
Implementation of malloc based allocator.
CmdRegPortBuffer()
Constructor.
void init()
Initialization function.
CmdRegPortSerializer()
Constructor.