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 UdpComponentBaseFriend;
35  friend class UdpTesterBase;
36 
37  PROTECTED:
38 
39  // ----------------------------------------------------------------------
40  // Constants
41  // ----------------------------------------------------------------------
42 
44  enum {
46  };
47 
49  enum {
54  };
55 
56  public:
57 
58  // ----------------------------------------------------------------------
59  // Component initialization
60  // ----------------------------------------------------------------------
61 
63  void init(
64  FwEnumStoreType instance = 0
65  );
66 
67  public:
68 
69  // ----------------------------------------------------------------------
70  // Getters for typed input ports
71  // ----------------------------------------------------------------------
72 
77  FwIndexType portNum
78  );
79 
80  public:
81 
82  // ----------------------------------------------------------------------
83  // Connect typed input ports to typed output ports
84  // ----------------------------------------------------------------------
85 
88  FwIndexType portNum,
90  );
91 
94  FwIndexType portNum,
96  );
97 
100  FwIndexType portNum,
102  );
103 
105  void set_recv_OutputPort(
106  FwIndexType portNum,
108  );
109 
110 #if FW_PORT_SERIALIZATION
111 
112  public:
113 
114  // ----------------------------------------------------------------------
115  // Connect serial input ports to typed output ports
116  // ----------------------------------------------------------------------
117 
120  FwIndexType portNum,
121  Fw::InputSerializePort* port
122  );
123 
126  FwIndexType portNum,
127  Fw::InputSerializePort* port
128  );
129 
131  void set_recv_OutputPort(
132  FwIndexType portNum,
133  Fw::InputSerializePort* port
134  );
135 
136 #endif
137 
138  PROTECTED:
139 
140  // ----------------------------------------------------------------------
141  // Component construction and destruction
142  // ----------------------------------------------------------------------
143 
146  const char* compName = ""
147  );
148 
150  virtual ~UdpComponentBase();
151 
152  PROTECTED:
153 
154  // ----------------------------------------------------------------------
155  // Getters for numbers of typed input ports
156  // ----------------------------------------------------------------------
157 
162 
163  PROTECTED:
164 
165  // ----------------------------------------------------------------------
166  // Getters for numbers of typed output ports
167  // ----------------------------------------------------------------------
168 
173 
178 
183 
188 
189  PROTECTED:
190 
191  // ----------------------------------------------------------------------
192  // Connection status queries for typed output ports
193  // ----------------------------------------------------------------------
194 
199  FwIndexType portNum
200  );
201 
206  FwIndexType portNum
207  );
208 
213  FwIndexType portNum
214  );
215 
220  FwIndexType portNum
221  );
222 
223  PROTECTED:
224 
225  // ----------------------------------------------------------------------
226  // Handlers to implement for typed input ports
227  // ----------------------------------------------------------------------
228 
230  virtual void send_handler(
231  FwIndexType portNum,
232  Fw::Buffer& fwBuffer
233  ) = 0;
234 
235  PROTECTED:
236 
237  // ----------------------------------------------------------------------
238  // Port handler base-class functions for typed input ports
239  //
240  // Call these functions directly to bypass the corresponding ports
241  // ----------------------------------------------------------------------
242 
244  void send_handlerBase(
245  FwIndexType portNum,
246  Fw::Buffer& fwBuffer
247  );
248 
249  PROTECTED:
250 
251  // ----------------------------------------------------------------------
252  // Invocation functions for typed output ports
253  // ----------------------------------------------------------------------
254 
257  FwIndexType portNum,
258  U32 size
259  );
260 
262  void dataReturnOut_out(
263  FwIndexType portNum,
264  Fw::Buffer& buffer,
265  const Drv::ByteStreamStatus& status
266  );
267 
269  void ready_out(
270  FwIndexType portNum
271  );
272 
274  void recv_out(
275  FwIndexType portNum,
276  Fw::Buffer& buffer,
277  const Drv::ByteStreamStatus& status
278  );
279 
280  PROTECTED:
281 
282  // ----------------------------------------------------------------------
283  // Mutex operations for guarded ports
284  //
285  // You can override these operations to provide more sophisticated
286  // synchronization
287  // ----------------------------------------------------------------------
288 
290  virtual void lock();
291 
293  virtual void unLock();
294 
295  PRIVATE:
296 
297  // ----------------------------------------------------------------------
298  // Calls for messages received on typed input ports
299  // ----------------------------------------------------------------------
300 
302  static void m_p_send_in(
303  Fw::PassiveComponentBase* callComp,
304  FwIndexType portNum,
305  Fw::Buffer& fwBuffer
306  );
307 
308  PRIVATE:
309 
310  // ----------------------------------------------------------------------
311  // Typed input ports
312  // ----------------------------------------------------------------------
313 
316 
317  PRIVATE:
318 
319  // ----------------------------------------------------------------------
320  // Typed output ports
321  // ----------------------------------------------------------------------
322 
324  Fw::OutputBufferGetPort m_allocate_OutputPort[NUM_ALLOCATE_OUTPUT_PORTS];
325 
328 
331 
334 
335  PRIVATE:
336 
337  // ----------------------------------------------------------------------
338  // Mutexes
339  // ----------------------------------------------------------------------
340 
342  Os::Mutex m_guardedPortMutex;
343 
344  };
345 
346 }
347 
348 #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
void set_dataReturnOut_OutputPort(FwIndexType portNum, Drv::InputByteStreamDataPort *port)
Connect port to dataReturnOut[portNum].
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].
virtual void unLock()
Unlock the guarded mutex.
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &buffer, const Drv::ByteStreamStatus &status)
Invoke output port dataReturnOut.
void init()
Object initializer.
Definition: ObjBase.cpp:26
FwIndexType getNum_ready_OutputPorts() const
friend class UdpComponentBaseFriend
Friend class for white-box testing.
Status returned by the send call.
FwIndexType getNum_dataReturnOut_OutputPorts() const
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.
Fw::InputBufferSendPort * get_send_InputPort(FwIndexType portNum)
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum)
Fw::Buffer allocate_out(FwIndexType portNum, U32 size)
Invoke output port allocate.
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.
void ready_out(FwIndexType portNum)
Invoke output port ready.
virtual void lock()
Lock the guarded mutex.
FwIndexType getNum_send_InputPorts() const