F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
DpResponsePortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title DpResponsePortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for DpResponse port
5 // ======================================================================
6 
7 #ifndef Fw_DpResponsePortAc_HPP
8 #define Fw_DpResponsePortAc_HPP
9 
10 #include "Fw/Buffer/Buffer.hpp"
11 #include "Fw/FPrimeBasicTypes.hpp"
15 #if !FW_DIRECT_PORT_CALLS
19 #endif
20 
21 namespace Fw {
22 
27  {
28 
29  public:
30 
31  // ----------------------------------------------------------------------
32  // Public constants for DpResponsePortBuffer
33  // ----------------------------------------------------------------------
34 
37  static constexpr FwSizeType CAPACITY =
38  sizeof(FwDpIdType) +
41 
42  public:
43 
44  // ----------------------------------------------------------------------
45  // Public member functions for DpResponsePortBuffer
46  // ----------------------------------------------------------------------
47 
51  return CAPACITY;
52  }
53 
56  U8* getBuffAddr() override {
57  return m_buff;
58  }
59 
62  const U8* getBuffAddr() const override {
63  return m_buff;
64  }
65 
66  private:
67 
68  // ----------------------------------------------------------------------
69  // Private member variables
70  // ----------------------------------------------------------------------
71 
72  U8 m_buff[CAPACITY];
73 
74  };
75 
79 
80  public:
81 
82  // ----------------------------------------------------------------------
83  // Public constructors for DpResponsePortSerializer
84  // ----------------------------------------------------------------------
85 
88 
89  public:
90 
91  // ----------------------------------------------------------------------
92  // Public member functions for DpResponsePortSerializer
93  // ----------------------------------------------------------------------
94 
97  Fw::SerialBufferBase& _buffer
98  );
99 
100  public:
101 
102  // ----------------------------------------------------------------------
103  // Public static functions for DpResponsePortSerializer
104  // ----------------------------------------------------------------------
105 
108  FwDpIdType id,
109  const Fw::Buffer& buffer,
110  const Fw::Success& status,
111  Fw::SerialBufferBase& _buffer
112  );
113 
114  public:
115 
116  // ----------------------------------------------------------------------
117  // Public member variables for DpResponsePortSerializer
118  // ----------------------------------------------------------------------
119 
123 
124  };
125 
126 #if !FW_DIRECT_PORT_CALLS
127 
131  public Fw::InputPortBase
132  {
133 
134  public:
135 
136  // ----------------------------------------------------------------------
137  // Public types for InputDpResponsePort
138  // ----------------------------------------------------------------------
139 
141  typedef void (*CompFuncPtr)(
142  Fw::PassiveComponentBase* callComp,
143  FwIndexType portNum,
144  FwDpIdType id,
145  const Fw::Buffer& buffer,
146  const Fw::Success& status
147  );
148 
149  public:
150 
151  // ----------------------------------------------------------------------
152  // Public constructors for InputDpResponsePort
153  // ----------------------------------------------------------------------
154 
157 
158  public:
159 
160  // ----------------------------------------------------------------------
161  // Public member functions for InputDpResponsePort
162  // ----------------------------------------------------------------------
163 
165  void init();
166 
168  void addCallComp(
169  Fw::PassiveComponentBase* callComp,
170  CompFuncPtr funcPtr
171  );
172 
174  void invoke(
175  FwDpIdType id,
176  const Fw::Buffer& buffer,
177  const Fw::Success& status
178  );
179 
180  private:
181 
182  // ----------------------------------------------------------------------
183  // Private member functions for InputDpResponsePort
184  // ----------------------------------------------------------------------
185 
186 #if FW_PORT_SERIALIZATION == 1
187 
190  Fw::SerializeStatus invokeSerial(
191  Fw::LinearBufferBase& _buffer
192  );
193 
194 #endif
195 
196  private:
197 
198  // ----------------------------------------------------------------------
199  // Private member variables for InputDpResponsePort
200  // ----------------------------------------------------------------------
201 
203  CompFuncPtr m_func;
204 
205  };
206 
210  public Fw::OutputPortBase
211  {
212 
213  public:
214 
215  // ----------------------------------------------------------------------
216  // Public constructors for OutputDpResponsePort
217  // ----------------------------------------------------------------------
218 
221 
222  public:
223 
224  // ----------------------------------------------------------------------
225  // Public member functions for OutputDpResponsePort
226  // ----------------------------------------------------------------------
227 
229  void init();
230 
232  void addCallPort(
233  InputDpResponsePort* callPort
234  );
235 
237  void invoke(
238  FwDpIdType id,
239  const Fw::Buffer& buffer,
240  const Fw::Success& status
241  ) const;
242 
243  private:
244 
245  // ----------------------------------------------------------------------
246  // Private member variables for OutputDpResponsePort
247  // ----------------------------------------------------------------------
248 
250  InputDpResponsePort* m_port;
251 
252  };
253 
254 #endif
255 
256 }
257 
258 #endif
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, FwDpIdType id, const Fw::Buffer &buffer, const Fw::Success &status)
The port callback function type.
InputDpResponsePort()
Constructor.
PlatformSizeType FwSizeType
Fw::Serializable::SizeType getCapacity() const override
OutputDpResponsePort()
Constructor.
static constexpr FwSizeType CAPACITY
Size of Fw::Buffer when serialized.
Definition: Buffer.hpp:64
void addCallPort(InputDpResponsePort *callPort)
Register an input port.
static Fw::SerializeStatus serializePortArgs(FwDpIdType id, const Fw::Buffer &buffer, const Fw::Success &status, Fw::SerialBufferBase &_buffer)
Serialize port arguments into a buffer.
void invoke(FwDpIdType id, const Fw::Buffer &buffer, const Fw::Success &status) const
Invoke a port connection.
SerializeStatus
forward declaration for string
void init()
Initialization function.
Fw::SerializeStatus deserializePortArgs(Fw::SerialBufferBase &_buffer)
Deserialze port arguments into members.
void init()
Initialization function.
FwSizeType SizeType
The size of the serial representation.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
void invoke(FwDpIdType id, const Fw::Buffer &buffer, const Fw::Success &status)
Invoke a port interface.
FwIdType FwDpIdType
The type of a data product identifier.
const U8 * getBuffAddr() const override
PlatformIndexType FwIndexType
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Implementation of malloc based allocator.
Success/Failure.