F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
UdpComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title UdpComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for Udp component base class
5 // ======================================================================
6 
7 #ifndef Drv_UdpComponentAc_HPP
8 #define Drv_UdpComponentAc_HPP
9 
15 #include "Fw/FPrimeBasicTypes.hpp"
18 #include "Os/Mutex.hpp"
19 
20 namespace Drv {
21 
26  {
27 
28  // ----------------------------------------------------------------------
29  // Friend classes
30  // ----------------------------------------------------------------------
31 
33  friend class UdpTesterBase;
35  friend class UdpTester;
36 
37  PROTECTED:
38 
39  // ----------------------------------------------------------------------
40  // Constants
41  // ----------------------------------------------------------------------
42 
44  enum {
47  };
48 
50  enum {
56  };
57 
58  public:
59 
60  // ----------------------------------------------------------------------
61  // Component initialization
62  // ----------------------------------------------------------------------
63 
65  void init(
66  FwEnumStoreType instance = 0
67  );
68 
69  public:
70 
71  // ----------------------------------------------------------------------
72  // Getters for typed input ports
73  // ----------------------------------------------------------------------
74 
79  FwIndexType portNum
80  );
81 
86  FwIndexType portNum
87  );
88 
89  public:
90 
91  // ----------------------------------------------------------------------
92  // Connect typed input ports to typed output ports
93  // ----------------------------------------------------------------------
94 
97  FwIndexType portNum,
99  );
100 
103  FwIndexType portNum,
105  );
106 
109  FwIndexType portNum,
111  );
112 
114  void set_recv_OutputPort(
115  FwIndexType portNum,
117  );
118 
121  FwIndexType portNum,
123  );
124 
125 #if FW_PORT_SERIALIZATION
126 
127  public:
128 
129  // ----------------------------------------------------------------------
130  // Connect serial input ports to typed output ports
131  // ----------------------------------------------------------------------
132 
135  FwIndexType portNum,
136  Fw::InputSerializePort* port
137  );
138 
141  FwIndexType portNum,
142  Fw::InputSerializePort* port
143  );
144 
146  void set_recv_OutputPort(
147  FwIndexType portNum,
148  Fw::InputSerializePort* port
149  );
150 
153  FwIndexType portNum,
154  Fw::InputSerializePort* port
155  );
156 
157 #endif
158 
159  PROTECTED:
160 
161  // ----------------------------------------------------------------------
162  // Component construction and destruction
163  // ----------------------------------------------------------------------
164 
167  const char* compName = ""
168  );
169 
171  virtual ~UdpComponentBase();
172 
173  PROTECTED:
174 
175  // ----------------------------------------------------------------------
176  // Getters for numbers of typed input ports
177  // ----------------------------------------------------------------------
178 
183 
188 
189  PROTECTED:
190 
191  // ----------------------------------------------------------------------
192  // Getters for numbers of typed output ports
193  // ----------------------------------------------------------------------
194 
199 
204 
209 
214 
219 
220  PROTECTED:
221 
222  // ----------------------------------------------------------------------
223  // Connection status queries for typed output ports
224  // ----------------------------------------------------------------------
225 
230  FwIndexType portNum
231  );
232 
237  FwIndexType portNum
238  );
239 
244  FwIndexType portNum
245  );
246 
251  FwIndexType portNum
252  );
253 
258  FwIndexType portNum
259  );
260 
261  PROTECTED:
262 
263  // ----------------------------------------------------------------------
264  // Handlers to implement for typed input ports
265  // ----------------------------------------------------------------------
266 
268  virtual void recvReturnIn_handler(
269  FwIndexType portNum,
270  Fw::Buffer& fwBuffer
271  ) = 0;
272 
274  virtual void send_handler(
275  FwIndexType portNum,
276  Fw::Buffer& fwBuffer
277  ) = 0;
278 
279  PROTECTED:
280 
281  // ----------------------------------------------------------------------
282  // Port handler base-class functions for typed input ports
283  //
284  // Call these functions directly to bypass the corresponding ports
285  // ----------------------------------------------------------------------
286 
289  FwIndexType portNum,
290  Fw::Buffer& fwBuffer
291  );
292 
294  void send_handlerBase(
295  FwIndexType portNum,
296  Fw::Buffer& fwBuffer
297  );
298 
299  PROTECTED:
300 
301  // ----------------------------------------------------------------------
302  // Invocation functions for typed output ports
303  // ----------------------------------------------------------------------
304 
307  FwIndexType portNum,
308  U32 size
309  );
310 
312  void deallocate_out(
313  FwIndexType portNum,
314  Fw::Buffer& fwBuffer
315  );
316 
318  void ready_out(
319  FwIndexType portNum
320  );
321 
323  void recv_out(
324  FwIndexType portNum,
325  Fw::Buffer& buffer,
326  const Drv::ByteStreamStatus& status
327  );
328 
330  void sendReturnOut_out(
331  FwIndexType portNum,
332  Fw::Buffer& buffer,
333  const Drv::ByteStreamStatus& status
334  );
335 
336  PROTECTED:
337 
338  // ----------------------------------------------------------------------
339  // Mutex operations for guarded ports
340  //
341  // You can override these operations to provide more sophisticated
342  // synchronization
343  // ----------------------------------------------------------------------
344 
346  virtual void lock();
347 
349  virtual void unLock();
350 
351  PRIVATE:
352 
353  // ----------------------------------------------------------------------
354  // Calls for messages received on typed input ports
355  // ----------------------------------------------------------------------
356 
358  static void m_p_recvReturnIn_in(
359  Fw::PassiveComponentBase* callComp,
360  FwIndexType portNum,
361  Fw::Buffer& fwBuffer
362  );
363 
365  static void m_p_send_in(
366  Fw::PassiveComponentBase* callComp,
367  FwIndexType portNum,
368  Fw::Buffer& fwBuffer
369  );
370 
371  PRIVATE:
372 
373  // ----------------------------------------------------------------------
374  // Typed input ports
375  // ----------------------------------------------------------------------
376 
378  Fw::InputBufferSendPort m_recvReturnIn_InputPort[NUM_RECVRETURNIN_INPUT_PORTS];
379 
382 
383  PRIVATE:
384 
385  // ----------------------------------------------------------------------
386  // Typed output ports
387  // ----------------------------------------------------------------------
388 
390  Fw::OutputBufferGetPort m_allocate_OutputPort[NUM_ALLOCATE_OUTPUT_PORTS];
391 
393  Fw::OutputBufferSendPort m_deallocate_OutputPort[NUM_DEALLOCATE_OUTPUT_PORTS];
394 
397 
400 
403 
404  PRIVATE:
405 
406  // ----------------------------------------------------------------------
407  // Mutexes
408  // ----------------------------------------------------------------------
409 
411  Os::Mutex m_guardedPortMutex;
412 
413  };
414 
415 }
416 
417 #endif
virtual ~UdpComponentBase()
Destroy UdpComponentBase object.
void send_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port send.
void recv_out(FwIndexType portNum, Fw::Buffer &buffer, const Drv::ByteStreamStatus &status)
Invoke output port recv.
FwIndexType getNum_allocate_OutputPorts() const
I32 FwEnumStoreType
friend class UdpTester
Friend class tester implementation to support white-box testing.
friend class UdpTesterBase
Friend class tester to support autocoded test harness.
bool isConnected_recv_OutputPort(FwIndexType portNum)
void set_recv_OutputPort(FwIndexType portNum, Drv::InputByteStreamDataPort *port)
Connect port to recv[portNum].
void set_sendReturnOut_OutputPort(FwIndexType portNum, Drv::InputByteStreamDataPort *port)
Connect port to sendReturnOut[portNum].
virtual void unLock()
Unlock the guarded mutex.
void init()
Object initializer.
Definition: ObjBase.cpp:26
FwIndexType getNum_ready_OutputPorts() const
bool isConnected_deallocate_OutputPort(FwIndexType portNum)
Status returned by the send call.
void deallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port deallocate.
bool isConnected_ready_OutputPort(FwIndexType portNum)
UdpComponentBase(const char *compName="")
Construct UdpComponentBase object.
virtual void send_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port send.
void set_deallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to deallocate[portNum].
Fw::InputBufferSendPort * get_send_InputPort(FwIndexType portNum)
Fw::Buffer allocate_out(FwIndexType portNum, U32 size)
Invoke output port allocate.
bool isConnected_sendReturnOut_OutputPort(FwIndexType portNum)
virtual void recvReturnIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port recvReturnIn.
void set_allocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to allocate[portNum].
bool isConnected_allocate_OutputPort(FwIndexType portNum)
FwIndexType getNum_recv_OutputPorts() const
PlatformIndexType FwIndexType
void set_ready_OutputPort(FwIndexType portNum, Drv::InputByteStreamReadyPort *port)
Connect port to ready[portNum].
Auto-generated base for Udp component.
Fw::InputBufferSendPort * get_recvReturnIn_InputPort(FwIndexType portNum)
void recvReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port recvReturnIn.
void ready_out(FwIndexType portNum)
Invoke output port ready.
FwIndexType getNum_deallocate_OutputPorts() const
virtual void lock()
Lock the guarded mutex.
void sendReturnOut_out(FwIndexType portNum, Fw::Buffer &buffer, const Drv::ByteStreamStatus &status)
Invoke output port sendReturnOut.
FwIndexType getNum_sendReturnOut_OutputPorts() const
FwIndexType getNum_send_InputPorts() const
FwIndexType getNum_recvReturnIn_InputPorts() const