F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ComQueueComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title ComQueueComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for ComQueue component base class
5 // ======================================================================
6 
7 #ifndef Svc_ComQueueComponentAc_HPP
8 #define Svc_ComQueueComponentAc_HPP
9 
10 #include "FpConfig.hpp"
12 #include "Fw/Com/ComPortAc.hpp"
14 #include "Fw/Log/LogPortAc.hpp"
15 #include "Fw/Log/LogString.hpp"
16 #if FW_ENABLE_TEXT_LOGGING == 1
17 #include "Fw/Log/LogTextPortAc.hpp"
18 #endif
22 #include "Fw/Time/TimePortAc.hpp"
23 #include "Fw/Tlm/TlmPortAc.hpp"
24 #include "Fw/Tlm/TlmString.hpp"
29 
30 namespace Svc {
31 
38  {
39 
40  // ----------------------------------------------------------------------
41  // Friend classes
42  // ----------------------------------------------------------------------
43 
46 
47  PROTECTED:
48 
49  // ----------------------------------------------------------------------
50  // Constants
51  // ----------------------------------------------------------------------
52 
54  enum {
59  };
60 
62  enum {
67  };
68 
70  enum {
74  };
75 
77  enum {
79  };
80 
82  enum {
85  };
86 
87  public:
88 
89  // ----------------------------------------------------------------------
90  // Component initialization
91  // ----------------------------------------------------------------------
92 
94  void init(
95  FwSizeType queueDepth,
96  FwEnumStoreType instance = 0
97  );
98 
99  public:
100 
101  // ----------------------------------------------------------------------
102  // Getters for typed input ports
103  // ----------------------------------------------------------------------
104 
109  FwIndexType portNum
110  );
111 
116  FwIndexType portNum
117  );
118 
123  FwIndexType portNum
124  );
125 
130  FwIndexType portNum
131  );
132 
133  public:
134 
135  // ----------------------------------------------------------------------
136  // Connect input ports to special output ports
137  // ----------------------------------------------------------------------
138 
140  void set_Log_OutputPort(
141  FwIndexType portNum,
142  Fw::InputLogPort* port
143  );
144 
145 #if FW_ENABLE_TEXT_LOGGING == 1
146 
148  void set_LogText_OutputPort(
149  FwIndexType portNum,
150  Fw::InputLogTextPort* port
151  );
152 
153 #endif
154 
156  void set_Time_OutputPort(
157  FwIndexType portNum,
158  Fw::InputTimePort* port
159  );
160 
162  void set_Tlm_OutputPort(
163  FwIndexType portNum,
164  Fw::InputTlmPort* port
165  );
166 
167  public:
168 
169  // ----------------------------------------------------------------------
170  // Connect typed input ports to typed output ports
171  // ----------------------------------------------------------------------
172 
175  FwIndexType portNum,
177  );
178 
181  FwIndexType portNum,
182  Fw::InputComPort* port
183  );
184 
187  FwIndexType portNum,
189  );
190 
191 #if FW_PORT_SERIALIZATION
192 
193  public:
194 
195  // ----------------------------------------------------------------------
196  // Connect serial input ports to special output ports
197  // ----------------------------------------------------------------------
198 
200  void set_Log_OutputPort(
201  FwIndexType portNum,
202  Fw::InputSerializePort* port
203  );
204 
205 #if FW_ENABLE_TEXT_LOGGING == 1
206 
208  void set_LogText_OutputPort(
209  FwIndexType portNum,
210  Fw::InputSerializePort* port
211  );
212 
213 #endif
214 
216  void set_Time_OutputPort(
217  FwIndexType portNum,
218  Fw::InputSerializePort* port
219  );
220 
222  void set_Tlm_OutputPort(
223  FwIndexType portNum,
224  Fw::InputSerializePort* port
225  );
226 
227 #endif
228 
229 #if FW_PORT_SERIALIZATION
230 
231  public:
232 
233  // ----------------------------------------------------------------------
234  // Connect serial input ports to typed output ports
235  // ----------------------------------------------------------------------
236 
239  FwIndexType portNum,
240  Fw::InputSerializePort* port
241  );
242 
245  FwIndexType portNum,
246  Fw::InputSerializePort* port
247  );
248 
251  FwIndexType portNum,
252  Fw::InputSerializePort* port
253  );
254 
255 #endif
256 
257  PROTECTED:
258 
259  // ----------------------------------------------------------------------
260  // Component construction and destruction
261  // ----------------------------------------------------------------------
262 
265  const char* compName = ""
266  );
267 
269  virtual ~ComQueueComponentBase();
270 
271  PROTECTED:
272 
273  // ----------------------------------------------------------------------
274  // Getters for numbers of typed input ports
275  // ----------------------------------------------------------------------
276 
281 
286 
291 
296 
297  PROTECTED:
298 
299  // ----------------------------------------------------------------------
300  // Getters for numbers of special output ports
301  // ----------------------------------------------------------------------
302 
307 
308 #if FW_ENABLE_TEXT_LOGGING == 1
309 
313  FwIndexType getNum_LogText_OutputPorts() const;
314 
315 #endif
316 
321 
326 
327  PROTECTED:
328 
329  // ----------------------------------------------------------------------
330  // Getters for numbers of typed output ports
331  // ----------------------------------------------------------------------
332 
337 
342 
347 
348  PROTECTED:
349 
350  // ----------------------------------------------------------------------
351  // Connection status queries for special output ports
352  // ----------------------------------------------------------------------
353 
358  FwIndexType portNum
359  );
360 
361 #if FW_ENABLE_TEXT_LOGGING == 1
362 
366  bool isConnected_LogText_OutputPort(
367  FwIndexType portNum
368  );
369 
370 #endif
371 
376  FwIndexType portNum
377  );
378 
383  FwIndexType portNum
384  );
385 
386  PROTECTED:
387 
388  // ----------------------------------------------------------------------
389  // Connection status queries for typed output ports
390  // ----------------------------------------------------------------------
391 
396  FwIndexType portNum
397  );
398 
403  FwIndexType portNum
404  );
405 
410  FwIndexType portNum
411  );
412 
413  PROTECTED:
414 
415  // ----------------------------------------------------------------------
416  // Handlers to implement for typed input ports
417  // ----------------------------------------------------------------------
418 
420  virtual void buffQueueIn_handler(
421  FwIndexType portNum,
422  Fw::Buffer& fwBuffer
423  ) = 0;
424 
426  virtual void comQueueIn_handler(
427  FwIndexType portNum,
428  Fw::ComBuffer& data,
429  U32 context
430  ) = 0;
431 
433  virtual void comStatusIn_handler(
434  FwIndexType portNum,
435  Fw::Success& condition
436  ) = 0;
437 
439  virtual void run_handler(
440  FwIndexType portNum,
441  U32 context
442  ) = 0;
443 
444  PROTECTED:
445 
446  // ----------------------------------------------------------------------
447  // Port handler base-class functions for typed input ports
448  //
449  // Call these functions directly to bypass the corresponding ports
450  // ----------------------------------------------------------------------
451 
454  FwIndexType portNum,
455  Fw::Buffer& fwBuffer
456  );
457 
460  FwIndexType portNum,
461  Fw::ComBuffer& data,
462  U32 context
463  );
464 
467  FwIndexType portNum,
468  Fw::Success& condition
469  );
470 
472  void run_handlerBase(
473  FwIndexType portNum,
474  U32 context
475  );
476 
477  PROTECTED:
478 
479  // ----------------------------------------------------------------------
480  // Pre-message hooks for typed async input ports
481  //
482  // Each of these functions is invoked just before processing a message
483  // on the corresponding port. By default, they do nothing. You can
484  // override them to provide specific pre-message behavior.
485  // ----------------------------------------------------------------------
486 
488  virtual void buffQueueIn_preMsgHook(
489  FwIndexType portNum,
490  Fw::Buffer& fwBuffer
491  );
492 
494  virtual void comQueueIn_preMsgHook(
495  FwIndexType portNum,
496  Fw::ComBuffer& data,
497  U32 context
498  );
499 
501  virtual void comStatusIn_preMsgHook(
502  FwIndexType portNum,
503  Fw::Success& condition
504  );
505 
507  virtual void run_preMsgHook(
508  FwIndexType portNum,
509  U32 context
510  );
511 
512  PROTECTED:
513 
514  // ----------------------------------------------------------------------
515  // Hooks for typed async input ports
516  //
517  // Each of these functions is invoked when placing a message on the
518  // queue would cause the queue to overlow. You should override them to provide
519  // specific overflow behavior.
520  // ----------------------------------------------------------------------
521 
524  FwIndexType portNum,
525  Fw::Buffer& fwBuffer
526  ) = 0;
527 
528  PROTECTED:
529 
530  // ----------------------------------------------------------------------
531  // Invocation functions for typed output ports
532  // ----------------------------------------------------------------------
533 
535  void buffQueueSend_out(
536  FwIndexType portNum,
537  Fw::Buffer& fwBuffer
538  );
539 
541  void comQueueSend_out(
542  FwIndexType portNum,
543  Fw::ComBuffer& data,
544  U32 context
545  );
546 
548  void deallocate_out(
549  FwIndexType portNum,
550  Fw::Buffer& fwBuffer
551  );
552 
553  PROTECTED:
554 
555  // ----------------------------------------------------------------------
556  // Event logging functions
557  // ----------------------------------------------------------------------
558 
563  Svc::QueueType queueType,
564  U32 index
565  );
566 
567  PROTECTED:
568 
569  // ----------------------------------------------------------------------
570  // Telemetry write functions
571  // ----------------------------------------------------------------------
572 
577  const Svc::ComQueueDepth& arg,
578  Fw::Time _tlmTime = Fw::Time()
579  );
580 
585  const Svc::BuffQueueDepth& arg,
586  Fw::Time _tlmTime = Fw::Time()
587  );
588 
589  PROTECTED:
590 
591  // ----------------------------------------------------------------------
592  // Time
593  // ----------------------------------------------------------------------
594 
598  Fw::Time getTime();
599 
600  PRIVATE:
601 
602  // ----------------------------------------------------------------------
603  // Message dispatch functions
604  // ----------------------------------------------------------------------
605 
607  virtual MsgDispatchStatus doDispatch();
608 
609  PRIVATE:
610 
611  // ----------------------------------------------------------------------
612  // Calls for messages received on typed input ports
613  // ----------------------------------------------------------------------
614 
616  static void m_p_buffQueueIn_in(
617  Fw::PassiveComponentBase* callComp,
618  FwIndexType portNum,
619  Fw::Buffer& fwBuffer
620  );
621 
623  static void m_p_comQueueIn_in(
624  Fw::PassiveComponentBase* callComp,
625  FwIndexType portNum,
626  Fw::ComBuffer& data,
627  U32 context
628  );
629 
631  static void m_p_comStatusIn_in(
632  Fw::PassiveComponentBase* callComp,
633  FwIndexType portNum,
634  Fw::Success& condition
635  );
636 
638  static void m_p_run_in(
639  Fw::PassiveComponentBase* callComp,
640  FwIndexType portNum,
641  U32 context
642  );
643 
644  PRIVATE:
645 
646  // ----------------------------------------------------------------------
647  // Typed input ports
648  // ----------------------------------------------------------------------
649 
651  Fw::InputBufferSendPort m_buffQueueIn_InputPort[NUM_BUFFQUEUEIN_INPUT_PORTS];
652 
654  Fw::InputComPort m_comQueueIn_InputPort[NUM_COMQUEUEIN_INPUT_PORTS];
655 
658 
660  Svc::InputSchedPort m_run_InputPort[NUM_RUN_INPUT_PORTS];
661 
662  PRIVATE:
663 
664  // ----------------------------------------------------------------------
665  // Special output ports
666  // ----------------------------------------------------------------------
667 
669  Fw::OutputLogPort m_Log_OutputPort[NUM_LOG_OUTPUT_PORTS];
670 
671 #if FW_ENABLE_TEXT_LOGGING == 1
672 
674  Fw::OutputLogTextPort m_LogText_OutputPort[NUM_LOGTEXT_OUTPUT_PORTS];
675 
676 #endif
677 
679  Fw::OutputTimePort m_Time_OutputPort[NUM_TIME_OUTPUT_PORTS];
680 
682  Fw::OutputTlmPort m_Tlm_OutputPort[NUM_TLM_OUTPUT_PORTS];
683 
684  PRIVATE:
685 
686  // ----------------------------------------------------------------------
687  // Typed output ports
688  // ----------------------------------------------------------------------
689 
691  Fw::OutputBufferSendPort m_buffQueueSend_OutputPort[NUM_BUFFQUEUESEND_OUTPUT_PORTS];
692 
694  Fw::OutputComPort m_comQueueSend_OutputPort[NUM_COMQUEUESEND_OUTPUT_PORTS];
695 
697  Fw::OutputBufferSendPort m_deallocate_OutputPort[NUM_DEALLOCATE_OUTPUT_PORTS];
698 
699  };
700 
701 }
702 
703 #endif
I32 FwEnumStoreType
Definition: FpConfig.h:64
PlatformSizeType FwSizeType
Definition: FpConfig.h:35
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
C++-compatible configuration header for fprime configuration.
void init()
Object initializer.
Definition: ObjBase.cpp:27
Success/Failure.
Definition: Time.hpp:9
Array of queue depths for Fw::Buffer types.
Auto-generated base for ComQueue component.
virtual void comStatusIn_preMsgHook(FwIndexType portNum, Fw::Success &condition)
Pre-message hook for async input port comStatusIn.
FwIndexType getNum_Time_OutputPorts() const
virtual void comQueueIn_preMsgHook(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Pre-message hook for async input port comQueueIn.
void deallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port deallocate.
bool isConnected_comQueueSend_OutputPort(FwIndexType portNum)
void tlmWrite_comQueueDepth(const Svc::ComQueueDepth &arg, Fw::Time _tlmTime=Fw::Time())
virtual void run_handler(FwIndexType portNum, U32 context)=0
Handler for input port run.
FwIndexType getNum_comQueueSend_OutputPorts() const
FwIndexType getNum_buffQueueIn_InputPorts() const
void tlmWrite_buffQueueDepth(const Svc::BuffQueueDepth &arg, Fw::Time _tlmTime=Fw::Time())
friend class ComQueueComponentBaseFriend
Friend class for white-box testing.
FwIndexType getNum_deallocate_OutputPorts() const
FwIndexType getNum_buffQueueSend_OutputPorts() const
@ CHANNELID_BUFFQUEUEDEPTH
Channel ID for buffQueueDepth.
@ CHANNELID_COMQUEUEDEPTH
Channel ID for comQueueDepth.
void comStatusIn_handlerBase(FwIndexType portNum, Fw::Success &condition)
Handler base-class function for input port comStatusIn.
void buffQueueIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port buffQueueIn.
ComQueueComponentBase(const char *compName="")
Construct ComQueueComponentBase object.
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
void run_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port run.
FwIndexType getNum_comStatusIn_InputPorts() const
void buffQueueSend_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port buffQueueSend.
virtual void buffQueueIn_preMsgHook(FwIndexType portNum, Fw::Buffer &fwBuffer)
Pre-message hook for async input port buffQueueIn.
FwIndexType getNum_comQueueIn_InputPorts() const
FwIndexType getNum_run_InputPorts() const
void comQueueSend_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port comQueueSend.
virtual void buffQueueIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port buffQueueIn.
Fw::InputBufferSendPort * get_buffQueueIn_InputPort(FwIndexType portNum)
virtual ~ComQueueComponentBase()
Destroy ComQueueComponentBase object.
bool isConnected_Log_OutputPort(FwIndexType portNum)
bool isConnected_buffQueueSend_OutputPort(FwIndexType portNum)
void set_deallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to deallocate[portNum].
@ EVENTID_QUEUEOVERFLOW
Queue overflow event.
bool isConnected_deallocate_OutputPort(FwIndexType portNum)
virtual void buffQueueIn_overflowHook(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Overflow hook for async input port buffQueueIn.
void set_buffQueueSend_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to buffQueueSend[portNum].
FwIndexType getNum_Log_OutputPorts() const
virtual void comQueueIn_handler(FwIndexType portNum, Fw::ComBuffer &data, U32 context)=0
Handler for input port comQueueIn.
void comQueueIn_handlerBase(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Handler base-class function for input port comQueueIn.
Fw::InputSuccessConditionPort * get_comStatusIn_InputPort(FwIndexType portNum)
FwIndexType getNum_Tlm_OutputPorts() const
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
void log_WARNING_HI_QueueOverflow(Svc::QueueType queueType, U32 index)
bool isConnected_Tlm_OutputPort(FwIndexType portNum)
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
Svc::InputSchedPort * get_run_InputPort(FwIndexType portNum)
virtual void run_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port run.
virtual void comStatusIn_handler(FwIndexType portNum, Fw::Success &condition)=0
Handler for input port comStatusIn.
bool isConnected_Time_OutputPort(FwIndexType portNum)
Fw::InputComPort * get_comQueueIn_InputPort(FwIndexType portNum)
void set_comQueueSend_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to comQueueSend[portNum].
Array of queue depths for Fw::Com types.
An enumeration of queue data types.