F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
TcpServerComponentAc.hpp
Go to the documentation of this file.
1// ======================================================================
2// \title TcpServerComponentAc.hpp
3// \author Generated by fpp-to-cpp
4// \brief hpp file for TcpServer component base class
5// ======================================================================
6
7#ifndef Drv_TcpServerComponentAc_HPP
8#define Drv_TcpServerComponentAc_HPP
9
13#include "FpConfig.hpp"
19#include "Os/Mutex.hpp"
20
21namespace Drv {
22
27 {
28
29 // ----------------------------------------------------------------------
30 // Friend classes
31 // ----------------------------------------------------------------------
32
35
36 PROTECTED:
37
38 // ----------------------------------------------------------------------
39 // Constants
40 // ----------------------------------------------------------------------
41
43 enum {
45 };
46
48 enum {
53 };
54
55 public:
56
57 // ----------------------------------------------------------------------
58 // Component initialization
59 // ----------------------------------------------------------------------
60
62 void init(
63 FwEnumStoreType instance = 0
64 );
65
66 public:
67
68 // ----------------------------------------------------------------------
69 // Getters for typed input ports
70 // ----------------------------------------------------------------------
71
76 FwIndexType portNum
77 );
78
79 public:
80
81 // ----------------------------------------------------------------------
82 // Connect typed input ports to typed output ports
83 // ----------------------------------------------------------------------
84
87 FwIndexType portNum,
89 );
90
93 FwIndexType portNum,
95 );
96
99 FwIndexType portNum,
101 );
102
105 FwIndexType portNum,
107 );
108
109#if FW_PORT_SERIALIZATION
110
111 public:
112
113 // ----------------------------------------------------------------------
114 // Connect serial input ports to typed output ports
115 // ----------------------------------------------------------------------
116
119 FwIndexType portNum,
120 Fw::InputSerializePort* port
121 );
122
125 FwIndexType portNum,
126 Fw::InputSerializePort* port
127 );
128
131 FwIndexType portNum,
132 Fw::InputSerializePort* port
133 );
134
135#endif
136
137 PROTECTED:
138
139 // ----------------------------------------------------------------------
140 // Component construction and destruction
141 // ----------------------------------------------------------------------
142
145 const char* compName = ""
146 );
147
149 virtual ~TcpServerComponentBase();
150
151 PROTECTED:
152
153 // ----------------------------------------------------------------------
154 // Getters for numbers of typed input ports
155 // ----------------------------------------------------------------------
156
161
162 PROTECTED:
163
164 // ----------------------------------------------------------------------
165 // Getters for numbers of typed output ports
166 // ----------------------------------------------------------------------
167
172
177
182
187
188 PROTECTED:
189
190 // ----------------------------------------------------------------------
191 // Connection status queries for typed output ports
192 // ----------------------------------------------------------------------
193
198 FwIndexType portNum
199 );
200
205 FwIndexType portNum
206 );
207
212 FwIndexType portNum
213 );
214
219 FwIndexType portNum
220 );
221
222 PROTECTED:
223
224 // ----------------------------------------------------------------------
225 // Handlers to implement for typed input ports
226 // ----------------------------------------------------------------------
227
230 FwIndexType portNum,
231 Fw::Buffer& sendBuffer
232 ) = 0;
233
234 PROTECTED:
235
236 // ----------------------------------------------------------------------
237 // Port handler base-class functions for typed input ports
238 //
239 // Call these functions directly to bypass the corresponding ports
240 // ----------------------------------------------------------------------
241
244 FwIndexType portNum,
245 Fw::Buffer& sendBuffer
246 );
247
248 PROTECTED:
249
250 // ----------------------------------------------------------------------
251 // Invocation functions for typed output ports
252 // ----------------------------------------------------------------------
253
256 FwIndexType portNum,
257 U32 size
258 );
259
261 void deallocate_out(
262 FwIndexType portNum,
263 Fw::Buffer& fwBuffer
264 );
265
267 void ready_out(
268 FwIndexType portNum
269 );
270
272 void recv_out(
273 FwIndexType portNum,
274 Fw::Buffer& recvBuffer,
275 const Drv::RecvStatus& recvStatus
276 );
277
278 PROTECTED:
279
280 // ----------------------------------------------------------------------
281 // Mutex operations for guarded ports
282 //
283 // You can override these operations to provide more sophisticated
284 // synchronization
285 // ----------------------------------------------------------------------
286
288 virtual void lock();
289
291 virtual void unLock();
292
293 PRIVATE:
294
295 // ----------------------------------------------------------------------
296 // Calls for messages received on typed input ports
297 // ----------------------------------------------------------------------
298
300 static Drv::SendStatus m_p_send_in(
301 Fw::PassiveComponentBase* callComp,
302 FwIndexType portNum,
303 Fw::Buffer& sendBuffer
304 );
305
306 PRIVATE:
307
308 // ----------------------------------------------------------------------
309 // Typed input ports
310 // ----------------------------------------------------------------------
311
314
315 PRIVATE:
316
317 // ----------------------------------------------------------------------
318 // Typed output ports
319 // ----------------------------------------------------------------------
320
323
326
329
332
333 PRIVATE:
334
335 // ----------------------------------------------------------------------
336 // Mutexes
337 // ----------------------------------------------------------------------
338
340 Os::Mutex m_guardedPortMutex;
341
342 };
343
344}
345
346#endif
I32 FwEnumStoreType
Definition FpConfig.h:64
PlatformIndexType FwIndexType
Definition FpConfig.h:25
C++-compatible configuration header for fprime configuration.
Status associated with the received data.
Status returned by the send call.
Auto-generated base for TcpServer component.
bool isConnected_allocate_OutputPort(FwIndexType portNum)
void set_deallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to deallocate[portNum].
FwIndexType getNum_send_InputPorts() const
virtual void unLock()
Unlock the guarded mutex.
void ready_out(FwIndexType portNum)
Invoke output port ready.
bool isConnected_deallocate_OutputPort(FwIndexType portNum)
Drv::SendStatus send_handlerBase(FwIndexType portNum, Fw::Buffer &sendBuffer)
Handler base-class function for input port send.
void deallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port deallocate.
Fw::Buffer allocate_out(FwIndexType portNum, U32 size)
Invoke output port allocate.
friend class TcpServerComponentBaseFriend
Friend class for white-box testing.
FwIndexType getNum_ready_OutputPorts() const
bool isConnected_recv_OutputPort(FwIndexType portNum)
virtual void lock()
Lock the guarded mutex.
virtual Drv::SendStatus send_handler(FwIndexType portNum, Fw::Buffer &sendBuffer)=0
Handler for input port send.
void recv_out(FwIndexType portNum, Fw::Buffer &recvBuffer, const Drv::RecvStatus &recvStatus)
Invoke output port recv.
void set_ready_OutputPort(FwIndexType portNum, Drv::InputByteStreamReadyPort *port)
Connect port to ready[portNum].
FwIndexType getNum_recv_OutputPorts() const
virtual ~TcpServerComponentBase()
Destroy TcpServerComponentBase object.
bool isConnected_ready_OutputPort(FwIndexType portNum)
FwIndexType getNum_deallocate_OutputPorts() const
FwIndexType getNum_allocate_OutputPorts() const
void set_recv_OutputPort(FwIndexType portNum, Drv::InputByteStreamRecvPort *port)
Connect port to recv[portNum].
void set_allocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to allocate[portNum].
Drv::InputByteStreamSendPort * get_send_InputPort(FwIndexType portNum)
void init()
Object initializer.
Definition ObjBase.cpp:27