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  FwSizeType 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  // Connect output port deallocate
295  for (
296  FwIndexType port = 0;
297  port < static_cast<FwIndexType>(this->getNum_deallocate_OutputPorts());
298  port++
299  ) {
300  this->m_deallocate_OutputPort[port].init();
301 
302 #if FW_OBJECT_NAMES == 1
303  Fw::ObjectName portName;
304  portName.format(
305  "%s_deallocate_OutputPort[%" PRI_PlatformIntType "]",
306  this->m_objName.toChar(),
307  port
308  );
309  this->m_deallocate_OutputPort[port].setObjName(portName.toChar());
310 #endif
311  }
312 
313  Os::Queue::Status qStat = this->createQueue(
314  queueDepth,
315  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
316  );
317  FW_ASSERT(
318  Os::Queue::Status::OP_OK == qStat,
319  static_cast<FwAssertArgType>(qStat)
320  );
321  }
322 
323  // ----------------------------------------------------------------------
324  // Getters for typed input ports
325  // ----------------------------------------------------------------------
326 
329  {
330  FW_ASSERT(
331  portNum < this->getNum_buffQueueIn_InputPorts(),
332  static_cast<FwAssertArgType>(portNum)
333  );
334 
335  return &this->m_buffQueueIn_InputPort[portNum];
336  }
337 
340  {
341  FW_ASSERT(
342  portNum < this->getNum_comQueueIn_InputPorts(),
343  static_cast<FwAssertArgType>(portNum)
344  );
345 
346  return &this->m_comQueueIn_InputPort[portNum];
347  }
348 
351  {
352  FW_ASSERT(
353  portNum < this->getNum_comStatusIn_InputPorts(),
354  static_cast<FwAssertArgType>(portNum)
355  );
356 
357  return &this->m_comStatusIn_InputPort[portNum];
358  }
359 
362  {
363  FW_ASSERT(
364  portNum < this->getNum_run_InputPorts(),
365  static_cast<FwAssertArgType>(portNum)
366  );
367 
368  return &this->m_run_InputPort[portNum];
369  }
370 
371  // ----------------------------------------------------------------------
372  // Connect input ports to special output ports
373  // ----------------------------------------------------------------------
374 
377  FwIndexType portNum,
378  Fw::InputLogPort* port
379  )
380  {
381  FW_ASSERT(
382  portNum < this->getNum_Log_OutputPorts(),
383  static_cast<FwAssertArgType>(portNum)
384  );
385 
386  this->m_Log_OutputPort[portNum].addCallPort(port);
387  }
388 
389 #if FW_ENABLE_TEXT_LOGGING == 1
390 
391  void ComQueueComponentBase ::
392  set_LogText_OutputPort(
393  FwIndexType portNum,
395  )
396  {
397  FW_ASSERT(
398  portNum < this->getNum_LogText_OutputPorts(),
399  static_cast<FwAssertArgType>(portNum)
400  );
401 
402  this->m_LogText_OutputPort[portNum].addCallPort(port);
403  }
404 
405 #endif
406 
409  FwIndexType portNum,
410  Fw::InputTimePort* port
411  )
412  {
413  FW_ASSERT(
414  portNum < this->getNum_Time_OutputPorts(),
415  static_cast<FwAssertArgType>(portNum)
416  );
417 
418  this->m_Time_OutputPort[portNum].addCallPort(port);
419  }
420 
423  FwIndexType portNum,
424  Fw::InputTlmPort* port
425  )
426  {
427  FW_ASSERT(
428  portNum < this->getNum_Tlm_OutputPorts(),
429  static_cast<FwAssertArgType>(portNum)
430  );
431 
432  this->m_Tlm_OutputPort[portNum].addCallPort(port);
433  }
434 
435  // ----------------------------------------------------------------------
436  // Connect typed input ports to typed output ports
437  // ----------------------------------------------------------------------
438 
441  FwIndexType portNum,
443  )
444  {
445  FW_ASSERT(
446  portNum < this->getNum_buffQueueSend_OutputPorts(),
447  static_cast<FwAssertArgType>(portNum)
448  );
449 
450  this->m_buffQueueSend_OutputPort[portNum].addCallPort(port);
451  }
452 
455  FwIndexType portNum,
456  Fw::InputComPort* port
457  )
458  {
459  FW_ASSERT(
460  portNum < this->getNum_comQueueSend_OutputPorts(),
461  static_cast<FwAssertArgType>(portNum)
462  );
463 
464  this->m_comQueueSend_OutputPort[portNum].addCallPort(port);
465  }
466 
469  FwIndexType portNum,
471  )
472  {
473  FW_ASSERT(
474  portNum < this->getNum_deallocate_OutputPorts(),
475  static_cast<FwAssertArgType>(portNum)
476  );
477 
478  this->m_deallocate_OutputPort[portNum].addCallPort(port);
479  }
480 
481 #if FW_PORT_SERIALIZATION
482 
483  // ----------------------------------------------------------------------
484  // Connect serial input ports to special output ports
485  // ----------------------------------------------------------------------
486 
489  FwIndexType portNum,
490  Fw::InputSerializePort* port
491  )
492  {
493  FW_ASSERT(
494  portNum < this->getNum_Log_OutputPorts(),
495  static_cast<FwAssertArgType>(portNum)
496  );
497 
498  this->m_Log_OutputPort[portNum].registerSerialPort(port);
499  }
500 
501 #if FW_ENABLE_TEXT_LOGGING == 1
502 
503  void ComQueueComponentBase ::
504  set_LogText_OutputPort(
505  FwIndexType portNum,
506  Fw::InputSerializePort* port
507  )
508  {
509  FW_ASSERT(
510  portNum < this->getNum_LogText_OutputPorts(),
511  static_cast<FwAssertArgType>(portNum)
512  );
513 
514  this->m_LogText_OutputPort[portNum].registerSerialPort(port);
515  }
516 
517 #endif
518 
521  FwIndexType portNum,
522  Fw::InputSerializePort* port
523  )
524  {
525  FW_ASSERT(
526  portNum < this->getNum_Time_OutputPorts(),
527  static_cast<FwAssertArgType>(portNum)
528  );
529 
530  this->m_Time_OutputPort[portNum].registerSerialPort(port);
531  }
532 
535  FwIndexType portNum,
536  Fw::InputSerializePort* port
537  )
538  {
539  FW_ASSERT(
540  portNum < this->getNum_Tlm_OutputPorts(),
541  static_cast<FwAssertArgType>(portNum)
542  );
543 
544  this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
545  }
546 
547 #endif
548 
549 #if FW_PORT_SERIALIZATION
550 
551  // ----------------------------------------------------------------------
552  // Connect serial input ports to typed output ports
553  // ----------------------------------------------------------------------
554 
557  FwIndexType portNum,
558  Fw::InputSerializePort* port
559  )
560  {
561  FW_ASSERT(
562  portNum < this->getNum_buffQueueSend_OutputPorts(),
563  static_cast<FwAssertArgType>(portNum)
564  );
565 
566  this->m_buffQueueSend_OutputPort[portNum].registerSerialPort(port);
567  }
568 
571  FwIndexType portNum,
572  Fw::InputSerializePort* port
573  )
574  {
575  FW_ASSERT(
576  portNum < this->getNum_comQueueSend_OutputPorts(),
577  static_cast<FwAssertArgType>(portNum)
578  );
579 
580  this->m_comQueueSend_OutputPort[portNum].registerSerialPort(port);
581  }
582 
585  FwIndexType portNum,
586  Fw::InputSerializePort* port
587  )
588  {
589  FW_ASSERT(
590  portNum < this->getNum_deallocate_OutputPorts(),
591  static_cast<FwAssertArgType>(portNum)
592  );
593 
594  this->m_deallocate_OutputPort[portNum].registerSerialPort(port);
595  }
596 
597 #endif
598 
599  // ----------------------------------------------------------------------
600  // Component construction and destruction
601  // ----------------------------------------------------------------------
602 
604  ComQueueComponentBase(const char* compName) :
605  Fw::ActiveComponentBase(compName)
606  {
607 
608  }
609 
612  {
613 
614  }
615 
616  // ----------------------------------------------------------------------
617  // Getters for numbers of typed input ports
618  // ----------------------------------------------------------------------
619 
622  {
623  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_buffQueueIn_InputPort));
624  }
625 
628  {
629  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_comQueueIn_InputPort));
630  }
631 
634  {
635  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_comStatusIn_InputPort));
636  }
637 
640  {
641  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_run_InputPort));
642  }
643 
644  // ----------------------------------------------------------------------
645  // Getters for numbers of special output ports
646  // ----------------------------------------------------------------------
647 
650  {
651  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Log_OutputPort));
652  }
653 
654 #if FW_ENABLE_TEXT_LOGGING == 1
655 
656  FwIndexType ComQueueComponentBase ::
657  getNum_LogText_OutputPorts() const
658  {
659  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_LogText_OutputPort));
660  }
661 
662 #endif
663 
666  {
667  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Time_OutputPort));
668  }
669 
672  {
673  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Tlm_OutputPort));
674  }
675 
676  // ----------------------------------------------------------------------
677  // Getters for numbers of typed output ports
678  // ----------------------------------------------------------------------
679 
682  {
683  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_buffQueueSend_OutputPort));
684  }
685 
688  {
689  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_comQueueSend_OutputPort));
690  }
691 
694  {
695  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_deallocate_OutputPort));
696  }
697 
698  // ----------------------------------------------------------------------
699  // Connection status queries for special output ports
700  // ----------------------------------------------------------------------
701 
704  {
705  FW_ASSERT(
706  portNum < this->getNum_Log_OutputPorts(),
707  static_cast<FwAssertArgType>(portNum)
708  );
709 
710  return this->m_Log_OutputPort[portNum].isConnected();
711  }
712 
713 #if FW_ENABLE_TEXT_LOGGING == 1
714 
715  bool ComQueueComponentBase ::
716  isConnected_LogText_OutputPort(FwIndexType portNum)
717  {
718  FW_ASSERT(
719  portNum < this->getNum_LogText_OutputPorts(),
720  static_cast<FwAssertArgType>(portNum)
721  );
722 
723  return this->m_LogText_OutputPort[portNum].isConnected();
724  }
725 
726 #endif
727 
730  {
731  FW_ASSERT(
732  portNum < this->getNum_Time_OutputPorts(),
733  static_cast<FwAssertArgType>(portNum)
734  );
735 
736  return this->m_Time_OutputPort[portNum].isConnected();
737  }
738 
741  {
742  FW_ASSERT(
743  portNum < this->getNum_Tlm_OutputPorts(),
744  static_cast<FwAssertArgType>(portNum)
745  );
746 
747  return this->m_Tlm_OutputPort[portNum].isConnected();
748  }
749 
750  // ----------------------------------------------------------------------
751  // Connection status queries for typed output ports
752  // ----------------------------------------------------------------------
753 
756  {
757  FW_ASSERT(
758  portNum < this->getNum_buffQueueSend_OutputPorts(),
759  static_cast<FwAssertArgType>(portNum)
760  );
761 
762  return this->m_buffQueueSend_OutputPort[portNum].isConnected();
763  }
764 
767  {
768  FW_ASSERT(
769  portNum < this->getNum_comQueueSend_OutputPorts(),
770  static_cast<FwAssertArgType>(portNum)
771  );
772 
773  return this->m_comQueueSend_OutputPort[portNum].isConnected();
774  }
775 
778  {
779  FW_ASSERT(
780  portNum < this->getNum_deallocate_OutputPorts(),
781  static_cast<FwAssertArgType>(portNum)
782  );
783 
784  return this->m_deallocate_OutputPort[portNum].isConnected();
785  }
786 
787  // ----------------------------------------------------------------------
788  // Port handler base-class functions for typed input ports
789  //
790  // Call these functions directly to bypass the corresponding ports
791  // ----------------------------------------------------------------------
792 
795  FwIndexType portNum,
796  Fw::Buffer& fwBuffer
797  )
798  {
799  // Make sure port number is valid
800  FW_ASSERT(
801  portNum < this->getNum_buffQueueIn_InputPorts(),
802  static_cast<FwAssertArgType>(portNum)
803  );
804 
805  // Call pre-message hook
807  portNum,
808  fwBuffer
809  );
810  ComponentIpcSerializableBuffer msg;
812 
813  // Serialize message ID
814  _status = msg.serialize(
815  static_cast<FwEnumStoreType>(BUFFQUEUEIN_BUFFERSEND)
816  );
817  FW_ASSERT(
818  _status == Fw::FW_SERIALIZE_OK,
819  static_cast<FwAssertArgType>(_status)
820  );
821 
822  // Serialize port number
823  _status = msg.serialize(portNum);
824  FW_ASSERT(
825  _status == Fw::FW_SERIALIZE_OK,
826  static_cast<FwAssertArgType>(_status)
827  );
828 
829  // Serialize argument fwBuffer
830  _status = msg.serialize(fwBuffer);
831  FW_ASSERT(
832  _status == Fw::FW_SERIALIZE_OK,
833  static_cast<FwAssertArgType>(_status)
834  );
835 
836  // Send message
838  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
839 
840  if (qStatus == Os::Queue::Status::FULL) {
841  this->buffQueueIn_overflowHook(portNum, fwBuffer);
842  return;
843  }
844 
845  FW_ASSERT(
846  qStatus == Os::Queue::OP_OK,
847  static_cast<FwAssertArgType>(qStatus)
848  );
849  }
850 
853  FwIndexType portNum,
854  Fw::ComBuffer& data,
855  U32 context
856  )
857  {
858  // Make sure port number is valid
859  FW_ASSERT(
860  portNum < this->getNum_comQueueIn_InputPorts(),
861  static_cast<FwAssertArgType>(portNum)
862  );
863 
864  // Call pre-message hook
866  portNum,
867  data,
868  context
869  );
870  ComponentIpcSerializableBuffer msg;
872 
873  // Serialize message ID
874  _status = msg.serialize(
875  static_cast<FwEnumStoreType>(COMQUEUEIN_COM)
876  );
877  FW_ASSERT(
878  _status == Fw::FW_SERIALIZE_OK,
879  static_cast<FwAssertArgType>(_status)
880  );
881 
882  // Serialize port number
883  _status = msg.serialize(portNum);
884  FW_ASSERT(
885  _status == Fw::FW_SERIALIZE_OK,
886  static_cast<FwAssertArgType>(_status)
887  );
888 
889  // Serialize argument data
890  _status = msg.serialize(data);
891  FW_ASSERT(
892  _status == Fw::FW_SERIALIZE_OK,
893  static_cast<FwAssertArgType>(_status)
894  );
895 
896  // Serialize argument context
897  _status = msg.serialize(context);
898  FW_ASSERT(
899  _status == Fw::FW_SERIALIZE_OK,
900  static_cast<FwAssertArgType>(_status)
901  );
902 
903  // Send message
905  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
906 
907  if (qStatus == Os::Queue::Status::FULL) {
908  this->incNumMsgDropped();
909  return;
910  }
911 
912  FW_ASSERT(
913  qStatus == Os::Queue::OP_OK,
914  static_cast<FwAssertArgType>(qStatus)
915  );
916  }
917 
920  FwIndexType portNum,
921  Fw::Success& condition
922  )
923  {
924  // Make sure port number is valid
925  FW_ASSERT(
926  portNum < this->getNum_comStatusIn_InputPorts(),
927  static_cast<FwAssertArgType>(portNum)
928  );
929 
930  // Call pre-message hook
932  portNum,
933  condition
934  );
935  ComponentIpcSerializableBuffer msg;
937 
938  // Serialize message ID
939  _status = msg.serialize(
940  static_cast<FwEnumStoreType>(COMSTATUSIN_SUCCESSCONDITION)
941  );
942  FW_ASSERT(
943  _status == Fw::FW_SERIALIZE_OK,
944  static_cast<FwAssertArgType>(_status)
945  );
946 
947  // Serialize port number
948  _status = msg.serialize(portNum);
949  FW_ASSERT(
950  _status == Fw::FW_SERIALIZE_OK,
951  static_cast<FwAssertArgType>(_status)
952  );
953 
954  // Serialize argument condition
955  _status = msg.serialize(condition);
956  FW_ASSERT(
957  _status == Fw::FW_SERIALIZE_OK,
958  static_cast<FwAssertArgType>(_status)
959  );
960 
961  // Send message
963  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
964 
965  FW_ASSERT(
966  qStatus == Os::Queue::OP_OK,
967  static_cast<FwAssertArgType>(qStatus)
968  );
969  }
970 
973  FwIndexType portNum,
974  U32 context
975  )
976  {
977  // Make sure port number is valid
978  FW_ASSERT(
979  portNum < this->getNum_run_InputPorts(),
980  static_cast<FwAssertArgType>(portNum)
981  );
982 
983  // Call pre-message hook
985  portNum,
986  context
987  );
988  ComponentIpcSerializableBuffer msg;
990 
991  // Serialize message ID
992  _status = msg.serialize(
993  static_cast<FwEnumStoreType>(RUN_SCHED)
994  );
995  FW_ASSERT(
996  _status == Fw::FW_SERIALIZE_OK,
997  static_cast<FwAssertArgType>(_status)
998  );
999 
1000  // Serialize port number
1001  _status = msg.serialize(portNum);
1002  FW_ASSERT(
1003  _status == Fw::FW_SERIALIZE_OK,
1004  static_cast<FwAssertArgType>(_status)
1005  );
1006 
1007  // Serialize argument context
1008  _status = msg.serialize(context);
1009  FW_ASSERT(
1010  _status == Fw::FW_SERIALIZE_OK,
1011  static_cast<FwAssertArgType>(_status)
1012  );
1013 
1014  // Send message
1016  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1017 
1018  if (qStatus == Os::Queue::Status::FULL) {
1019  this->incNumMsgDropped();
1020  return;
1021  }
1022 
1023  FW_ASSERT(
1024  qStatus == Os::Queue::OP_OK,
1025  static_cast<FwAssertArgType>(qStatus)
1026  );
1027  }
1028 
1029  // ----------------------------------------------------------------------
1030  // Pre-message hooks for typed async input ports
1031  //
1032  // Each of these functions is invoked just before processing a message
1033  // on the corresponding port. By default, they do nothing. You can
1034  // override them to provide specific pre-message behavior.
1035  // ----------------------------------------------------------------------
1036 
1039  FwIndexType portNum,
1040  Fw::Buffer& fwBuffer
1041  )
1042  {
1043  // Default: no-op
1044  }
1045 
1048  FwIndexType portNum,
1049  Fw::ComBuffer& data,
1050  U32 context
1051  )
1052  {
1053  // Default: no-op
1054  }
1055 
1058  FwIndexType portNum,
1059  Fw::Success& condition
1060  )
1061  {
1062  // Default: no-op
1063  }
1064 
1067  FwIndexType portNum,
1068  U32 context
1069  )
1070  {
1071  // Default: no-op
1072  }
1073 
1074  // ----------------------------------------------------------------------
1075  // Invocation functions for typed output ports
1076  // ----------------------------------------------------------------------
1077 
1080  FwIndexType portNum,
1081  Fw::Buffer& fwBuffer
1082  )
1083  {
1084  FW_ASSERT(
1085  portNum < this->getNum_buffQueueSend_OutputPorts(),
1086  static_cast<FwAssertArgType>(portNum)
1087  );
1088  this->m_buffQueueSend_OutputPort[portNum].invoke(
1089  fwBuffer
1090  );
1091  }
1092 
1095  FwIndexType portNum,
1096  Fw::ComBuffer& data,
1097  U32 context
1098  )
1099  {
1100  FW_ASSERT(
1101  portNum < this->getNum_comQueueSend_OutputPorts(),
1102  static_cast<FwAssertArgType>(portNum)
1103  );
1104  this->m_comQueueSend_OutputPort[portNum].invoke(
1105  data,
1106  context
1107  );
1108  }
1109 
1112  FwIndexType portNum,
1113  Fw::Buffer& fwBuffer
1114  )
1115  {
1116  FW_ASSERT(
1117  portNum < this->getNum_deallocate_OutputPorts(),
1118  static_cast<FwAssertArgType>(portNum)
1119  );
1120  this->m_deallocate_OutputPort[portNum].invoke(
1121  fwBuffer
1122  );
1123  }
1124 
1125  // ----------------------------------------------------------------------
1126  // Event logging functions
1127  // ----------------------------------------------------------------------
1128 
1131  Svc::QueueType queueType,
1132  U32 index
1133  )
1134  {
1135  // Get the time
1136  Fw::Time _logTime;
1137  if (this->m_Time_OutputPort[0].isConnected()) {
1138  this->m_Time_OutputPort[0].invoke(_logTime);
1139  }
1140 
1141  FwEventIdType _id = static_cast<FwEventIdType>(0);
1142 
1143  _id = this->getIdBase() + EVENTID_QUEUEOVERFLOW;
1144 
1145  // Emit the event on the log port
1146  if (this->m_Log_OutputPort[0].isConnected()) {
1147  Fw::LogBuffer _logBuff;
1149 
1150 #if FW_AMPCS_COMPATIBLE
1151  // Serialize the number of arguments
1152  _status = _logBuff.serialize(static_cast<U8>(2));
1153  FW_ASSERT(
1154  _status == Fw::FW_SERIALIZE_OK,
1155  static_cast<FwAssertArgType>(_status)
1156  );
1157 #endif
1158 
1159 #if FW_AMPCS_COMPATIBLE
1160  // Serialize the argument size
1161  _status = _logBuff.serialize(
1162  static_cast<U8>(Svc::QueueType::SERIALIZED_SIZE)
1163  );
1164  FW_ASSERT(
1165  _status == Fw::FW_SERIALIZE_OK,
1166  static_cast<FwAssertArgType>(_status)
1167  );
1168 #endif
1169  _status = _logBuff.serialize(queueType);
1170  FW_ASSERT(
1171  _status == Fw::FW_SERIALIZE_OK,
1172  static_cast<FwAssertArgType>(_status)
1173  );
1174 
1175 #if FW_AMPCS_COMPATIBLE
1176  // Serialize the argument size
1177  _status = _logBuff.serialize(
1178  static_cast<U8>(sizeof(U32))
1179  );
1180  FW_ASSERT(
1181  _status == Fw::FW_SERIALIZE_OK,
1182  static_cast<FwAssertArgType>(_status)
1183  );
1184 #endif
1185  _status = _logBuff.serialize(index);
1186  FW_ASSERT(
1187  _status == Fw::FW_SERIALIZE_OK,
1188  static_cast<FwAssertArgType>(_status)
1189  );
1190 
1191  this->m_Log_OutputPort[0].invoke(
1192  _id,
1193  _logTime,
1195  _logBuff
1196  );
1197  }
1198 
1199  // Emit the event on the text log port
1200 #if FW_ENABLE_TEXT_LOGGING
1201  if (this->m_LogText_OutputPort[0].isConnected()) {
1202 #if FW_OBJECT_NAMES == 1
1203  const char* _formatString =
1204  "(%s) %s: The %s queue at index %" PRIu32 " overflowed";
1205 #else
1206  const char* _formatString =
1207  "%s: The %s queue at index %" PRIu32 " overflowed";
1208 #endif
1209 
1210  Fw::String queueTypeStr;
1211  queueType.toString(queueTypeStr);
1212 
1213  Fw::TextLogString _logString;
1214  _logString.format(
1215  _formatString,
1216 #if FW_OBJECT_NAMES == 1
1217  this->m_objName.toChar(),
1218 #endif
1219  "QueueOverflow ",
1220  queueTypeStr.toChar(),
1221  index
1222  );
1223 
1224  this->m_LogText_OutputPort[0].invoke(
1225  _id,
1226  _logTime,
1228  _logString
1229  );
1230  }
1231 #endif
1232  }
1233 
1234  // ----------------------------------------------------------------------
1235  // Telemetry write functions
1236  // ----------------------------------------------------------------------
1237 
1240  const Svc::ComQueueDepth& arg,
1241  Fw::Time _tlmTime
1242  )
1243  {
1244  if (this->m_Tlm_OutputPort[0].isConnected()) {
1245  if (
1246  this->m_Time_OutputPort[0].isConnected() &&
1247  (_tlmTime == Fw::ZERO_TIME)
1248  ) {
1249  this->m_Time_OutputPort[0].invoke(_tlmTime);
1250  }
1251 
1252  Fw::TlmBuffer _tlmBuff;
1253  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1254  FW_ASSERT(
1255  _stat == Fw::FW_SERIALIZE_OK,
1256  static_cast<FwAssertArgType>(_stat)
1257  );
1258 
1259  FwChanIdType _id;
1260 
1261  _id = this->getIdBase() + CHANNELID_COMQUEUEDEPTH;
1262 
1263  this->m_Tlm_OutputPort[0].invoke(
1264  _id,
1265  _tlmTime,
1266  _tlmBuff
1267  );
1268  }
1269  }
1270 
1273  const Svc::BuffQueueDepth& arg,
1274  Fw::Time _tlmTime
1275  )
1276  {
1277  if (this->m_Tlm_OutputPort[0].isConnected()) {
1278  if (
1279  this->m_Time_OutputPort[0].isConnected() &&
1280  (_tlmTime == Fw::ZERO_TIME)
1281  ) {
1282  this->m_Time_OutputPort[0].invoke(_tlmTime);
1283  }
1284 
1285  Fw::TlmBuffer _tlmBuff;
1286  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1287  FW_ASSERT(
1288  _stat == Fw::FW_SERIALIZE_OK,
1289  static_cast<FwAssertArgType>(_stat)
1290  );
1291 
1292  FwChanIdType _id;
1293 
1294  _id = this->getIdBase() + CHANNELID_BUFFQUEUEDEPTH;
1295 
1296  this->m_Tlm_OutputPort[0].invoke(
1297  _id,
1298  _tlmTime,
1299  _tlmBuff
1300  );
1301  }
1302  }
1303 
1304  // ----------------------------------------------------------------------
1305  // Time
1306  // ----------------------------------------------------------------------
1307 
1309  getTime()
1310  {
1311  if (this->m_Time_OutputPort[0].isConnected()) {
1312  Fw::Time _time;
1313  this->m_Time_OutputPort[0].invoke(_time);
1314  return _time;
1315  }
1316  else {
1317  return Fw::Time(TB_NONE, 0, 0);
1318  }
1319  }
1320 
1321  // ----------------------------------------------------------------------
1322  // Message dispatch functions
1323  // ----------------------------------------------------------------------
1324 
1325  Fw::QueuedComponentBase::MsgDispatchStatus ComQueueComponentBase ::
1326  doDispatch()
1327  {
1328  ComponentIpcSerializableBuffer msg;
1329  FwQueuePriorityType priority = 0;
1330 
1331  Os::Queue::Status msgStatus = this->m_queue.receive(
1332  msg,
1334  priority
1335  );
1336  FW_ASSERT(
1337  msgStatus == Os::Queue::OP_OK,
1338  static_cast<FwAssertArgType>(msgStatus)
1339  );
1340 
1341  // Reset to beginning of buffer
1342  msg.resetDeser();
1343 
1344  FwEnumStoreType desMsg = 0;
1345  Fw::SerializeStatus deserStatus = msg.deserialize(desMsg);
1346  FW_ASSERT(
1347  deserStatus == Fw::FW_SERIALIZE_OK,
1348  static_cast<FwAssertArgType>(deserStatus)
1349  );
1350 
1351  MsgTypeEnum msgType = static_cast<MsgTypeEnum>(desMsg);
1352 
1353  if (msgType == COMQUEUE_COMPONENT_EXIT) {
1354  return MSG_DISPATCH_EXIT;
1355  }
1356 
1357  FwIndexType portNum = 0;
1358  deserStatus = msg.deserialize(portNum);
1359  FW_ASSERT(
1360  deserStatus == Fw::FW_SERIALIZE_OK,
1361  static_cast<FwAssertArgType>(deserStatus)
1362  );
1363 
1364  switch (msgType) {
1365  // Handle async input port buffQueueIn
1366  case BUFFQUEUEIN_BUFFERSEND: {
1367  // Deserialize argument fwBuffer
1368  Fw::Buffer fwBuffer;
1369  deserStatus = msg.deserialize(fwBuffer);
1370  FW_ASSERT(
1371  deserStatus == Fw::FW_SERIALIZE_OK,
1372  static_cast<FwAssertArgType>(deserStatus)
1373  );
1374  // Call handler function
1375  this->buffQueueIn_handler(
1376  portNum,
1377  fwBuffer
1378  );
1379 
1380  break;
1381  }
1382 
1383  // Handle async input port comQueueIn
1384  case COMQUEUEIN_COM: {
1385  // Deserialize argument data
1386  Fw::ComBuffer data;
1387  deserStatus = msg.deserialize(data);
1388  FW_ASSERT(
1389  deserStatus == Fw::FW_SERIALIZE_OK,
1390  static_cast<FwAssertArgType>(deserStatus)
1391  );
1392 
1393  // Deserialize argument context
1394  U32 context;
1395  deserStatus = msg.deserialize(context);
1396  FW_ASSERT(
1397  deserStatus == Fw::FW_SERIALIZE_OK,
1398  static_cast<FwAssertArgType>(deserStatus)
1399  );
1400  // Call handler function
1401  this->comQueueIn_handler(
1402  portNum,
1403  data,
1404  context
1405  );
1406 
1407  break;
1408  }
1409 
1410  // Handle async input port comStatusIn
1411  case COMSTATUSIN_SUCCESSCONDITION: {
1412  // Deserialize argument condition
1413  Fw::Success condition;
1414  deserStatus = msg.deserialize(condition);
1415  FW_ASSERT(
1416  deserStatus == Fw::FW_SERIALIZE_OK,
1417  static_cast<FwAssertArgType>(deserStatus)
1418  );
1419  // Call handler function
1420  this->comStatusIn_handler(
1421  portNum,
1422  condition
1423  );
1424 
1425  break;
1426  }
1427 
1428  // Handle async input port run
1429  case RUN_SCHED: {
1430  // Deserialize argument context
1431  U32 context;
1432  deserStatus = msg.deserialize(context);
1433  FW_ASSERT(
1434  deserStatus == Fw::FW_SERIALIZE_OK,
1435  static_cast<FwAssertArgType>(deserStatus)
1436  );
1437  // Call handler function
1438  this->run_handler(
1439  portNum,
1440  context
1441  );
1442 
1443  break;
1444  }
1445 
1446  default:
1447  return MSG_DISPATCH_ERROR;
1448  }
1449 
1450  return MSG_DISPATCH_OK;
1451  }
1452 
1453  // ----------------------------------------------------------------------
1454  // Calls for messages received on typed input ports
1455  // ----------------------------------------------------------------------
1456 
1457  void ComQueueComponentBase ::
1458  m_p_buffQueueIn_in(
1459  Fw::PassiveComponentBase* callComp,
1460  FwIndexType portNum,
1461  Fw::Buffer& fwBuffer
1462  )
1463  {
1464  FW_ASSERT(callComp);
1465  ComQueueComponentBase* compPtr = static_cast<ComQueueComponentBase*>(callComp);
1466  compPtr->buffQueueIn_handlerBase(
1467  portNum,
1468  fwBuffer
1469  );
1470  }
1471 
1472  void ComQueueComponentBase ::
1473  m_p_comQueueIn_in(
1474  Fw::PassiveComponentBase* callComp,
1475  FwIndexType portNum,
1476  Fw::ComBuffer& data,
1477  U32 context
1478  )
1479  {
1480  FW_ASSERT(callComp);
1481  ComQueueComponentBase* compPtr = static_cast<ComQueueComponentBase*>(callComp);
1482  compPtr->comQueueIn_handlerBase(
1483  portNum,
1484  data,
1485  context
1486  );
1487  }
1488 
1489  void ComQueueComponentBase ::
1490  m_p_comStatusIn_in(
1491  Fw::PassiveComponentBase* callComp,
1492  FwIndexType portNum,
1493  Fw::Success& condition
1494  )
1495  {
1496  FW_ASSERT(callComp);
1497  ComQueueComponentBase* compPtr = static_cast<ComQueueComponentBase*>(callComp);
1498  compPtr->comStatusIn_handlerBase(
1499  portNum,
1500  condition
1501  );
1502  }
1503 
1504  void ComQueueComponentBase ::
1505  m_p_run_in(
1506  Fw::PassiveComponentBase* callComp,
1507  FwIndexType portNum,
1508  U32 context
1509  )
1510  {
1511  FW_ASSERT(callComp);
1512  ComQueueComponentBase* compPtr = static_cast<ComQueueComponentBase*>(callComp);
1513  compPtr->run_handlerBase(
1514  portNum,
1515  context
1516  );
1517  }
1518 
1519 }
#define FW_ASSERT(...)
Definition: Assert.hpp:14
U8 BYTE
byte type
Definition: BasicTypes.h:31
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:30
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.h:70
#define PRI_PlatformIntType
@ TB_NONE
No time base has been established.
Definition: FpConfig.h:70
I32 FwEnumStoreType
Definition: FpConfig.h:64
PlatformAssertArgType FwAssertArgType
Definition: FpConfig.h:39
U32 FwChanIdType
Definition: FpConfig.h:95
U32 FwEventIdType
Definition: FpConfig.h:103
PlatformSizeType FwSizeType
Definition: FpConfig.h:35
PlatformQueuePriorityType FwQueuePriorityType
Definition: FpConfig.h:55
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects)
Definition: FpConfig.h:148
@ 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::Status createQueue(FwSizeType depth, FwSizeType 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
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
BlockingType
message type
Definition: Queue.hpp:44
@ BLOCKING
Message will block until space is available.
Definition: Queue.hpp:45
@ NONBLOCKING
Message will return with status when space is unavailable.
Definition: Queue.hpp:46
Status
status returned from the queue send function
Definition: Queue.hpp:30
@ OP_OK
message sent/received okay
Definition: Queue.hpp:31
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.
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())
FwIndexType getNum_deallocate_OutputPorts() const
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)
void set_deallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to deallocate[portNum].
@ CHANNELID_BUFFQUEUEDEPTH
Channel ID for buffQueueDepth.
@ CHANNELID_COMQUEUEDEPTH
Channel ID for comQueueDepth.
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)
@ EVENTID_QUEUEOVERFLOW
Queue overflow event.
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
@ OP_OK
Operation succeeded.
Definition: Os.hpp:26