F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
StreamCrossoverComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title StreamCrossoverComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for StreamCrossover component base class
5 // ======================================================================
6 
7 #ifndef Drv_StreamCrossoverComponentAc_HPP
8 #define Drv_StreamCrossoverComponentAc_HPP
9 
13 #include "FpConfig.hpp"
16 #include "Fw/Log/LogPortAc.hpp"
17 #include "Fw/Log/LogString.hpp"
18 #if FW_ENABLE_TEXT_LOGGING == 1
19 #include "Fw/Log/LogTextPortAc.hpp"
20 #endif
23 #include "Fw/Time/TimePortAc.hpp"
24 
25 namespace Drv {
26 
31  {
32 
33  // ----------------------------------------------------------------------
34  // Friend classes
35  // ----------------------------------------------------------------------
36 
39 
40  PROTECTED:
41 
42  // ----------------------------------------------------------------------
43  // Constants
44  // ----------------------------------------------------------------------
45 
47  enum {
49  };
50 
52  enum {
56  };
57 
59  enum {
62  };
63 
65  enum {
67  };
68 
69  public:
70 
71  // ----------------------------------------------------------------------
72  // Component initialization
73  // ----------------------------------------------------------------------
74 
76  void init(
77  FwEnumStoreType instance = 0
78  );
79 
80  public:
81 
82  // ----------------------------------------------------------------------
83  // Getters for typed input ports
84  // ----------------------------------------------------------------------
85 
90  FwIndexType portNum
91  );
92 
93  public:
94 
95  // ----------------------------------------------------------------------
96  // Connect input ports to special output ports
97  // ----------------------------------------------------------------------
98 
101  FwIndexType portNum,
102  Fw::InputLogPort* port
103  );
104 
105 #if FW_ENABLE_TEXT_LOGGING == 1
106 
108  void set_logTextOut_OutputPort(
109  FwIndexType portNum,
110  Fw::InputLogTextPort* port
111  );
112 
113 #endif
114 
117  FwIndexType portNum,
118  Fw::InputTimePort* port
119  );
120 
121  public:
122 
123  // ----------------------------------------------------------------------
124  // Connect typed input ports to typed output ports
125  // ----------------------------------------------------------------------
126 
129  FwIndexType portNum,
131  );
132 
135  FwIndexType portNum,
137  );
138 
139 #if FW_PORT_SERIALIZATION
140 
141  public:
142 
143  // ----------------------------------------------------------------------
144  // Connect serial input ports to special output ports
145  // ----------------------------------------------------------------------
146 
149  FwIndexType portNum,
150  Fw::InputSerializePort* port
151  );
152 
153 #if FW_ENABLE_TEXT_LOGGING == 1
154 
156  void set_logTextOut_OutputPort(
157  FwIndexType portNum,
158  Fw::InputSerializePort* port
159  );
160 
161 #endif
162 
165  FwIndexType portNum,
166  Fw::InputSerializePort* port
167  );
168 
169 #endif
170 
171 #if FW_PORT_SERIALIZATION
172 
173  public:
174 
175  // ----------------------------------------------------------------------
176  // Connect serial input ports to typed output ports
177  // ----------------------------------------------------------------------
178 
181  FwIndexType portNum,
182  Fw::InputSerializePort* port
183  );
184 
185 #endif
186 
187  PROTECTED:
188 
189  // ----------------------------------------------------------------------
190  // Component construction and destruction
191  // ----------------------------------------------------------------------
192 
195  const char* compName = ""
196  );
197 
200 
201  PROTECTED:
202 
203  // ----------------------------------------------------------------------
204  // Getters for numbers of typed input ports
205  // ----------------------------------------------------------------------
206 
211 
212  PROTECTED:
213 
214  // ----------------------------------------------------------------------
215  // Getters for numbers of special output ports
216  // ----------------------------------------------------------------------
217 
222 
223 #if FW_ENABLE_TEXT_LOGGING == 1
224 
228  FwIndexType getNum_logTextOut_OutputPorts() const;
229 
230 #endif
231 
236 
237  PROTECTED:
238 
239  // ----------------------------------------------------------------------
240  // Getters for numbers of typed output ports
241  // ----------------------------------------------------------------------
242 
247 
252 
253  PROTECTED:
254 
255  // ----------------------------------------------------------------------
256  // Connection status queries for special output ports
257  // ----------------------------------------------------------------------
258 
263  FwIndexType portNum
264  );
265 
266 #if FW_ENABLE_TEXT_LOGGING == 1
267 
271  bool isConnected_logTextOut_OutputPort(
272  FwIndexType portNum
273  );
274 
275 #endif
276 
281  FwIndexType portNum
282  );
283 
284  PROTECTED:
285 
286  // ----------------------------------------------------------------------
287  // Connection status queries for typed output ports
288  // ----------------------------------------------------------------------
289 
294  FwIndexType portNum
295  );
296 
301  FwIndexType portNum
302  );
303 
304  PROTECTED:
305 
306  // ----------------------------------------------------------------------
307  // Handlers to implement for typed input ports
308  // ----------------------------------------------------------------------
309 
311  virtual void streamIn_handler(
312  FwIndexType portNum,
313  Fw::Buffer& recvBuffer,
314  const Drv::RecvStatus& recvStatus
315  ) = 0;
316 
317  PROTECTED:
318 
319  // ----------------------------------------------------------------------
320  // Port handler base-class functions for typed input ports
321  //
322  // Call these functions directly to bypass the corresponding ports
323  // ----------------------------------------------------------------------
324 
327  FwIndexType portNum,
328  Fw::Buffer& recvBuffer,
329  const Drv::RecvStatus& recvStatus
330  );
331 
332  PROTECTED:
333 
334  // ----------------------------------------------------------------------
335  // Invocation functions for typed output ports
336  // ----------------------------------------------------------------------
337 
339  void errorDeallocate_out(
340  FwIndexType portNum,
341  Fw::Buffer& fwBuffer
342  );
343 
346  FwIndexType portNum,
347  Fw::Buffer& sendBuffer
348  );
349 
350  PROTECTED:
351 
352  // ----------------------------------------------------------------------
353  // Event logging functions
354  // ----------------------------------------------------------------------
355 
360 
361  PROTECTED:
362 
363  // ----------------------------------------------------------------------
364  // Time
365  // ----------------------------------------------------------------------
366 
370  Fw::Time getTime();
371 
372  PRIVATE:
373 
374  // ----------------------------------------------------------------------
375  // Calls for messages received on typed input ports
376  // ----------------------------------------------------------------------
377 
379  static void m_p_streamIn_in(
380  Fw::PassiveComponentBase* callComp,
381  FwIndexType portNum,
382  Fw::Buffer& recvBuffer,
383  const Drv::RecvStatus& recvStatus
384  );
385 
386  PRIVATE:
387 
388  // ----------------------------------------------------------------------
389  // Typed input ports
390  // ----------------------------------------------------------------------
391 
394 
395  PRIVATE:
396 
397  // ----------------------------------------------------------------------
398  // Special output ports
399  // ----------------------------------------------------------------------
400 
402  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
403 
404 #if FW_ENABLE_TEXT_LOGGING == 1
405 
407  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
408 
409 #endif
410 
412  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
413 
414  PRIVATE:
415 
416  // ----------------------------------------------------------------------
417  // Typed output ports
418  // ----------------------------------------------------------------------
419 
421  Fw::OutputBufferSendPort m_errorDeallocate_OutputPort[NUM_ERRORDEALLOCATE_OUTPUT_PORTS];
422 
425 
426  };
427 
428 }
429 
430 #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 StreamCrossover component.
void set_streamOut_OutputPort(FwIndexType portNum, Drv::InputByteStreamSendPort *port)
Connect port to streamOut[portNum].
void set_errorDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to errorDeallocate[portNum].
friend class StreamCrossoverComponentBaseFriend
Friend class for white-box testing.
void log_WARNING_HI_StreamOutError(Drv::SendStatus sendStatus)
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
@ EVENTID_STREAMOUTERROR
Indicates buffer failed to send to streamOut.
bool isConnected_logOut_OutputPort(FwIndexType portNum)
void errorDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port errorDeallocate.
bool isConnected_errorDeallocate_OutputPort(FwIndexType portNum)
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
virtual ~StreamCrossoverComponentBase()
Destroy StreamCrossoverComponentBase object.
Drv::InputByteStreamRecvPort * get_streamIn_InputPort(FwIndexType portNum)
Drv::SendStatus streamOut_out(FwIndexType portNum, Fw::Buffer &sendBuffer)
Invoke output port streamOut.
StreamCrossoverComponentBase(const char *compName="")
Construct StreamCrossoverComponentBase object.
void streamIn_handlerBase(FwIndexType portNum, Fw::Buffer &recvBuffer, const Drv::RecvStatus &recvStatus)
Handler base-class function for input port streamIn.
virtual void streamIn_handler(FwIndexType portNum, Fw::Buffer &recvBuffer, const Drv::RecvStatus &recvStatus)=0
Handler for input port streamIn.
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
bool isConnected_streamOut_OutputPort(FwIndexType portNum)
void init()
Object initializer.
Definition: ObjBase.cpp:27
Definition: Time.hpp:9