F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
DpSendPortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title DpSendPortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for DpSend port
5 // ======================================================================
6 
7 #ifndef Fw_DpSendPortAc_HPP
8 #define Fw_DpSendPortAc_HPP
9 
10 #include "Fw/Buffer/Buffer.hpp"
11 #include "Fw/FPrimeBasicTypes.hpp"
14 #if !FW_DIRECT_PORT_CALLS
18 #endif
19 
20 namespace Fw {
21 
26  {
27 
28  public:
29 
30  // ----------------------------------------------------------------------
31  // Public constants for DpSendPortBuffer
32  // ----------------------------------------------------------------------
33 
36  static constexpr FwSizeType CAPACITY =
37  sizeof(FwDpIdType) +
39 
40  public:
41 
42  // ----------------------------------------------------------------------
43  // Public member functions for DpSendPortBuffer
44  // ----------------------------------------------------------------------
45 
49  return CAPACITY;
50  }
51 
54  U8* getBuffAddr() override {
55  return m_buff;
56  }
57 
60  const U8* getBuffAddr() const override {
61  return m_buff;
62  }
63 
64  private:
65 
66  // ----------------------------------------------------------------------
67  // Private member variables
68  // ----------------------------------------------------------------------
69 
70  U8 m_buff[CAPACITY];
71 
72  };
73 
77 
78  public:
79 
80  // ----------------------------------------------------------------------
81  // Public constructors for DpSendPortSerializer
82  // ----------------------------------------------------------------------
83 
86 
87  public:
88 
89  // ----------------------------------------------------------------------
90  // Public member functions for DpSendPortSerializer
91  // ----------------------------------------------------------------------
92 
95  Fw::SerialBufferBase& _buffer
96  );
97 
98  public:
99 
100  // ----------------------------------------------------------------------
101  // Public static functions for DpSendPortSerializer
102  // ----------------------------------------------------------------------
103 
106  FwDpIdType id,
107  const Fw::Buffer& buffer,
108  Fw::SerialBufferBase& _buffer
109  );
110 
111  public:
112 
113  // ----------------------------------------------------------------------
114  // Public member variables for DpSendPortSerializer
115  // ----------------------------------------------------------------------
116 
119 
120  };
121 
122 #if !FW_DIRECT_PORT_CALLS
123 
127  public Fw::InputPortBase
128  {
129 
130  public:
131 
132  // ----------------------------------------------------------------------
133  // Public types for InputDpSendPort
134  // ----------------------------------------------------------------------
135 
137  typedef void (*CompFuncPtr)(
138  Fw::PassiveComponentBase* callComp,
139  FwIndexType portNum,
140  FwDpIdType id,
141  const Fw::Buffer& buffer
142  );
143 
144  public:
145 
146  // ----------------------------------------------------------------------
147  // Public constructors for InputDpSendPort
148  // ----------------------------------------------------------------------
149 
151  InputDpSendPort();
152 
153  public:
154 
155  // ----------------------------------------------------------------------
156  // Public member functions for InputDpSendPort
157  // ----------------------------------------------------------------------
158 
160  void init();
161 
163  void addCallComp(
164  Fw::PassiveComponentBase* callComp,
165  CompFuncPtr funcPtr
166  );
167 
169  void invoke(
170  FwDpIdType id,
171  const Fw::Buffer& buffer
172  );
173 
174  private:
175 
176  // ----------------------------------------------------------------------
177  // Private member functions for InputDpSendPort
178  // ----------------------------------------------------------------------
179 
180 #if FW_PORT_SERIALIZATION == 1
181 
184  Fw::SerializeStatus invokeSerial(
185  Fw::LinearBufferBase& _buffer
186  );
187 
188 #endif
189 
190  private:
191 
192  // ----------------------------------------------------------------------
193  // Private member variables for InputDpSendPort
194  // ----------------------------------------------------------------------
195 
197  CompFuncPtr m_func;
198 
199  };
200 
204  public Fw::OutputPortBase
205  {
206 
207  public:
208 
209  // ----------------------------------------------------------------------
210  // Public constructors for OutputDpSendPort
211  // ----------------------------------------------------------------------
212 
215 
216  public:
217 
218  // ----------------------------------------------------------------------
219  // Public member functions for OutputDpSendPort
220  // ----------------------------------------------------------------------
221 
223  void init();
224 
226  void addCallPort(
227  InputDpSendPort* callPort
228  );
229 
231  void invoke(
232  FwDpIdType id,
233  const Fw::Buffer& buffer
234  ) const;
235 
236  private:
237 
238  // ----------------------------------------------------------------------
239  // Private member variables for OutputDpSendPort
240  // ----------------------------------------------------------------------
241 
243  InputDpSendPort* m_port;
244 
245  };
246 
247 #endif
248 
249 }
250 
251 #endif
void init()
Initialization function.
const U8 * getBuffAddr() const override
PlatformSizeType FwSizeType
void addCallPort(InputDpSendPort *callPort)
Register an input port.
Fw::Serializable::SizeType getCapacity() const override
void init()
Initialization function.
Fw::SerializeStatus deserializePortArgs(Fw::SerialBufferBase &_buffer)
Deserialze port arguments into members.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Size of Fw::Buffer when serialized.
Definition: Buffer.hpp:64
static constexpr FwSizeType CAPACITY
static Fw::SerializeStatus serializePortArgs(FwDpIdType id, const Fw::Buffer &buffer, Fw::SerialBufferBase &_buffer)
Serialize port arguments into a buffer.
DpSendPortSerializer()
Constructor.
InputDpSendPort()
Constructor.
OutputDpSendPort()
Constructor.
SerializeStatus
forward declaration for string
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, FwDpIdType id, const Fw::Buffer &buffer)
The port callback function type.
FwSizeType SizeType
void invoke(FwDpIdType id, const Fw::Buffer &buffer)
Invoke a port interface.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
FwIdType FwDpIdType
The type of a data product identifier.
PlatformIndexType FwIndexType
U8 * getBuffAddr() override
Implementation of malloc based allocator.
void invoke(FwDpIdType id, const Fw::Buffer &buffer) const
Invoke a port connection.