F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
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 {
73  };
74 
76  enum {
78  };
79 
81  enum {
84  };
85 
86  public:
87 
88  // ----------------------------------------------------------------------
89  // Component initialization
90  // ----------------------------------------------------------------------
91 
93  void init(
94  FwQueueSizeType queueDepth,
95  FwEnumStoreType instance = 0
96  );
97 
98  public:
99 
100  // ----------------------------------------------------------------------
101  // Getters for typed input ports
102  // ----------------------------------------------------------------------
103 
108  FwIndexType portNum
109  );
110 
115  FwIndexType portNum
116  );
117 
122  FwIndexType portNum
123  );
124 
129  FwIndexType portNum
130  );
131 
132  public:
133 
134  // ----------------------------------------------------------------------
135  // Connect input ports to special output ports
136  // ----------------------------------------------------------------------
137 
139  void set_Log_OutputPort(
140  FwIndexType portNum,
141  Fw::InputLogPort* port
142  );
143 
144 #if FW_ENABLE_TEXT_LOGGING == 1
145 
147  void set_LogText_OutputPort(
148  FwIndexType portNum,
149  Fw::InputLogTextPort* port
150  );
151 
152 #endif
153 
155  void set_Time_OutputPort(
156  FwIndexType portNum,
157  Fw::InputTimePort* port
158  );
159 
161  void set_Tlm_OutputPort(
162  FwIndexType portNum,
163  Fw::InputTlmPort* port
164  );
165 
166  public:
167 
168  // ----------------------------------------------------------------------
169  // Connect typed input ports to typed output ports
170  // ----------------------------------------------------------------------
171 
174  FwIndexType portNum,
176  );
177 
180  FwIndexType portNum,
181  Fw::InputComPort* port
182  );
183 
184 #if FW_PORT_SERIALIZATION
185 
186  public:
187 
188  // ----------------------------------------------------------------------
189  // Connect serial input ports to special output ports
190  // ----------------------------------------------------------------------
191 
193  void set_Log_OutputPort(
194  FwIndexType portNum,
195  Fw::InputSerializePort* port
196  );
197 
198 #if FW_ENABLE_TEXT_LOGGING == 1
199 
201  void set_LogText_OutputPort(
202  FwIndexType portNum,
203  Fw::InputSerializePort* port
204  );
205 
206 #endif
207 
209  void set_Time_OutputPort(
210  FwIndexType portNum,
211  Fw::InputSerializePort* port
212  );
213 
215  void set_Tlm_OutputPort(
216  FwIndexType portNum,
217  Fw::InputSerializePort* port
218  );
219 
220 #endif
221 
222 #if FW_PORT_SERIALIZATION
223 
224  public:
225 
226  // ----------------------------------------------------------------------
227  // Connect serial input ports to typed output ports
228  // ----------------------------------------------------------------------
229 
232  FwIndexType portNum,
233  Fw::InputSerializePort* port
234  );
235 
238  FwIndexType portNum,
239  Fw::InputSerializePort* port
240  );
241 
242 #endif
243 
244  PROTECTED:
245 
246  // ----------------------------------------------------------------------
247  // Component construction and destruction
248  // ----------------------------------------------------------------------
249 
252  const char* compName = ""
253  );
254 
256  virtual ~ComQueueComponentBase();
257 
258  PROTECTED:
259 
260  // ----------------------------------------------------------------------
261  // Getters for numbers of typed input ports
262  // ----------------------------------------------------------------------
263 
268 
273 
278 
283 
284  PROTECTED:
285 
286  // ----------------------------------------------------------------------
287  // Getters for numbers of special output ports
288  // ----------------------------------------------------------------------
289 
294 
295 #if FW_ENABLE_TEXT_LOGGING == 1
296 
300  FwIndexType getNum_LogText_OutputPorts() const;
301 
302 #endif
303 
308 
313 
314  PROTECTED:
315 
316  // ----------------------------------------------------------------------
317  // Getters for numbers of typed output ports
318  // ----------------------------------------------------------------------
319 
324 
329 
330  PROTECTED:
331 
332  // ----------------------------------------------------------------------
333  // Connection status queries for special output ports
334  // ----------------------------------------------------------------------
335 
340  FwIndexType portNum
341  );
342 
343 #if FW_ENABLE_TEXT_LOGGING == 1
344 
348  bool isConnected_LogText_OutputPort(
349  FwIndexType portNum
350  );
351 
352 #endif
353 
358  FwIndexType portNum
359  );
360 
365  FwIndexType portNum
366  );
367 
368  PROTECTED:
369 
370  // ----------------------------------------------------------------------
371  // Connection status queries for typed output ports
372  // ----------------------------------------------------------------------
373 
378  FwIndexType portNum
379  );
380 
385  FwIndexType portNum
386  );
387 
388  PROTECTED:
389 
390  // ----------------------------------------------------------------------
391  // Handlers to implement for typed input ports
392  // ----------------------------------------------------------------------
393 
395  virtual void buffQueueIn_handler(
396  FwIndexType portNum,
397  Fw::Buffer& fwBuffer
398  ) = 0;
399 
401  virtual void comQueueIn_handler(
402  FwIndexType portNum,
403  Fw::ComBuffer& data,
404  U32 context
405  ) = 0;
406 
408  virtual void comStatusIn_handler(
409  FwIndexType portNum,
410  Fw::Success& condition
411  ) = 0;
412 
414  virtual void run_handler(
415  FwIndexType portNum,
416  U32 context
417  ) = 0;
418 
419  PROTECTED:
420 
421  // ----------------------------------------------------------------------
422  // Port handler base-class functions for typed input ports
423  //
424  // Call these functions directly to bypass the corresponding ports
425  // ----------------------------------------------------------------------
426 
429  FwIndexType portNum,
430  Fw::Buffer& fwBuffer
431  );
432 
435  FwIndexType portNum,
436  Fw::ComBuffer& data,
437  U32 context
438  );
439 
442  FwIndexType portNum,
443  Fw::Success& condition
444  );
445 
447  void run_handlerBase(
448  FwIndexType portNum,
449  U32 context
450  );
451 
452  PROTECTED:
453 
454  // ----------------------------------------------------------------------
455  // Pre-message hooks for typed async input ports
456  //
457  // Each of these functions is invoked just before processing a message
458  // on the corresponding port. By default, they do nothing. You can
459  // override them to provide specific pre-message behavior.
460  // ----------------------------------------------------------------------
461 
463  virtual void buffQueueIn_preMsgHook(
464  FwIndexType portNum,
465  Fw::Buffer& fwBuffer
466  );
467 
469  virtual void comQueueIn_preMsgHook(
470  FwIndexType portNum,
471  Fw::ComBuffer& data,
472  U32 context
473  );
474 
476  virtual void comStatusIn_preMsgHook(
477  FwIndexType portNum,
478  Fw::Success& condition
479  );
480 
482  virtual void run_preMsgHook(
483  FwIndexType portNum,
484  U32 context
485  );
486 
487  PROTECTED:
488 
489  // ----------------------------------------------------------------------
490  // Invocation functions for typed output ports
491  // ----------------------------------------------------------------------
492 
494  void buffQueueSend_out(
495  FwIndexType portNum,
496  Fw::Buffer& fwBuffer
497  );
498 
500  void comQueueSend_out(
501  FwIndexType portNum,
502  Fw::ComBuffer& data,
503  U32 context
504  );
505 
506  PROTECTED:
507 
508  // ----------------------------------------------------------------------
509  // Event logging functions
510  // ----------------------------------------------------------------------
511 
516  Svc::QueueType queueType,
517  U32 index
518  );
519 
520  PROTECTED:
521 
522  // ----------------------------------------------------------------------
523  // Telemetry write functions
524  // ----------------------------------------------------------------------
525 
530  const Svc::ComQueueDepth& arg,
531  Fw::Time _tlmTime = Fw::Time()
532  );
533 
538  const Svc::BuffQueueDepth& arg,
539  Fw::Time _tlmTime = Fw::Time()
540  );
541 
542  PROTECTED:
543 
544  // ----------------------------------------------------------------------
545  // Time
546  // ----------------------------------------------------------------------
547 
551  Fw::Time getTime();
552 
553  PRIVATE:
554 
555  // ----------------------------------------------------------------------
556  // Message dispatch functions
557  // ----------------------------------------------------------------------
558 
560  virtual MsgDispatchStatus doDispatch();
561 
562  PRIVATE:
563 
564  // ----------------------------------------------------------------------
565  // Calls for messages received on typed input ports
566  // ----------------------------------------------------------------------
567 
569  static void m_p_buffQueueIn_in(
570  Fw::PassiveComponentBase* callComp,
571  FwIndexType portNum,
572  Fw::Buffer& fwBuffer
573  );
574 
576  static void m_p_comQueueIn_in(
577  Fw::PassiveComponentBase* callComp,
578  FwIndexType portNum,
579  Fw::ComBuffer& data,
580  U32 context
581  );
582 
584  static void m_p_comStatusIn_in(
585  Fw::PassiveComponentBase* callComp,
586  FwIndexType portNum,
587  Fw::Success& condition
588  );
589 
591  static void m_p_run_in(
592  Fw::PassiveComponentBase* callComp,
593  FwIndexType portNum,
594  U32 context
595  );
596 
597  PRIVATE:
598 
599  // ----------------------------------------------------------------------
600  // Typed input ports
601  // ----------------------------------------------------------------------
602 
604  Fw::InputBufferSendPort m_buffQueueIn_InputPort[NUM_BUFFQUEUEIN_INPUT_PORTS];
605 
607  Fw::InputComPort m_comQueueIn_InputPort[NUM_COMQUEUEIN_INPUT_PORTS];
608 
611 
613  Svc::InputSchedPort m_run_InputPort[NUM_RUN_INPUT_PORTS];
614 
615  PRIVATE:
616 
617  // ----------------------------------------------------------------------
618  // Special output ports
619  // ----------------------------------------------------------------------
620 
622  Fw::OutputLogPort m_Log_OutputPort[NUM_LOG_OUTPUT_PORTS];
623 
624 #if FW_ENABLE_TEXT_LOGGING == 1
625 
627  Fw::OutputLogTextPort m_LogText_OutputPort[NUM_LOGTEXT_OUTPUT_PORTS];
628 
629 #endif
630 
632  Fw::OutputTimePort m_Time_OutputPort[NUM_TIME_OUTPUT_PORTS];
633 
635  Fw::OutputTlmPort m_Tlm_OutputPort[NUM_TLM_OUTPUT_PORTS];
636 
637  PRIVATE:
638 
639  // ----------------------------------------------------------------------
640  // Typed output ports
641  // ----------------------------------------------------------------------
642 
644  Fw::OutputBufferSendPort m_buffQueueSend_OutputPort[NUM_BUFFQUEUESEND_OUTPUT_PORTS];
645 
647  Fw::OutputComPort m_comQueueSend_OutputPort[NUM_COMQUEUESEND_OUTPUT_PORTS];
648 
649  };
650 
651 }
652 
653 #endif
I32 FwEnumStoreType
Definition: FpConfig.h:51
FwIndexType FwQueueSizeType
Definition: FpConfig.h:117
PlatformIndexType FwIndexType
Definition: FpConfig.h:20
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.
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())
@ EVENTID_QUEUEOVERFLOW
Queue overflow event.
friend class ComQueueComponentBaseFriend
Friend class for white-box testing.
FwIndexType getNum_buffQueueSend_OutputPorts() const
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)
@ CHANNELID_BUFFQUEUEDEPTH
Channel ID for buffQueueDepth.
@ CHANNELID_COMQUEUEDEPTH
Channel ID for comQueueDepth.
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.