F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
ComQueueComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title ComQueueComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for ComQueue component base class
5 // ======================================================================
6 
8 #include "Fw/Types/Assert.hpp"
10 #if FW_ENABLE_TEXT_LOGGING
11 #include "Fw/Types/String.hpp"
12 #endif
13 
14 namespace Svc {
15 
16  namespace {
17  enum MsgTypeEnum {
18  COMQUEUE_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
19  BUFFQUEUEIN_BUFFERSEND,
20  COMQUEUEIN_COM,
21  COMSTATUSIN_SUCCESSCONDITION,
22  RUN_SCHED,
23  };
24 
25  // Get the max size by constructing a union of the async input, command, and
26  // internal port serialization sizes
27  union BuffUnion {
29  BYTE comQueueInPortSize[Fw::InputComPort::SERIALIZED_SIZE];
32  };
33 
34  // Define a message buffer class large enough to handle all the
35  // asynchronous inputs to the component
36  class ComponentIpcSerializableBuffer :
38  {
39 
40  public:
41 
42  enum {
43  // Max. message size = size of data + message id + port
44  SERIALIZATION_SIZE =
45  sizeof(BuffUnion) +
46  sizeof(FwEnumStoreType) +
47  sizeof(FwIndexType)
48  };
49 
50  Fw::Serializable::SizeType getBuffCapacity() const {
51  return sizeof(m_buff);
52  }
53 
54  U8* getBuffAddr() {
55  return m_buff;
56  }
57 
58  const U8* getBuffAddr() const {
59  return m_buff;
60  }
61 
62  private:
63  // Should be the max of all the input ports serialized sizes...
64  U8 m_buff[SERIALIZATION_SIZE];
65 
66  };
67  }
68 
69  // ----------------------------------------------------------------------
70  // Component initialization
71  // ----------------------------------------------------------------------
72 
74  init(
75  FwQueueSizeType queueDepth,
76  FwEnumStoreType instance
77  )
78  {
79  // Initialize base class
81 
82  // Connect input port buffQueueIn
83  for (
84  FwIndexType port = 0;
85  port < static_cast<FwIndexType>(this->getNum_buffQueueIn_InputPorts());
86  port++
87  ) {
88  this->m_buffQueueIn_InputPort[port].init();
89  this->m_buffQueueIn_InputPort[port].addCallComp(
90  this,
91  m_p_buffQueueIn_in
92  );
93  this->m_buffQueueIn_InputPort[port].setPortNum(port);
94 
95 #if FW_OBJECT_NAMES == 1
96  Fw::ObjectName portName;
97  portName.format(
98  "%s_buffQueueIn_InputPort[%" PRI_PlatformIntType "]",
99  this->m_objName.toChar(),
100  port
101  );
102  this->m_buffQueueIn_InputPort[port].setObjName(portName.toChar());
103 #endif
104  }
105 
106  // Connect input port comQueueIn
107  for (
108  FwIndexType port = 0;
109  port < static_cast<FwIndexType>(this->getNum_comQueueIn_InputPorts());
110  port++
111  ) {
112  this->m_comQueueIn_InputPort[port].init();
113  this->m_comQueueIn_InputPort[port].addCallComp(
114  this,
115  m_p_comQueueIn_in
116  );
117  this->m_comQueueIn_InputPort[port].setPortNum(port);
118 
119 #if FW_OBJECT_NAMES == 1
120  Fw::ObjectName portName;
121  portName.format(
122  "%s_comQueueIn_InputPort[%" PRI_PlatformIntType "]",
123  this->m_objName.toChar(),
124  port
125  );
126  this->m_comQueueIn_InputPort[port].setObjName(portName.toChar());
127 #endif
128  }
129 
130  // Connect input port comStatusIn
131  for (
132  FwIndexType port = 0;
133  port < static_cast<FwIndexType>(this->getNum_comStatusIn_InputPorts());
134  port++
135  ) {
136  this->m_comStatusIn_InputPort[port].init();
137  this->m_comStatusIn_InputPort[port].addCallComp(
138  this,
139  m_p_comStatusIn_in
140  );
141  this->m_comStatusIn_InputPort[port].setPortNum(port);
142 
143 #if FW_OBJECT_NAMES == 1
144  Fw::ObjectName portName;
145  portName.format(
146  "%s_comStatusIn_InputPort[%" PRI_PlatformIntType "]",
147  this->m_objName.toChar(),
148  port
149  );
150  this->m_comStatusIn_InputPort[port].setObjName(portName.toChar());
151 #endif
152  }
153 
154  // Connect input port run
155  for (
156  FwIndexType port = 0;
157  port < static_cast<FwIndexType>(this->getNum_run_InputPorts());
158  port++
159  ) {
160  this->m_run_InputPort[port].init();
161  this->m_run_InputPort[port].addCallComp(
162  this,
163  m_p_run_in
164  );
165  this->m_run_InputPort[port].setPortNum(port);
166 
167 #if FW_OBJECT_NAMES == 1
168  Fw::ObjectName portName;
169  portName.format(
170  "%s_run_InputPort[%" PRI_PlatformIntType "]",
171  this->m_objName.toChar(),
172  port
173  );
174  this->m_run_InputPort[port].setObjName(portName.toChar());
175 #endif
176  }
177 
178  // Connect output port Log
179  for (
180  FwIndexType port = 0;
181  port < static_cast<FwIndexType>(this->getNum_Log_OutputPorts());
182  port++
183  ) {
184  this->m_Log_OutputPort[port].init();
185 
186 #if FW_OBJECT_NAMES == 1
187  Fw::ObjectName portName;
188  portName.format(
189  "%s_Log_OutputPort[%" PRI_PlatformIntType "]",
190  this->m_objName.toChar(),
191  port
192  );
193  this->m_Log_OutputPort[port].setObjName(portName.toChar());
194 #endif
195  }
196 
197 #if FW_ENABLE_TEXT_LOGGING == 1
198  // Connect output port LogText
199  for (
200  FwIndexType port = 0;
201  port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
202  port++
203  ) {
204  this->m_LogText_OutputPort[port].init();
205 
206 #if FW_OBJECT_NAMES == 1
207  Fw::ObjectName portName;
208  portName.format(
209  "%s_LogText_OutputPort[%" PRI_PlatformIntType "]",
210  this->m_objName.toChar(),
211  port
212  );
213  this->m_LogText_OutputPort[port].setObjName(portName.toChar());
214 #endif
215  }
216 #endif
217 
218  // Connect output port Time
219  for (
220  FwIndexType port = 0;
221  port < static_cast<FwIndexType>(this->getNum_Time_OutputPorts());
222  port++
223  ) {
224  this->m_Time_OutputPort[port].init();
225 
226 #if FW_OBJECT_NAMES == 1
227  Fw::ObjectName portName;
228  portName.format(
229  "%s_Time_OutputPort[%" PRI_PlatformIntType "]",
230  this->m_objName.toChar(),
231  port
232  );
233  this->m_Time_OutputPort[port].setObjName(portName.toChar());
234 #endif
235  }
236 
237  // Connect output port Tlm
238  for (
239  FwIndexType port = 0;
240  port < static_cast<FwIndexType>(this->getNum_Tlm_OutputPorts());
241  port++
242  ) {
243  this->m_Tlm_OutputPort[port].init();
244 
245 #if FW_OBJECT_NAMES == 1
246  Fw::ObjectName portName;
247  portName.format(
248  "%s_Tlm_OutputPort[%" PRI_PlatformIntType "]",
249  this->m_objName.toChar(),
250  port
251  );
252  this->m_Tlm_OutputPort[port].setObjName(portName.toChar());
253 #endif
254  }
255 
256  // Connect output port buffQueueSend
257  for (
258  FwIndexType port = 0;
259  port < static_cast<FwIndexType>(this->getNum_buffQueueSend_OutputPorts());
260  port++
261  ) {
262  this->m_buffQueueSend_OutputPort[port].init();
263 
264 #if FW_OBJECT_NAMES == 1
265  Fw::ObjectName portName;
266  portName.format(
267  "%s_buffQueueSend_OutputPort[%" PRI_PlatformIntType "]",
268  this->m_objName.toChar(),
269  port
270  );
271  this->m_buffQueueSend_OutputPort[port].setObjName(portName.toChar());
272 #endif
273  }
274 
275  // Connect output port comQueueSend
276  for (
277  FwIndexType port = 0;
278  port < static_cast<FwIndexType>(this->getNum_comQueueSend_OutputPorts());
279  port++
280  ) {
281  this->m_comQueueSend_OutputPort[port].init();
282 
283 #if FW_OBJECT_NAMES == 1
284  Fw::ObjectName portName;
285  portName.format(
286  "%s_comQueueSend_OutputPort[%" PRI_PlatformIntType "]",
287  this->m_objName.toChar(),
288  port
289  );
290  this->m_comQueueSend_OutputPort[port].setObjName(portName.toChar());
291 #endif
292  }
293 
294  Os::Queue::QueueStatus qStat = this->createQueue(
295  queueDepth,
296  ComponentIpcSerializableBuffer::SERIALIZATION_SIZE
297  );
298  FW_ASSERT(
299  Os::Queue::QUEUE_OK == qStat,
300  static_cast<FwAssertArgType>(qStat)
301  );
302  }
303 
304  // ----------------------------------------------------------------------
305  // Getters for typed input ports
306  // ----------------------------------------------------------------------
307 
310  {
311  FW_ASSERT(
312  portNum < this->getNum_buffQueueIn_InputPorts(),
313  static_cast<FwAssertArgType>(portNum)
314  );
315 
316  return &this->m_buffQueueIn_InputPort[portNum];
317  }
318 
321  {
322  FW_ASSERT(
323  portNum < this->getNum_comQueueIn_InputPorts(),
324  static_cast<FwAssertArgType>(portNum)
325  );
326 
327  return &this->m_comQueueIn_InputPort[portNum];
328  }
329 
332  {
333  FW_ASSERT(
334  portNum < this->getNum_comStatusIn_InputPorts(),
335  static_cast<FwAssertArgType>(portNum)
336  );
337 
338  return &this->m_comStatusIn_InputPort[portNum];
339  }
340 
343  {
344  FW_ASSERT(
345  portNum < this->getNum_run_InputPorts(),
346  static_cast<FwAssertArgType>(portNum)
347  );
348 
349  return &this->m_run_InputPort[portNum];
350  }
351 
352  // ----------------------------------------------------------------------
353  // Connect input ports to special output ports
354  // ----------------------------------------------------------------------
355 
358  FwIndexType portNum,
359  Fw::InputLogPort* port
360  )
361  {
362  FW_ASSERT(
363  portNum < this->getNum_Log_OutputPorts(),
364  static_cast<FwAssertArgType>(portNum)
365  );
366 
367  this->m_Log_OutputPort[portNum].addCallPort(port);
368  }
369 
370 #if FW_ENABLE_TEXT_LOGGING == 1
371 
372  void ComQueueComponentBase ::
373  set_LogText_OutputPort(
374  FwIndexType portNum,
376  )
377  {
378  FW_ASSERT(
379  portNum < this->getNum_LogText_OutputPorts(),
380  static_cast<FwAssertArgType>(portNum)
381  );
382 
383  this->m_LogText_OutputPort[portNum].addCallPort(port);
384  }
385 
386 #endif
387 
390  FwIndexType portNum,
391  Fw::InputTimePort* port
392  )
393  {
394  FW_ASSERT(
395  portNum < this->getNum_Time_OutputPorts(),
396  static_cast<FwAssertArgType>(portNum)
397  );
398 
399  this->m_Time_OutputPort[portNum].addCallPort(port);
400  }
401 
404  FwIndexType portNum,
405  Fw::InputTlmPort* port
406  )
407  {
408  FW_ASSERT(
409  portNum < this->getNum_Tlm_OutputPorts(),
410  static_cast<FwAssertArgType>(portNum)
411  );
412 
413  this->m_Tlm_OutputPort[portNum].addCallPort(port);
414  }
415 
416  // ----------------------------------------------------------------------
417  // Connect typed input ports to typed output ports
418  // ----------------------------------------------------------------------
419 
422  FwIndexType portNum,
424  )
425  {
426  FW_ASSERT(
427  portNum < this->getNum_buffQueueSend_OutputPorts(),
428  static_cast<FwAssertArgType>(portNum)
429  );
430 
431  this->m_buffQueueSend_OutputPort[portNum].addCallPort(port);
432  }
433 
436  FwIndexType portNum,
437  Fw::InputComPort* port
438  )
439  {
440  FW_ASSERT(
441  portNum < this->getNum_comQueueSend_OutputPorts(),
442  static_cast<FwAssertArgType>(portNum)
443  );
444 
445  this->m_comQueueSend_OutputPort[portNum].addCallPort(port);
446  }
447 
448 #if FW_PORT_SERIALIZATION
449 
450  // ----------------------------------------------------------------------
451  // Connect serial input ports to special output ports
452  // ----------------------------------------------------------------------
453 
456  FwIndexType portNum,
457  Fw::InputSerializePort* port
458  )
459  {
460  FW_ASSERT(
461  portNum < this->getNum_Log_OutputPorts(),
462  static_cast<FwAssertArgType>(portNum)
463  );
464 
465  this->m_Log_OutputPort[portNum].registerSerialPort(port);
466  }
467 
468 #if FW_ENABLE_TEXT_LOGGING == 1
469 
470  void ComQueueComponentBase ::
471  set_LogText_OutputPort(
472  FwIndexType portNum,
473  Fw::InputSerializePort* port
474  )
475  {
476  FW_ASSERT(
477  portNum < this->getNum_LogText_OutputPorts(),
478  static_cast<FwAssertArgType>(portNum)
479  );
480 
481  this->m_LogText_OutputPort[portNum].registerSerialPort(port);
482  }
483 
484 #endif
485 
488  FwIndexType portNum,
489  Fw::InputSerializePort* port
490  )
491  {
492  FW_ASSERT(
493  portNum < this->getNum_Time_OutputPorts(),
494  static_cast<FwAssertArgType>(portNum)
495  );
496 
497  this->m_Time_OutputPort[portNum].registerSerialPort(port);
498  }
499 
502  FwIndexType portNum,
503  Fw::InputSerializePort* port
504  )
505  {
506  FW_ASSERT(
507  portNum < this->getNum_Tlm_OutputPorts(),
508  static_cast<FwAssertArgType>(portNum)
509  );
510 
511  this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
512  }
513 
514 #endif
515 
516 #if FW_PORT_SERIALIZATION
517 
518  // ----------------------------------------------------------------------
519  // Connect serial input ports to typed output ports
520  // ----------------------------------------------------------------------
521 
524  FwIndexType portNum,
525  Fw::InputSerializePort* port
526  )
527  {
528  FW_ASSERT(
529  portNum < this->getNum_buffQueueSend_OutputPorts(),
530  static_cast<FwAssertArgType>(portNum)
531  );
532 
533  this->m_buffQueueSend_OutputPort[portNum].registerSerialPort(port);
534  }
535 
538  FwIndexType portNum,
539  Fw::InputSerializePort* port
540  )
541  {
542  FW_ASSERT(
543  portNum < this->getNum_comQueueSend_OutputPorts(),
544  static_cast<FwAssertArgType>(portNum)
545  );
546 
547  this->m_comQueueSend_OutputPort[portNum].registerSerialPort(port);
548  }
549 
550 #endif
551 
552  // ----------------------------------------------------------------------
553  // Component construction and destruction
554  // ----------------------------------------------------------------------
555 
557  ComQueueComponentBase(const char* compName) :
558  Fw::ActiveComponentBase(compName)
559  {
560 
561  }
562 
565  {
566 
567  }
568 
569  // ----------------------------------------------------------------------
570  // Getters for numbers of typed input ports
571  // ----------------------------------------------------------------------
572 
575  {
576  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_buffQueueIn_InputPort));
577  }
578 
581  {
582  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_comQueueIn_InputPort));
583  }
584 
587  {
588  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_comStatusIn_InputPort));
589  }
590 
593  {
594  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_run_InputPort));
595  }
596 
597  // ----------------------------------------------------------------------
598  // Getters for numbers of special output ports
599  // ----------------------------------------------------------------------
600 
603  {
604  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Log_OutputPort));
605  }
606 
607 #if FW_ENABLE_TEXT_LOGGING == 1
608 
609  FwIndexType ComQueueComponentBase ::
610  getNum_LogText_OutputPorts() const
611  {
612  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_LogText_OutputPort));
613  }
614 
615 #endif
616 
619  {
620  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Time_OutputPort));
621  }
622 
625  {
626  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Tlm_OutputPort));
627  }
628 
629  // ----------------------------------------------------------------------
630  // Getters for numbers of typed output ports
631  // ----------------------------------------------------------------------
632 
635  {
636  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_buffQueueSend_OutputPort));
637  }
638 
641  {
642  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_comQueueSend_OutputPort));
643  }
644 
645  // ----------------------------------------------------------------------
646  // Connection status queries for special output ports
647  // ----------------------------------------------------------------------
648 
651  {
652  FW_ASSERT(
653  portNum < this->getNum_Log_OutputPorts(),
654  static_cast<FwAssertArgType>(portNum)
655  );
656 
657  return this->m_Log_OutputPort[portNum].isConnected();
658  }
659 
660 #if FW_ENABLE_TEXT_LOGGING == 1
661 
662  bool ComQueueComponentBase ::
663  isConnected_LogText_OutputPort(FwIndexType portNum)
664  {
665  FW_ASSERT(
666  portNum < this->getNum_LogText_OutputPorts(),
667  static_cast<FwAssertArgType>(portNum)
668  );
669 
670  return this->m_LogText_OutputPort[portNum].isConnected();
671  }
672 
673 #endif
674 
677  {
678  FW_ASSERT(
679  portNum < this->getNum_Time_OutputPorts(),
680  static_cast<FwAssertArgType>(portNum)
681  );
682 
683  return this->m_Time_OutputPort[portNum].isConnected();
684  }
685 
688  {
689  FW_ASSERT(
690  portNum < this->getNum_Tlm_OutputPorts(),
691  static_cast<FwAssertArgType>(portNum)
692  );
693 
694  return this->m_Tlm_OutputPort[portNum].isConnected();
695  }
696 
697  // ----------------------------------------------------------------------
698  // Connection status queries for typed output ports
699  // ----------------------------------------------------------------------
700 
703  {
704  FW_ASSERT(
705  portNum < this->getNum_buffQueueSend_OutputPorts(),
706  static_cast<FwAssertArgType>(portNum)
707  );
708 
709  return this->m_buffQueueSend_OutputPort[portNum].isConnected();
710  }
711 
714  {
715  FW_ASSERT(
716  portNum < this->getNum_comQueueSend_OutputPorts(),
717  static_cast<FwAssertArgType>(portNum)
718  );
719 
720  return this->m_comQueueSend_OutputPort[portNum].isConnected();
721  }
722 
723  // ----------------------------------------------------------------------
724  // Port handler base-class functions for typed input ports
725  //
726  // Call these functions directly to bypass the corresponding ports
727  // ----------------------------------------------------------------------
728 
731  FwIndexType portNum,
732  Fw::Buffer& fwBuffer
733  )
734  {
735  // Make sure port number is valid
736  FW_ASSERT(
737  portNum < this->getNum_buffQueueIn_InputPorts(),
738  static_cast<FwAssertArgType>(portNum)
739  );
740 
741  // Call pre-message hook
743  portNum,
744  fwBuffer
745  );
746  ComponentIpcSerializableBuffer msg;
748 
749  // Serialize message ID
750  _status = msg.serialize(
751  static_cast<FwEnumStoreType>(BUFFQUEUEIN_BUFFERSEND)
752  );
753  FW_ASSERT(
754  _status == Fw::FW_SERIALIZE_OK,
755  static_cast<FwAssertArgType>(_status)
756  );
757 
758  // Serialize port number
759  _status = msg.serialize(portNum);
760  FW_ASSERT(
761  _status == Fw::FW_SERIALIZE_OK,
762  static_cast<FwAssertArgType>(_status)
763  );
764 
765  // Serialize argument fwBuffer
766  _status = msg.serialize(fwBuffer);
767  FW_ASSERT(
768  _status == Fw::FW_SERIALIZE_OK,
769  static_cast<FwAssertArgType>(_status)
770  );
771 
772  // Send message
774  Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
775 
776  if (qStatus == Os::Queue::QUEUE_FULL) {
777  this->incNumMsgDropped();
778  return;
779  }
780 
781  FW_ASSERT(
782  qStatus == Os::Queue::QUEUE_OK,
783  static_cast<FwAssertArgType>(qStatus)
784  );
785  }
786 
789  FwIndexType portNum,
790  Fw::ComBuffer& data,
791  U32 context
792  )
793  {
794  // Make sure port number is valid
795  FW_ASSERT(
796  portNum < this->getNum_comQueueIn_InputPorts(),
797  static_cast<FwAssertArgType>(portNum)
798  );
799 
800  // Call pre-message hook
802  portNum,
803  data,
804  context
805  );
806  ComponentIpcSerializableBuffer msg;
808 
809  // Serialize message ID
810  _status = msg.serialize(
811  static_cast<FwEnumStoreType>(COMQUEUEIN_COM)
812  );
813  FW_ASSERT(
814  _status == Fw::FW_SERIALIZE_OK,
815  static_cast<FwAssertArgType>(_status)
816  );
817 
818  // Serialize port number
819  _status = msg.serialize(portNum);
820  FW_ASSERT(
821  _status == Fw::FW_SERIALIZE_OK,
822  static_cast<FwAssertArgType>(_status)
823  );
824 
825  // Serialize argument data
826  _status = msg.serialize(data);
827  FW_ASSERT(
828  _status == Fw::FW_SERIALIZE_OK,
829  static_cast<FwAssertArgType>(_status)
830  );
831 
832  // Serialize argument context
833  _status = msg.serialize(context);
834  FW_ASSERT(
835  _status == Fw::FW_SERIALIZE_OK,
836  static_cast<FwAssertArgType>(_status)
837  );
838 
839  // Send message
841  Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
842 
843  if (qStatus == Os::Queue::QUEUE_FULL) {
844  this->incNumMsgDropped();
845  return;
846  }
847 
848  FW_ASSERT(
849  qStatus == Os::Queue::QUEUE_OK,
850  static_cast<FwAssertArgType>(qStatus)
851  );
852  }
853 
856  FwIndexType portNum,
857  Fw::Success& condition
858  )
859  {
860  // Make sure port number is valid
861  FW_ASSERT(
862  portNum < this->getNum_comStatusIn_InputPorts(),
863  static_cast<FwAssertArgType>(portNum)
864  );
865 
866  // Call pre-message hook
868  portNum,
869  condition
870  );
871  ComponentIpcSerializableBuffer msg;
873 
874  // Serialize message ID
875  _status = msg.serialize(
876  static_cast<FwEnumStoreType>(COMSTATUSIN_SUCCESSCONDITION)
877  );
878  FW_ASSERT(
879  _status == Fw::FW_SERIALIZE_OK,
880  static_cast<FwAssertArgType>(_status)
881  );
882 
883  // Serialize port number
884  _status = msg.serialize(portNum);
885  FW_ASSERT(
886  _status == Fw::FW_SERIALIZE_OK,
887  static_cast<FwAssertArgType>(_status)
888  );
889 
890  // Serialize argument condition
891  _status = msg.serialize(condition);
892  FW_ASSERT(
893  _status == Fw::FW_SERIALIZE_OK,
894  static_cast<FwAssertArgType>(_status)
895  );
896 
897  // Send message
899  Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
900 
901  FW_ASSERT(
902  qStatus == Os::Queue::QUEUE_OK,
903  static_cast<FwAssertArgType>(qStatus)
904  );
905  }
906 
909  FwIndexType portNum,
910  U32 context
911  )
912  {
913  // Make sure port number is valid
914  FW_ASSERT(
915  portNum < this->getNum_run_InputPorts(),
916  static_cast<FwAssertArgType>(portNum)
917  );
918 
919  // Call pre-message hook
921  portNum,
922  context
923  );
924  ComponentIpcSerializableBuffer msg;
926 
927  // Serialize message ID
928  _status = msg.serialize(
929  static_cast<FwEnumStoreType>(RUN_SCHED)
930  );
931  FW_ASSERT(
932  _status == Fw::FW_SERIALIZE_OK,
933  static_cast<FwAssertArgType>(_status)
934  );
935 
936  // Serialize port number
937  _status = msg.serialize(portNum);
938  FW_ASSERT(
939  _status == Fw::FW_SERIALIZE_OK,
940  static_cast<FwAssertArgType>(_status)
941  );
942 
943  // Serialize argument context
944  _status = msg.serialize(context);
945  FW_ASSERT(
946  _status == Fw::FW_SERIALIZE_OK,
947  static_cast<FwAssertArgType>(_status)
948  );
949 
950  // Send message
952  Os::Queue::QueueStatus qStatus = this->m_queue.send(msg, 0, _block);
953 
954  if (qStatus == Os::Queue::QUEUE_FULL) {
955  this->incNumMsgDropped();
956  return;
957  }
958 
959  FW_ASSERT(
960  qStatus == Os::Queue::QUEUE_OK,
961  static_cast<FwAssertArgType>(qStatus)
962  );
963  }
964 
965  // ----------------------------------------------------------------------
966  // Pre-message hooks for typed async input ports
967  //
968  // Each of these functions is invoked just before processing a message
969  // on the corresponding port. By default, they do nothing. You can
970  // override them to provide specific pre-message behavior.
971  // ----------------------------------------------------------------------
972 
975  FwIndexType portNum,
976  Fw::Buffer& fwBuffer
977  )
978  {
979  // Default: no-op
980  }
981 
984  FwIndexType portNum,
985  Fw::ComBuffer& data,
986  U32 context
987  )
988  {
989  // Default: no-op
990  }
991 
994  FwIndexType portNum,
995  Fw::Success& condition
996  )
997  {
998  // Default: no-op
999  }
1000 
1003  FwIndexType portNum,
1004  U32 context
1005  )
1006  {
1007  // Default: no-op
1008  }
1009 
1010  // ----------------------------------------------------------------------
1011  // Invocation functions for typed output ports
1012  // ----------------------------------------------------------------------
1013 
1016  FwIndexType portNum,
1017  Fw::Buffer& fwBuffer
1018  )
1019  {
1020  FW_ASSERT(
1021  portNum < this->getNum_buffQueueSend_OutputPorts(),
1022  static_cast<FwAssertArgType>(portNum)
1023  );
1024  this->m_buffQueueSend_OutputPort[portNum].invoke(
1025  fwBuffer
1026  );
1027  }
1028 
1031  FwIndexType portNum,
1032  Fw::ComBuffer& data,
1033  U32 context
1034  )
1035  {
1036  FW_ASSERT(
1037  portNum < this->getNum_comQueueSend_OutputPorts(),
1038  static_cast<FwAssertArgType>(portNum)
1039  );
1040  this->m_comQueueSend_OutputPort[portNum].invoke(
1041  data,
1042  context
1043  );
1044  }
1045 
1046  // ----------------------------------------------------------------------
1047  // Event logging functions
1048  // ----------------------------------------------------------------------
1049 
1052  Svc::QueueType queueType,
1053  U32 index
1054  )
1055  {
1056  // Get the time
1057  Fw::Time _logTime;
1058  if (this->m_Time_OutputPort[0].isConnected()) {
1059  this->m_Time_OutputPort[0].invoke(_logTime);
1060  }
1061 
1062  FwEventIdType _id = static_cast<FwEventIdType>(0);
1063 
1064  _id = this->getIdBase() + EVENTID_QUEUEOVERFLOW;
1065 
1066  // Emit the event on the log port
1067  if (this->m_Log_OutputPort[0].isConnected()) {
1068  Fw::LogBuffer _logBuff;
1070 
1071 #if FW_AMPCS_COMPATIBLE
1072  // Serialize the number of arguments
1073  _status = _logBuff.serialize(static_cast<U8>(2));
1074  FW_ASSERT(
1075  _status == Fw::FW_SERIALIZE_OK,
1076  static_cast<FwAssertArgType>(_status)
1077  );
1078 #endif
1079 
1080 #if FW_AMPCS_COMPATIBLE
1081  // Serialize the argument size
1082  _status = _logBuff.serialize(
1083  static_cast<U8>(Svc::QueueType::SERIALIZED_SIZE)
1084  );
1085  FW_ASSERT(
1086  _status == Fw::FW_SERIALIZE_OK,
1087  static_cast<FwAssertArgType>(_status)
1088  );
1089 #endif
1090  _status = _logBuff.serialize(queueType);
1091  FW_ASSERT(
1092  _status == Fw::FW_SERIALIZE_OK,
1093  static_cast<FwAssertArgType>(_status)
1094  );
1095 
1096 #if FW_AMPCS_COMPATIBLE
1097  // Serialize the argument size
1098  _status = _logBuff.serialize(
1099  static_cast<U8>(sizeof(U32))
1100  );
1101  FW_ASSERT(
1102  _status == Fw::FW_SERIALIZE_OK,
1103  static_cast<FwAssertArgType>(_status)
1104  );
1105 #endif
1106  _status = _logBuff.serialize(index);
1107  FW_ASSERT(
1108  _status == Fw::FW_SERIALIZE_OK,
1109  static_cast<FwAssertArgType>(_status)
1110  );
1111 
1112  this->m_Log_OutputPort[0].invoke(
1113  _id,
1114  _logTime,
1116  _logBuff
1117  );
1118  }
1119 
1120  // Emit the event on the text log port
1121 #if FW_ENABLE_TEXT_LOGGING
1122  if (this->m_LogText_OutputPort[0].isConnected()) {
1123 #if FW_OBJECT_NAMES == 1
1124  const char* _formatString =
1125  "(%s) %s: The %s queue at index %" PRIu32 " overflowed";
1126 #else
1127  const char* _formatString =
1128  "%s: The %s queue at index %" PRIu32 " overflowed";
1129 #endif
1130 
1131  Fw::String queueTypeStr;
1132  queueType.toString(queueTypeStr);
1133 
1134  Fw::TextLogString _logString;
1135  _logString.format(
1136  _formatString,
1137 #if FW_OBJECT_NAMES == 1
1138  this->m_objName.toChar(),
1139 #endif
1140  "QueueOverflow ",
1141  queueTypeStr.toChar(),
1142  index
1143  );
1144 
1145  this->m_LogText_OutputPort[0].invoke(
1146  _id,
1147  _logTime,
1149  _logString
1150  );
1151  }
1152 #endif
1153  }
1154 
1155  // ----------------------------------------------------------------------
1156  // Telemetry write functions
1157  // ----------------------------------------------------------------------
1158 
1161  const Svc::ComQueueDepth& arg,
1162  Fw::Time _tlmTime
1163  )
1164  {
1165  if (this->m_Tlm_OutputPort[0].isConnected()) {
1166  if (
1167  this->m_Time_OutputPort[0].isConnected() &&
1168  (_tlmTime == Fw::ZERO_TIME)
1169  ) {
1170  this->m_Time_OutputPort[0].invoke(_tlmTime);
1171  }
1172 
1173  Fw::TlmBuffer _tlmBuff;
1174  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1175  FW_ASSERT(
1176  _stat == Fw::FW_SERIALIZE_OK,
1177  static_cast<FwAssertArgType>(_stat)
1178  );
1179 
1180  FwChanIdType _id;
1181 
1182  _id = this->getIdBase() + CHANNELID_COMQUEUEDEPTH;
1183 
1184  this->m_Tlm_OutputPort[0].invoke(
1185  _id,
1186  _tlmTime,
1187  _tlmBuff
1188  );
1189  }
1190  }
1191 
1194  const Svc::BuffQueueDepth& arg,
1195  Fw::Time _tlmTime
1196  )
1197  {
1198  if (this->m_Tlm_OutputPort[0].isConnected()) {
1199  if (
1200  this->m_Time_OutputPort[0].isConnected() &&
1201  (_tlmTime == Fw::ZERO_TIME)
1202  ) {
1203  this->m_Time_OutputPort[0].invoke(_tlmTime);
1204  }
1205 
1206  Fw::TlmBuffer _tlmBuff;
1207  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1208  FW_ASSERT(
1209  _stat == Fw::FW_SERIALIZE_OK,
1210  static_cast<FwAssertArgType>(_stat)
1211  );
1212 
1213  FwChanIdType _id;
1214 
1215  _id = this->getIdBase() + CHANNELID_BUFFQUEUEDEPTH;
1216 
1217  this->m_Tlm_OutputPort[0].invoke(
1218  _id,
1219  _tlmTime,
1220  _tlmBuff
1221  );
1222  }
1223  }
1224 
1225  // ----------------------------------------------------------------------
1226  // Time
1227  // ----------------------------------------------------------------------
1228 
1230  getTime()
1231  {
1232  if (this->m_Time_OutputPort[0].isConnected()) {
1233  Fw::Time _time;
1234  this->m_Time_OutputPort[0].invoke(_time);
1235  return _time;
1236  }
1237  else {
1238  return Fw::Time(TB_NONE, 0, 0);
1239  }
1240  }
1241 
1242  // ----------------------------------------------------------------------
1243  // Message dispatch functions
1244  // ----------------------------------------------------------------------
1245 
1246  Fw::QueuedComponentBase::MsgDispatchStatus ComQueueComponentBase ::
1247  doDispatch()
1248  {
1249  ComponentIpcSerializableBuffer msg;
1250  FwQueuePriorityType priority = 0;
1251 
1252  Os::Queue::QueueStatus msgStatus = this->m_queue.receive(
1253  msg,
1254  priority,
1256  );
1257  FW_ASSERT(
1258  msgStatus == Os::Queue::QUEUE_OK,
1259  static_cast<FwAssertArgType>(msgStatus)
1260  );
1261 
1262  // Reset to beginning of buffer
1263  msg.resetDeser();
1264 
1265  FwEnumStoreType desMsg = 0;
1266  Fw::SerializeStatus deserStatus = msg.deserialize(desMsg);
1267  FW_ASSERT(
1268  deserStatus == Fw::FW_SERIALIZE_OK,
1269  static_cast<FwAssertArgType>(deserStatus)
1270  );
1271 
1272  MsgTypeEnum msgType = static_cast<MsgTypeEnum>(desMsg);
1273 
1274  if (msgType == COMQUEUE_COMPONENT_EXIT) {
1275  return MSG_DISPATCH_EXIT;
1276  }
1277 
1278  FwIndexType portNum = 0;
1279  deserStatus = msg.deserialize(portNum);
1280  FW_ASSERT(
1281  deserStatus == Fw::FW_SERIALIZE_OK,
1282  static_cast<FwAssertArgType>(deserStatus)
1283  );
1284 
1285  switch (msgType) {
1286  // Handle async input port buffQueueIn
1287  case BUFFQUEUEIN_BUFFERSEND: {
1288  // Deserialize argument fwBuffer
1289  Fw::Buffer fwBuffer;
1290  deserStatus = msg.deserialize(fwBuffer);
1291  FW_ASSERT(
1292  deserStatus == Fw::FW_SERIALIZE_OK,
1293  static_cast<FwAssertArgType>(deserStatus)
1294  );
1295  // Call handler function
1296  this->buffQueueIn_handler(
1297  portNum,
1298  fwBuffer
1299  );
1300 
1301  break;
1302  }
1303 
1304  // Handle async input port comQueueIn
1305  case COMQUEUEIN_COM: {
1306  // Deserialize argument data
1307  Fw::ComBuffer data;
1308  deserStatus = msg.deserialize(data);
1309  FW_ASSERT(
1310  deserStatus == Fw::FW_SERIALIZE_OK,
1311  static_cast<FwAssertArgType>(deserStatus)
1312  );
1313 
1314  // Deserialize argument context
1315  U32 context;
1316  deserStatus = msg.deserialize(context);
1317  FW_ASSERT(
1318  deserStatus == Fw::FW_SERIALIZE_OK,
1319  static_cast<FwAssertArgType>(deserStatus)
1320  );
1321  // Call handler function
1322  this->comQueueIn_handler(
1323  portNum,
1324  data,
1325  context
1326  );
1327 
1328  break;
1329  }
1330 
1331  // Handle async input port comStatusIn
1332  case COMSTATUSIN_SUCCESSCONDITION: {
1333  // Deserialize argument condition
1334  Fw::Success condition;
1335  deserStatus = msg.deserialize(condition);
1336  FW_ASSERT(
1337  deserStatus == Fw::FW_SERIALIZE_OK,
1338  static_cast<FwAssertArgType>(deserStatus)
1339  );
1340  // Call handler function
1341  this->comStatusIn_handler(
1342  portNum,
1343  condition
1344  );
1345 
1346  break;
1347  }
1348 
1349  // Handle async input port run
1350  case RUN_SCHED: {
1351  // Deserialize argument context
1352  U32 context;
1353  deserStatus = msg.deserialize(context);
1354  FW_ASSERT(
1355  deserStatus == Fw::FW_SERIALIZE_OK,
1356  static_cast<FwAssertArgType>(deserStatus)
1357  );
1358  // Call handler function
1359  this->run_handler(
1360  portNum,
1361  context
1362  );
1363 
1364  break;
1365  }
1366 
1367  default:
1368  return MSG_DISPATCH_ERROR;
1369  }
1370 
1371  return MSG_DISPATCH_OK;
1372  }
1373 
1374  // ----------------------------------------------------------------------
1375  // Calls for messages received on typed input ports
1376  // ----------------------------------------------------------------------
1377 
1378  void ComQueueComponentBase ::
1379  m_p_buffQueueIn_in(
1380  Fw::PassiveComponentBase* callComp,
1381  FwIndexType portNum,
1382  Fw::Buffer& fwBuffer
1383  )
1384  {
1385  FW_ASSERT(callComp);
1386  ComQueueComponentBase* compPtr = static_cast<ComQueueComponentBase*>(callComp);
1387  compPtr->buffQueueIn_handlerBase(
1388  portNum,
1389  fwBuffer
1390  );
1391  }
1392 
1393  void ComQueueComponentBase ::
1394  m_p_comQueueIn_in(
1395  Fw::PassiveComponentBase* callComp,
1396  FwIndexType portNum,
1397  Fw::ComBuffer& data,
1398  U32 context
1399  )
1400  {
1401  FW_ASSERT(callComp);
1402  ComQueueComponentBase* compPtr = static_cast<ComQueueComponentBase*>(callComp);
1403  compPtr->comQueueIn_handlerBase(
1404  portNum,
1405  data,
1406  context
1407  );
1408  }
1409 
1410  void ComQueueComponentBase ::
1411  m_p_comStatusIn_in(
1412  Fw::PassiveComponentBase* callComp,
1413  FwIndexType portNum,
1414  Fw::Success& condition
1415  )
1416  {
1417  FW_ASSERT(callComp);
1418  ComQueueComponentBase* compPtr = static_cast<ComQueueComponentBase*>(callComp);
1419  compPtr->comStatusIn_handlerBase(
1420  portNum,
1421  condition
1422  );
1423  }
1424 
1425  void ComQueueComponentBase ::
1426  m_p_run_in(
1427  Fw::PassiveComponentBase* callComp,
1428  FwIndexType portNum,
1429  U32 context
1430  )
1431  {
1432  FW_ASSERT(callComp);
1433  ComQueueComponentBase* compPtr = static_cast<ComQueueComponentBase*>(callComp);
1434  compPtr->run_handlerBase(
1435  portNum,
1436  context
1437  );
1438  }
1439 
1440 }
#define FW_ASSERT(...)
Definition: Assert.hpp:14
U8 BYTE
byte type
Definition: BasicTypes.h:27
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:26
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.h:66
#define PRI_PlatformIntType
@ TB_NONE
No time base has been established.
Definition: FpConfig.h:57
I32 FwEnumStoreType
Definition: FpConfig.h:51
PlatformAssertArgType FwAssertArgType
Definition: FpConfig.h:34
U32 FwChanIdType
Definition: FpConfig.h:82
U32 FwEventIdType
Definition: FpConfig.h:86
FwIndexType FwQueueSizeType
Definition: FpConfig.h:117
I32 FwQueuePriorityType
Definition: FpConfig.h:98
PlatformIndexType FwIndexType
Definition: FpConfig.h:20
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects)
Definition: FpConfig.h:135
@ ACTIVE_COMPONENT_EXIT
message to exit active component task
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)
Definition: Buffer.cpp:134
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
void init()
Initialization function.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
Definition: ComPortAc.hpp:37
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: ComPortAc.cpp:62
void init()
Initialization function.
Definition: ComPortAc.cpp:56
void setPortNum(NATIVE_INT_TYPE portNum)
void init()
Initialization function.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
@ WARNING_HI
A serious but recoverable event.
void init()
Object initializer.
Definition: ObjBase.cpp:27
const char * toChar() const
Definition: ObjectName.hpp:50
void addCallPort(InputBufferSendPort *callPort)
Register an input port.
void invoke(Fw::Buffer &fwBuffer)
Invoke a port interface.
void init()
Initialization function.
void addCallPort(InputComPort *callPort)
Register an input port.
Definition: ComPortAc.cpp:143
void init()
Initialization function.
Definition: ComPortAc.cpp:137
void invoke(Fw::ComBuffer &data, U32 context)
Invoke a port interface.
Definition: ComPortAc.cpp:156
void init()
Initialization function.
Definition: LogPortAc.cpp:151
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Invoke a port interface.
Definition: LogPortAc.cpp:170
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
void invoke(Fw::Time &time)
Invoke a port interface.
Definition: TimePortAc.cpp:147
void init()
Initialization function.
Definition: TimePortAc.cpp:128
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:150
void init()
Initialization function.
Definition: TlmPortAc.cpp:144
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Invoke a port interface.
Definition: TlmPortAc.cpp:163
bool isConnected()
Definition: PortBase.cpp:41
Os::Queue::QueueStatus createQueue(NATIVE_INT_TYPE depth, NATIVE_INT_TYPE msgSize)
Os::Queue m_queue
queue object for active component
void incNumMsgDropped()
increment the number of messages dropped
@ MSG_DISPATCH_OK
Dispatch was normal.
@ MSG_DISPATCH_EXIT
A message was sent requesting an exit of the loop.
@ MSG_DISPATCH_ERROR
Errors dispatching messages.
NATIVE_UINT_TYPE SizeType
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
void format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:56
const char * toChar() const
Definition: String.hpp:50
Success/Failure.
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)
Deserialize raw enum value from SerialType.
Definition: Time.hpp:9
QueueStatus
Definition: Queue.hpp:27
@ QUEUE_OK
message sent/received okay
Definition: Queue.hpp:28
@ QUEUE_FULL
queue was full when attempting to send a message
Definition: Queue.hpp:36
QueueStatus send(const Fw::SerializeBufferBase &buffer, NATIVE_INT_TYPE priority, QueueBlocking block)
send a message
Definition: QueueCommon.cpp:13
QueueStatus receive(Fw::SerializeBufferBase &buffer, NATIVE_INT_TYPE &priority, QueueBlocking block)
receive a message
Definition: QueueCommon.cpp:22
QueueBlocking
Definition: Queue.hpp:40
@ QUEUE_BLOCKING
Queue receive blocks until a message arrives.
Definition: Queue.hpp:41
@ QUEUE_NONBLOCKING
Queue receive always returns even if there is no message.
Definition: Queue.hpp:42
Array of queue depths for Fw::Buffer types.
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.
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.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
Definition: SchedPortAc.hpp:36
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: SchedPortAc.cpp:62
void init()
Initialization function.
Definition: SchedPortAc.cpp:56
An enumeration of queue data types.
@ SERIALIZED_SIZE
The size of the serial representation.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
const Time ZERO_TIME
Definition: Time.cpp:5