F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FprimeDeframerComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FprimeDeframerComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for FprimeDeframer component base class
5 // ======================================================================
6 
7 #ifndef Svc_FprimeDeframerComponentAc_HPP
8 #define Svc_FprimeDeframerComponentAc_HPP
9 
10 #include <atomic>
11 
14 #include "Fw/FPrimeBasicTypes.hpp"
15 #include "Fw/Log/LogPortAc.hpp"
16 #include "Fw/Log/LogString.hpp"
17 #if FW_ENABLE_TEXT_LOGGING == 1
18 #include "Fw/Log/LogTextPortAc.hpp"
19 #endif
22 #include "Fw/Time/TimePortAc.hpp"
23 #include "Os/Mutex.hpp"
25 
26 namespace Svc {
27 
35  {
36 
37  // ----------------------------------------------------------------------
38  // Friend classes
39  // ----------------------------------------------------------------------
40 
45 
46  PROTECTED:
47 
48  // ----------------------------------------------------------------------
49  // Constants
50  // ----------------------------------------------------------------------
51 
53  enum {
55  };
56 
58  enum {
62  };
63 
65  enum {
68  };
69 
71  enum {
76  };
77 
78  public:
79 
80  // ----------------------------------------------------------------------
81  // Component initialization
82  // ----------------------------------------------------------------------
83 
85  void init(
86  FwEnumStoreType instance = 0
87  );
88 
89  public:
90 
91  // ----------------------------------------------------------------------
92  // Getters for typed input ports
93  // ----------------------------------------------------------------------
94 
99  FwIndexType portNum
100  );
101 
102  public:
103 
104  // ----------------------------------------------------------------------
105  // Connect input ports to special output ports
106  // ----------------------------------------------------------------------
107 
110  FwIndexType portNum,
111  Fw::InputLogPort* port
112  );
113 
114 #if FW_ENABLE_TEXT_LOGGING == 1
115 
117  void set_logTextOut_OutputPort(
118  FwIndexType portNum,
119  Fw::InputLogTextPort* port
120  );
121 
122 #endif
123 
126  FwIndexType portNum,
127  Fw::InputTimePort* port
128  );
129 
130  public:
131 
132  // ----------------------------------------------------------------------
133  // Connect typed input ports to typed output ports
134  // ----------------------------------------------------------------------
135 
138  FwIndexType portNum,
140  );
141 
144  FwIndexType portNum,
146  );
147 
148 #if FW_PORT_SERIALIZATION
149 
150  public:
151 
152  // ----------------------------------------------------------------------
153  // Connect serial input ports to special output ports
154  // ----------------------------------------------------------------------
155 
158  FwIndexType portNum,
159  Fw::InputSerializePort* port
160  );
161 
162 #if FW_ENABLE_TEXT_LOGGING == 1
163 
165  void set_logTextOut_OutputPort(
166  FwIndexType portNum,
167  Fw::InputSerializePort* port
168  );
169 
170 #endif
171 
174  FwIndexType portNum,
175  Fw::InputSerializePort* port
176  );
177 
178 #endif
179 
180 #if FW_PORT_SERIALIZATION
181 
182  public:
183 
184  // ----------------------------------------------------------------------
185  // Connect serial input ports to typed output ports
186  // ----------------------------------------------------------------------
187 
190  FwIndexType portNum,
191  Fw::InputSerializePort* port
192  );
193 
196  FwIndexType portNum,
197  Fw::InputSerializePort* port
198  );
199 
200 #endif
201 
202  PROTECTED:
203 
204  // ----------------------------------------------------------------------
205  // Component construction and destruction
206  // ----------------------------------------------------------------------
207 
210  const char* compName = ""
211  );
212 
215 
216  PROTECTED:
217 
218  // ----------------------------------------------------------------------
219  // Getters for numbers of typed input ports
220  // ----------------------------------------------------------------------
221 
226 
227  PROTECTED:
228 
229  // ----------------------------------------------------------------------
230  // Getters for numbers of special output ports
231  // ----------------------------------------------------------------------
232 
237 
238 #if FW_ENABLE_TEXT_LOGGING == 1
239 
243  FwIndexType getNum_logTextOut_OutputPorts() const;
244 
245 #endif
246 
251 
252  PROTECTED:
253 
254  // ----------------------------------------------------------------------
255  // Getters for numbers of typed output ports
256  // ----------------------------------------------------------------------
257 
262 
267 
268  PROTECTED:
269 
270  // ----------------------------------------------------------------------
271  // Connection status queries for special output ports
272  // ----------------------------------------------------------------------
273 
278  FwIndexType portNum
279  );
280 
281 #if FW_ENABLE_TEXT_LOGGING == 1
282 
286  bool isConnected_logTextOut_OutputPort(
287  FwIndexType portNum
288  );
289 
290 #endif
291 
296  FwIndexType portNum
297  );
298 
299  PROTECTED:
300 
301  // ----------------------------------------------------------------------
302  // Connection status queries for typed output ports
303  // ----------------------------------------------------------------------
304 
309  FwIndexType portNum
310  );
311 
316  FwIndexType portNum
317  );
318 
319  PROTECTED:
320 
321  // ----------------------------------------------------------------------
322  // Handlers to implement for typed input ports
323  // ----------------------------------------------------------------------
324 
326  virtual void framedIn_handler(
327  FwIndexType portNum,
328  Fw::Buffer& data,
329  const ComCfg::FrameContext& context
330  ) = 0;
331 
332  PROTECTED:
333 
334  // ----------------------------------------------------------------------
335  // Port handler base-class functions for typed input ports
336  //
337  // Call these functions directly to bypass the corresponding ports
338  // ----------------------------------------------------------------------
339 
342  FwIndexType portNum,
343  Fw::Buffer& data,
344  const ComCfg::FrameContext& context
345  );
346 
347  PROTECTED:
348 
349  // ----------------------------------------------------------------------
350  // Invocation functions for typed output ports
351  // ----------------------------------------------------------------------
352 
355  FwIndexType portNum,
356  Fw::Buffer& fwBuffer
357  );
358 
360  void deframedOut_out(
361  FwIndexType portNum,
362  Fw::Buffer& data,
363  const ComCfg::FrameContext& context
364  );
365 
366  PROTECTED:
367 
368  // ----------------------------------------------------------------------
369  // Event logging functions
370  // ----------------------------------------------------------------------
371 
376 
380  void log_WARNING_HI_InvalidStartWord() const;
381 
386 
390  void log_WARNING_HI_InvalidChecksum() const;
391 
392  PROTECTED:
393 
394  // ----------------------------------------------------------------------
395  // Time
396  // ----------------------------------------------------------------------
397 
401  Fw::Time getTime() const;
402 
403  PROTECTED:
404 
405  // ----------------------------------------------------------------------
406  // Mutex operations for guarded ports
407  //
408  // You can override these operations to provide more sophisticated
409  // synchronization
410  // ----------------------------------------------------------------------
411 
413  virtual void lock();
414 
416  virtual void unLock();
417 
418  PRIVATE:
419 
420  // ----------------------------------------------------------------------
421  // Calls for messages received on typed input ports
422  // ----------------------------------------------------------------------
423 
425  static void m_p_framedIn_in(
426  Fw::PassiveComponentBase* callComp,
427  FwIndexType portNum,
428  Fw::Buffer& data,
429  const ComCfg::FrameContext& context
430  );
431 
432  PRIVATE:
433 
434  // ----------------------------------------------------------------------
435  // Typed input ports
436  // ----------------------------------------------------------------------
437 
440 
441  PRIVATE:
442 
443  // ----------------------------------------------------------------------
444  // Special output ports
445  // ----------------------------------------------------------------------
446 
448  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
449 
450 #if FW_ENABLE_TEXT_LOGGING == 1
451 
453  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
454 
455 #endif
456 
458  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
459 
460  PRIVATE:
461 
462  // ----------------------------------------------------------------------
463  // Typed output ports
464  // ----------------------------------------------------------------------
465 
467  Fw::OutputBufferSendPort m_bufferDeallocate_OutputPort[NUM_BUFFERDEALLOCATE_OUTPUT_PORTS];
468 
471 
472  PRIVATE:
473 
474  // ----------------------------------------------------------------------
475  // Mutexes
476  // ----------------------------------------------------------------------
477 
479  Os::Mutex m_guardedPortMutex;
480 
481  };
482 
483 }
484 
485 #endif
bool isConnected_logOut_OutputPort(FwIndexType portNum)
Definition: Time.hpp:9
void set_deframedOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to deframedOut[portNum].
bool isConnected_bufferDeallocate_OutputPort(FwIndexType portNum)
bool isConnected_deframedOut_OutputPort(FwIndexType portNum)
I32 FwEnumStoreType
Svc::InputComDataWithContextPort * get_framedIn_InputPort(FwIndexType portNum)
friend class FprimeDeframerComponentBaseFriend
Friend class for white-box testing.
void init()
Object initializer.
Definition: ObjBase.cpp:26
An invalid frame was received (start word is wrong)
void bufferDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port bufferDeallocate.
An invalid frame was received (too short to be a frame)
FprimeDeframerComponentBase(const char *compName="")
Construct FprimeDeframerComponentBase object.
void set_bufferDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to bufferDeallocate[portNum].
An invalid frame was received (checksum mismatch)
Auto-generated base for FprimeDeframer component.
friend class FprimeDeframerTesterBase
Friend class tester to support autocoded test harness.
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
void deframedOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port deframedOut.
virtual ~FprimeDeframerComponentBase()
Destroy FprimeDeframerComponentBase object.
virtual void lock()
Lock the guarded mutex.
virtual void framedIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port framedIn.
PlatformIndexType FwIndexType
void framedIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port framedIn.
Type used to pass context info between components during framing/deframing.
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
RateGroupDivider component implementation.
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
virtual void unLock()
Unlock the guarded mutex.