F´ Flight Software - C/C++ Documentation
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  BUFFERQUEUEIN_BUFFERSEND,
20  COMPACKETQUEUEIN_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 {
28  BYTE bufferQueueInPortSize[Fw::InputBufferSendPort::SERIALIZED_SIZE];
29  BYTE comPacketQueueInPortSize[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  // Offset into data in buffer: Size of message ID and port number
44  DATA_OFFSET = sizeof(FwEnumStoreType) + sizeof(FwIndexType),
45  // Max data size
46  MAX_DATA_SIZE = sizeof(BuffUnion),
47  // Max message size: Size of message id + size of port + max data size
48  SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
49  };
50 
51  Fw::Serializable::SizeType getBuffCapacity() const {
52  return sizeof(m_buff);
53  }
54 
55  U8* getBuffAddr() {
56  return m_buff;
57  }
58 
59  const U8* getBuffAddr() const {
60  return m_buff;
61  }
62 
63  private:
64  // Should be the max of all the input ports serialized sizes...
65  U8 m_buff[SERIALIZATION_SIZE];
66 
67  };
68  }
69 
70  // ----------------------------------------------------------------------
71  // Component initialization
72  // ----------------------------------------------------------------------
73 
76  FwSizeType queueDepth,
77  FwEnumStoreType instance
78  )
79  {
80  // Initialize base class
82 
83  // Connect input port bufferQueueIn
84  for (
85  FwIndexType port = 0;
86  port < static_cast<FwIndexType>(this->getNum_bufferQueueIn_InputPorts());
87  port++
88  ) {
89  this->m_bufferQueueIn_InputPort[port].init();
90  this->m_bufferQueueIn_InputPort[port].addCallComp(
91  this,
92  m_p_bufferQueueIn_in
93  );
94  this->m_bufferQueueIn_InputPort[port].setPortNum(port);
95 
96 #if FW_OBJECT_NAMES == 1
97  Fw::ObjectName portName;
98  portName.format(
99  "%s_bufferQueueIn_InputPort[%" PRI_FwIndexType "]",
100  this->m_objName.toChar(),
101  port
102  );
103  this->m_bufferQueueIn_InputPort[port].setObjName(portName.toChar());
104 #endif
105  }
106 
107  // Connect input port bufferReturnIn
108  for (
109  FwIndexType port = 0;
110  port < static_cast<FwIndexType>(this->getNum_bufferReturnIn_InputPorts());
111  port++
112  ) {
113  this->m_bufferReturnIn_InputPort[port].init();
114  this->m_bufferReturnIn_InputPort[port].addCallComp(
115  this,
116  m_p_bufferReturnIn_in
117  );
118  this->m_bufferReturnIn_InputPort[port].setPortNum(port);
119 
120 #if FW_OBJECT_NAMES == 1
121  Fw::ObjectName portName;
122  portName.format(
123  "%s_bufferReturnIn_InputPort[%" PRI_FwIndexType "]",
124  this->m_objName.toChar(),
125  port
126  );
127  this->m_bufferReturnIn_InputPort[port].setObjName(portName.toChar());
128 #endif
129  }
130 
131  // Connect input port comPacketQueueIn
132  for (
133  FwIndexType port = 0;
134  port < static_cast<FwIndexType>(this->getNum_comPacketQueueIn_InputPorts());
135  port++
136  ) {
137  this->m_comPacketQueueIn_InputPort[port].init();
138  this->m_comPacketQueueIn_InputPort[port].addCallComp(
139  this,
140  m_p_comPacketQueueIn_in
141  );
142  this->m_comPacketQueueIn_InputPort[port].setPortNum(port);
143 
144 #if FW_OBJECT_NAMES == 1
145  Fw::ObjectName portName;
146  portName.format(
147  "%s_comPacketQueueIn_InputPort[%" PRI_FwIndexType "]",
148  this->m_objName.toChar(),
149  port
150  );
151  this->m_comPacketQueueIn_InputPort[port].setObjName(portName.toChar());
152 #endif
153  }
154 
155  // Connect input port comStatusIn
156  for (
157  FwIndexType port = 0;
158  port < static_cast<FwIndexType>(this->getNum_comStatusIn_InputPorts());
159  port++
160  ) {
161  this->m_comStatusIn_InputPort[port].init();
162  this->m_comStatusIn_InputPort[port].addCallComp(
163  this,
164  m_p_comStatusIn_in
165  );
166  this->m_comStatusIn_InputPort[port].setPortNum(port);
167 
168 #if FW_OBJECT_NAMES == 1
169  Fw::ObjectName portName;
170  portName.format(
171  "%s_comStatusIn_InputPort[%" PRI_FwIndexType "]",
172  this->m_objName.toChar(),
173  port
174  );
175  this->m_comStatusIn_InputPort[port].setObjName(portName.toChar());
176 #endif
177  }
178 
179  // Connect input port run
180  for (
181  FwIndexType port = 0;
182  port < static_cast<FwIndexType>(this->getNum_run_InputPorts());
183  port++
184  ) {
185  this->m_run_InputPort[port].init();
186  this->m_run_InputPort[port].addCallComp(
187  this,
188  m_p_run_in
189  );
190  this->m_run_InputPort[port].setPortNum(port);
191 
192 #if FW_OBJECT_NAMES == 1
193  Fw::ObjectName portName;
194  portName.format(
195  "%s_run_InputPort[%" PRI_FwIndexType "]",
196  this->m_objName.toChar(),
197  port
198  );
199  this->m_run_InputPort[port].setObjName(portName.toChar());
200 #endif
201  }
202 
203  // Connect output port Log
204  for (
205  FwIndexType port = 0;
206  port < static_cast<FwIndexType>(this->getNum_Log_OutputPorts());
207  port++
208  ) {
209  this->m_Log_OutputPort[port].init();
210 
211 #if FW_OBJECT_NAMES == 1
212  Fw::ObjectName portName;
213  portName.format(
214  "%s_Log_OutputPort[%" PRI_FwIndexType "]",
215  this->m_objName.toChar(),
216  port
217  );
218  this->m_Log_OutputPort[port].setObjName(portName.toChar());
219 #endif
220  }
221 
222 #if FW_ENABLE_TEXT_LOGGING == 1
223  // Connect output port LogText
224  for (
225  FwIndexType port = 0;
226  port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
227  port++
228  ) {
229  this->m_LogText_OutputPort[port].init();
230 
231 #if FW_OBJECT_NAMES == 1
232  Fw::ObjectName portName;
233  portName.format(
234  "%s_LogText_OutputPort[%" PRI_FwIndexType "]",
235  this->m_objName.toChar(),
236  port
237  );
238  this->m_LogText_OutputPort[port].setObjName(portName.toChar());
239 #endif
240  }
241 #endif
242 
243  // Connect output port Time
244  for (
245  FwIndexType port = 0;
246  port < static_cast<FwIndexType>(this->getNum_Time_OutputPorts());
247  port++
248  ) {
249  this->m_Time_OutputPort[port].init();
250 
251 #if FW_OBJECT_NAMES == 1
252  Fw::ObjectName portName;
253  portName.format(
254  "%s_Time_OutputPort[%" PRI_FwIndexType "]",
255  this->m_objName.toChar(),
256  port
257  );
258  this->m_Time_OutputPort[port].setObjName(portName.toChar());
259 #endif
260  }
261 
262  // Connect output port Tlm
263  for (
264  FwIndexType port = 0;
265  port < static_cast<FwIndexType>(this->getNum_Tlm_OutputPorts());
266  port++
267  ) {
268  this->m_Tlm_OutputPort[port].init();
269 
270 #if FW_OBJECT_NAMES == 1
271  Fw::ObjectName portName;
272  portName.format(
273  "%s_Tlm_OutputPort[%" PRI_FwIndexType "]",
274  this->m_objName.toChar(),
275  port
276  );
277  this->m_Tlm_OutputPort[port].setObjName(portName.toChar());
278 #endif
279  }
280 
281  // Connect output port bufferReturnOut
282  for (
283  FwIndexType port = 0;
284  port < static_cast<FwIndexType>(this->getNum_bufferReturnOut_OutputPorts());
285  port++
286  ) {
287  this->m_bufferReturnOut_OutputPort[port].init();
288 
289 #if FW_OBJECT_NAMES == 1
290  Fw::ObjectName portName;
291  portName.format(
292  "%s_bufferReturnOut_OutputPort[%" PRI_FwIndexType "]",
293  this->m_objName.toChar(),
294  port
295  );
296  this->m_bufferReturnOut_OutputPort[port].setObjName(portName.toChar());
297 #endif
298  }
299 
300  // Connect output port queueSend
301  for (
302  FwIndexType port = 0;
303  port < static_cast<FwIndexType>(this->getNum_queueSend_OutputPorts());
304  port++
305  ) {
306  this->m_queueSend_OutputPort[port].init();
307 
308 #if FW_OBJECT_NAMES == 1
309  Fw::ObjectName portName;
310  portName.format(
311  "%s_queueSend_OutputPort[%" PRI_FwIndexType "]",
312  this->m_objName.toChar(),
313  port
314  );
315  this->m_queueSend_OutputPort[port].setObjName(portName.toChar());
316 #endif
317  }
318 
319  // Create the queue
320  Os::Queue::Status qStat = this->createQueue(
321  queueDepth,
322  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
323  );
324  FW_ASSERT(
325  Os::Queue::Status::OP_OK == qStat,
326  static_cast<FwAssertArgType>(qStat)
327  );
328  }
329 
330  // ----------------------------------------------------------------------
331  // Getters for typed input ports
332  // ----------------------------------------------------------------------
333 
336  {
337  FW_ASSERT(
338  (0 <= portNum) && (portNum < this->getNum_bufferQueueIn_InputPorts()),
339  static_cast<FwAssertArgType>(portNum)
340  );
341 
342  return &this->m_bufferQueueIn_InputPort[portNum];
343  }
344 
347  {
348  FW_ASSERT(
349  (0 <= portNum) && (portNum < this->getNum_bufferReturnIn_InputPorts()),
350  static_cast<FwAssertArgType>(portNum)
351  );
352 
353  return &this->m_bufferReturnIn_InputPort[portNum];
354  }
355 
358  {
359  FW_ASSERT(
360  (0 <= portNum) && (portNum < this->getNum_comPacketQueueIn_InputPorts()),
361  static_cast<FwAssertArgType>(portNum)
362  );
363 
364  return &this->m_comPacketQueueIn_InputPort[portNum];
365  }
366 
369  {
370  FW_ASSERT(
371  (0 <= portNum) && (portNum < this->getNum_comStatusIn_InputPorts()),
372  static_cast<FwAssertArgType>(portNum)
373  );
374 
375  return &this->m_comStatusIn_InputPort[portNum];
376  }
377 
380  {
381  FW_ASSERT(
382  (0 <= portNum) && (portNum < this->getNum_run_InputPorts()),
383  static_cast<FwAssertArgType>(portNum)
384  );
385 
386  return &this->m_run_InputPort[portNum];
387  }
388 
389  // ----------------------------------------------------------------------
390  // Connect input ports to special output ports
391  // ----------------------------------------------------------------------
392 
395  FwIndexType portNum,
396  Fw::InputLogPort* port
397  )
398  {
399  FW_ASSERT(
400  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
401  static_cast<FwAssertArgType>(portNum)
402  );
403 
404  this->m_Log_OutputPort[portNum].addCallPort(port);
405  }
406 
407 #if FW_ENABLE_TEXT_LOGGING == 1
408 
409  void ComQueueComponentBase ::
410  set_LogText_OutputPort(
411  FwIndexType portNum,
413  )
414  {
415  FW_ASSERT(
416  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
417  static_cast<FwAssertArgType>(portNum)
418  );
419 
420  this->m_LogText_OutputPort[portNum].addCallPort(port);
421  }
422 
423 #endif
424 
427  FwIndexType portNum,
428  Fw::InputTimePort* port
429  )
430  {
431  FW_ASSERT(
432  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
433  static_cast<FwAssertArgType>(portNum)
434  );
435 
436  this->m_Time_OutputPort[portNum].addCallPort(port);
437  }
438 
441  FwIndexType portNum,
442  Fw::InputTlmPort* port
443  )
444  {
445  FW_ASSERT(
446  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
447  static_cast<FwAssertArgType>(portNum)
448  );
449 
450  this->m_Tlm_OutputPort[portNum].addCallPort(port);
451  }
452 
453  // ----------------------------------------------------------------------
454  // Connect typed input ports to typed output ports
455  // ----------------------------------------------------------------------
456 
459  FwIndexType portNum,
461  )
462  {
463  FW_ASSERT(
464  (0 <= portNum) && (portNum < this->getNum_bufferReturnOut_OutputPorts()),
465  static_cast<FwAssertArgType>(portNum)
466  );
467 
468  this->m_bufferReturnOut_OutputPort[portNum].addCallPort(port);
469  }
470 
473  FwIndexType portNum,
475  )
476  {
477  FW_ASSERT(
478  (0 <= portNum) && (portNum < this->getNum_queueSend_OutputPorts()),
479  static_cast<FwAssertArgType>(portNum)
480  );
481 
482  this->m_queueSend_OutputPort[portNum].addCallPort(port);
483  }
484 
485 #if FW_PORT_SERIALIZATION
486 
487  // ----------------------------------------------------------------------
488  // Connect serial input ports to special output ports
489  // ----------------------------------------------------------------------
490 
493  FwIndexType portNum,
494  Fw::InputSerializePort* port
495  )
496  {
497  FW_ASSERT(
498  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
499  static_cast<FwAssertArgType>(portNum)
500  );
501 
502  this->m_Log_OutputPort[portNum].registerSerialPort(port);
503  }
504 
505 #if FW_ENABLE_TEXT_LOGGING == 1
506 
507  void ComQueueComponentBase ::
508  set_LogText_OutputPort(
509  FwIndexType portNum,
510  Fw::InputSerializePort* port
511  )
512  {
513  FW_ASSERT(
514  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
515  static_cast<FwAssertArgType>(portNum)
516  );
517 
518  this->m_LogText_OutputPort[portNum].registerSerialPort(port);
519  }
520 
521 #endif
522 
525  FwIndexType portNum,
526  Fw::InputSerializePort* port
527  )
528  {
529  FW_ASSERT(
530  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
531  static_cast<FwAssertArgType>(portNum)
532  );
533 
534  this->m_Time_OutputPort[portNum].registerSerialPort(port);
535  }
536 
539  FwIndexType portNum,
540  Fw::InputSerializePort* port
541  )
542  {
543  FW_ASSERT(
544  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
545  static_cast<FwAssertArgType>(portNum)
546  );
547 
548  this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
549  }
550 
551 #endif
552 
553 #if FW_PORT_SERIALIZATION
554 
555  // ----------------------------------------------------------------------
556  // Connect serial input ports to typed output ports
557  // ----------------------------------------------------------------------
558 
561  FwIndexType portNum,
562  Fw::InputSerializePort* port
563  )
564  {
565  FW_ASSERT(
566  (0 <= portNum) && (portNum < this->getNum_bufferReturnOut_OutputPorts()),
567  static_cast<FwAssertArgType>(portNum)
568  );
569 
570  this->m_bufferReturnOut_OutputPort[portNum].registerSerialPort(port);
571  }
572 
575  FwIndexType portNum,
576  Fw::InputSerializePort* port
577  )
578  {
579  FW_ASSERT(
580  (0 <= portNum) && (portNum < this->getNum_queueSend_OutputPorts()),
581  static_cast<FwAssertArgType>(portNum)
582  );
583 
584  this->m_queueSend_OutputPort[portNum].registerSerialPort(port);
585  }
586 
587 #endif
588 
589  // ----------------------------------------------------------------------
590  // Component construction and destruction
591  // ----------------------------------------------------------------------
592 
594  ComQueueComponentBase(const char* compName) :
595  Fw::ActiveComponentBase(compName)
596  {
597 
598  }
599 
602  {
603 
604  }
605 
606  // ----------------------------------------------------------------------
607  // Getters for numbers of typed input ports
608  // ----------------------------------------------------------------------
609 
612  {
613  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_bufferQueueIn_InputPort));
614  }
615 
618  {
619  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_bufferReturnIn_InputPort));
620  }
621 
624  {
625  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_comPacketQueueIn_InputPort));
626  }
627 
630  {
631  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_comStatusIn_InputPort));
632  }
633 
636  {
637  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_run_InputPort));
638  }
639 
640  // ----------------------------------------------------------------------
641  // Getters for numbers of special output ports
642  // ----------------------------------------------------------------------
643 
646  {
647  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Log_OutputPort));
648  }
649 
650 #if FW_ENABLE_TEXT_LOGGING == 1
651 
652  FwIndexType ComQueueComponentBase ::
653  getNum_LogText_OutputPorts() const
654  {
655  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_LogText_OutputPort));
656  }
657 
658 #endif
659 
662  {
663  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Time_OutputPort));
664  }
665 
668  {
669  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_Tlm_OutputPort));
670  }
671 
672  // ----------------------------------------------------------------------
673  // Getters for numbers of typed output ports
674  // ----------------------------------------------------------------------
675 
678  {
679  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_bufferReturnOut_OutputPort));
680  }
681 
684  {
685  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_queueSend_OutputPort));
686  }
687 
688  // ----------------------------------------------------------------------
689  // Connection status queries for special output ports
690  // ----------------------------------------------------------------------
691 
694  {
695  FW_ASSERT(
696  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
697  static_cast<FwAssertArgType>(portNum)
698  );
699 
700  return this->m_Log_OutputPort[portNum].isConnected();
701  }
702 
703 #if FW_ENABLE_TEXT_LOGGING == 1
704 
705  bool ComQueueComponentBase ::
706  isConnected_LogText_OutputPort(FwIndexType portNum)
707  {
708  FW_ASSERT(
709  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
710  static_cast<FwAssertArgType>(portNum)
711  );
712 
713  return this->m_LogText_OutputPort[portNum].isConnected();
714  }
715 
716 #endif
717 
720  {
721  FW_ASSERT(
722  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
723  static_cast<FwAssertArgType>(portNum)
724  );
725 
726  return this->m_Time_OutputPort[portNum].isConnected();
727  }
728 
731  {
732  FW_ASSERT(
733  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
734  static_cast<FwAssertArgType>(portNum)
735  );
736 
737  return this->m_Tlm_OutputPort[portNum].isConnected();
738  }
739 
740  // ----------------------------------------------------------------------
741  // Connection status queries for typed output ports
742  // ----------------------------------------------------------------------
743 
746  {
747  FW_ASSERT(
748  (0 <= portNum) && (portNum < this->getNum_bufferReturnOut_OutputPorts()),
749  static_cast<FwAssertArgType>(portNum)
750  );
751 
752  return this->m_bufferReturnOut_OutputPort[portNum].isConnected();
753  }
754 
757  {
758  FW_ASSERT(
759  (0 <= portNum) && (portNum < this->getNum_queueSend_OutputPorts()),
760  static_cast<FwAssertArgType>(portNum)
761  );
762 
763  return this->m_queueSend_OutputPort[portNum].isConnected();
764  }
765 
766  // ----------------------------------------------------------------------
767  // Port handler base-class functions for typed input ports
768  //
769  // Call these functions directly to bypass the corresponding ports
770  // ----------------------------------------------------------------------
771 
774  FwIndexType portNum,
775  Fw::Buffer& fwBuffer
776  )
777  {
778  // Make sure port number is valid
779  FW_ASSERT(
780  (0 <= portNum) && (portNum < this->getNum_bufferQueueIn_InputPorts()),
781  static_cast<FwAssertArgType>(portNum)
782  );
783 
784  // Call pre-message hook
786  portNum,
787  fwBuffer
788  );
789  ComponentIpcSerializableBuffer msg;
791 
792  // Serialize message ID
793  _status = msg.serialize(
794  static_cast<FwEnumStoreType>(BUFFERQUEUEIN_BUFFERSEND)
795  );
796  FW_ASSERT(
797  _status == Fw::FW_SERIALIZE_OK,
798  static_cast<FwAssertArgType>(_status)
799  );
800 
801  // Serialize port number
802  _status = msg.serialize(portNum);
803  FW_ASSERT(
804  _status == Fw::FW_SERIALIZE_OK,
805  static_cast<FwAssertArgType>(_status)
806  );
807 
808  // Serialize argument fwBuffer
809  _status = msg.serialize(fwBuffer);
810  FW_ASSERT(
811  _status == Fw::FW_SERIALIZE_OK,
812  static_cast<FwAssertArgType>(_status)
813  );
814 
815  // Send message
817  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
818 
819  if (qStatus == Os::Queue::Status::FULL) {
820  this->bufferQueueIn_overflowHook(portNum, fwBuffer);
821  return;
822  }
823 
824  FW_ASSERT(
825  qStatus == Os::Queue::OP_OK,
826  static_cast<FwAssertArgType>(qStatus)
827  );
828  }
829 
832  FwIndexType portNum,
833  Fw::Buffer& data,
834  const ComCfg::FrameContext& context
835  )
836  {
837  // Make sure port number is valid
838  FW_ASSERT(
839  (0 <= portNum) && (portNum < this->getNum_bufferReturnIn_InputPorts()),
840  static_cast<FwAssertArgType>(portNum)
841  );
842 
843  // Call handler function
845  portNum,
846  data,
847  context
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  (0 <= portNum) && (portNum < this->getNum_comPacketQueueIn_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>(COMPACKETQUEUEIN_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  (0 <= portNum) && (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  (0 <= portNum) && (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  (0 <= portNum) && (portNum < this->getNum_bufferReturnOut_OutputPorts()),
1086  static_cast<FwAssertArgType>(portNum)
1087  );
1088 
1089  FW_ASSERT(
1090  this->m_bufferReturnOut_OutputPort[portNum].isConnected(),
1091  static_cast<FwAssertArgType>(portNum)
1092  );
1093  this->m_bufferReturnOut_OutputPort[portNum].invoke(
1094  fwBuffer
1095  );
1096  }
1097 
1100  FwIndexType portNum,
1101  Fw::Buffer& data,
1102  const ComCfg::FrameContext& context
1103  )
1104  {
1105  FW_ASSERT(
1106  (0 <= portNum) && (portNum < this->getNum_queueSend_OutputPorts()),
1107  static_cast<FwAssertArgType>(portNum)
1108  );
1109 
1110  FW_ASSERT(
1111  this->m_queueSend_OutputPort[portNum].isConnected(),
1112  static_cast<FwAssertArgType>(portNum)
1113  );
1114  this->m_queueSend_OutputPort[portNum].invoke(
1115  data,
1116  context
1117  );
1118  }
1119 
1120  // ----------------------------------------------------------------------
1121  // Event logging functions
1122  // ----------------------------------------------------------------------
1123 
1126  Svc::QueueType queueType,
1127  U32 index
1128  ) const
1129  {
1130  // Get the time
1131  Fw::Time _logTime;
1132  if (this->m_Time_OutputPort[0].isConnected()) {
1133  this->m_Time_OutputPort[0].invoke(_logTime);
1134  }
1135 
1136  FwEventIdType _id = static_cast<FwEventIdType>(0);
1137 
1138  _id = this->getIdBase() + EVENTID_QUEUEOVERFLOW;
1139 
1140  // Emit the event on the log port
1141  if (this->m_Log_OutputPort[0].isConnected()) {
1142  Fw::LogBuffer _logBuff;
1144 
1145 #if FW_AMPCS_COMPATIBLE
1146  // Serialize the number of arguments
1147  _status = _logBuff.serialize(static_cast<U8>(2));
1148  FW_ASSERT(
1149  _status == Fw::FW_SERIALIZE_OK,
1150  static_cast<FwAssertArgType>(_status)
1151  );
1152 #endif
1153 
1154 #if FW_AMPCS_COMPATIBLE
1155  // Serialize the argument size
1156  _status = _logBuff.serialize(
1157  static_cast<U8>(Svc::QueueType::SERIALIZED_SIZE)
1158  );
1159  FW_ASSERT(
1160  _status == Fw::FW_SERIALIZE_OK,
1161  static_cast<FwAssertArgType>(_status)
1162  );
1163 #endif
1164  _status = _logBuff.serialize(queueType);
1165  FW_ASSERT(
1166  _status == Fw::FW_SERIALIZE_OK,
1167  static_cast<FwAssertArgType>(_status)
1168  );
1169 
1170 #if FW_AMPCS_COMPATIBLE
1171  // Serialize the argument size
1172  _status = _logBuff.serialize(
1173  static_cast<U8>(sizeof(U32))
1174  );
1175  FW_ASSERT(
1176  _status == Fw::FW_SERIALIZE_OK,
1177  static_cast<FwAssertArgType>(_status)
1178  );
1179 #endif
1180  _status = _logBuff.serialize(index);
1181  FW_ASSERT(
1182  _status == Fw::FW_SERIALIZE_OK,
1183  static_cast<FwAssertArgType>(_status)
1184  );
1185 
1186  this->m_Log_OutputPort[0].invoke(
1187  _id,
1188  _logTime,
1190  _logBuff
1191  );
1192  }
1193 
1194  // Emit the event on the text log port
1195 #if FW_ENABLE_TEXT_LOGGING
1196  if (this->m_LogText_OutputPort[0].isConnected()) {
1197 #if FW_OBJECT_NAMES == 1
1198  const char* _formatString =
1199  "(%s) %s: The %s queue at index %" PRIu32 " overflowed";
1200 #else
1201  const char* _formatString =
1202  "%s: The %s queue at index %" PRIu32 " overflowed";
1203 #endif
1204 
1205  Fw::String queueTypeStr;
1206  queueType.toString(queueTypeStr);
1207 
1208  Fw::TextLogString _logString;
1209  _logString.format(
1210  _formatString,
1211 #if FW_OBJECT_NAMES == 1
1212  this->m_objName.toChar(),
1213 #endif
1214  "QueueOverflow ",
1215  queueTypeStr.toChar(),
1216  index
1217  );
1218 
1219  this->m_LogText_OutputPort[0].invoke(
1220  _id,
1221  _logTime,
1223  _logString
1224  );
1225  }
1226 #endif
1227  }
1228 
1229  // ----------------------------------------------------------------------
1230  // Telemetry write functions
1231  // ----------------------------------------------------------------------
1232 
1235  const Svc::ComQueueDepth& arg,
1236  Fw::Time _tlmTime
1237  ) const
1238  {
1239  if (this->m_Tlm_OutputPort[0].isConnected()) {
1240  if (
1241  this->m_Time_OutputPort[0].isConnected() &&
1242  (_tlmTime == Fw::ZERO_TIME)
1243  ) {
1244  this->m_Time_OutputPort[0].invoke(_tlmTime);
1245  }
1246 
1247  Fw::TlmBuffer _tlmBuff;
1248  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1249  FW_ASSERT(
1250  _stat == Fw::FW_SERIALIZE_OK,
1251  static_cast<FwAssertArgType>(_stat)
1252  );
1253 
1254  FwChanIdType _id;
1255 
1256  _id = this->getIdBase() + CHANNELID_COMQUEUEDEPTH;
1257 
1258  this->m_Tlm_OutputPort[0].invoke(
1259  _id,
1260  _tlmTime,
1261  _tlmBuff
1262  );
1263  }
1264  }
1265 
1268  const Svc::BuffQueueDepth& arg,
1269  Fw::Time _tlmTime
1270  ) const
1271  {
1272  if (this->m_Tlm_OutputPort[0].isConnected()) {
1273  if (
1274  this->m_Time_OutputPort[0].isConnected() &&
1275  (_tlmTime == Fw::ZERO_TIME)
1276  ) {
1277  this->m_Time_OutputPort[0].invoke(_tlmTime);
1278  }
1279 
1280  Fw::TlmBuffer _tlmBuff;
1281  Fw::SerializeStatus _stat = _tlmBuff.serialize(arg);
1282  FW_ASSERT(
1283  _stat == Fw::FW_SERIALIZE_OK,
1284  static_cast<FwAssertArgType>(_stat)
1285  );
1286 
1287  FwChanIdType _id;
1288 
1289  _id = this->getIdBase() + CHANNELID_BUFFQUEUEDEPTH;
1290 
1291  this->m_Tlm_OutputPort[0].invoke(
1292  _id,
1293  _tlmTime,
1294  _tlmBuff
1295  );
1296  }
1297  }
1298 
1299  // ----------------------------------------------------------------------
1300  // Time
1301  // ----------------------------------------------------------------------
1302 
1304  getTime() const
1305  {
1306  if (this->m_Time_OutputPort[0].isConnected()) {
1307  Fw::Time _time;
1308  this->m_Time_OutputPort[0].invoke(_time);
1309  return _time;
1310  }
1311  else {
1312  return Fw::Time(TB_NONE, 0, 0);
1313  }
1314  }
1315 
1316  // ----------------------------------------------------------------------
1317  // Message dispatch functions
1318  // ----------------------------------------------------------------------
1319 
1320  Fw::QueuedComponentBase::MsgDispatchStatus ComQueueComponentBase ::
1321  doDispatch()
1322  {
1323  ComponentIpcSerializableBuffer _msg;
1324  FwQueuePriorityType _priority = 0;
1325 
1326  Os::Queue::Status _msgStatus = this->m_queue.receive(
1327  _msg,
1329  _priority
1330  );
1331  FW_ASSERT(
1332  _msgStatus == Os::Queue::OP_OK,
1333  static_cast<FwAssertArgType>(_msgStatus)
1334  );
1335 
1336  // Reset to beginning of buffer
1337  _msg.resetDeser();
1338 
1339  FwEnumStoreType _desMsg = 0;
1340  Fw::SerializeStatus _deserStatus = _msg.deserialize(_desMsg);
1341  FW_ASSERT(
1342  _deserStatus == Fw::FW_SERIALIZE_OK,
1343  static_cast<FwAssertArgType>(_deserStatus)
1344  );
1345 
1346  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
1347 
1348  if (_msgType == COMQUEUE_COMPONENT_EXIT) {
1349  return MSG_DISPATCH_EXIT;
1350  }
1351 
1352  FwIndexType portNum = 0;
1353  _deserStatus = _msg.deserialize(portNum);
1354  FW_ASSERT(
1355  _deserStatus == Fw::FW_SERIALIZE_OK,
1356  static_cast<FwAssertArgType>(_deserStatus)
1357  );
1358 
1359  switch (_msgType) {
1360  // Handle async input port bufferQueueIn
1361  case BUFFERQUEUEIN_BUFFERSEND: {
1362  // Deserialize argument fwBuffer
1363  Fw::Buffer fwBuffer;
1364  _deserStatus = _msg.deserialize(fwBuffer);
1365  FW_ASSERT(
1366  _deserStatus == Fw::FW_SERIALIZE_OK,
1367  static_cast<FwAssertArgType>(_deserStatus)
1368  );
1369  // Call handler function
1370  this->bufferQueueIn_handler(
1371  portNum,
1372  fwBuffer
1373  );
1374 
1375  break;
1376  }
1377 
1378  // Handle async input port comPacketQueueIn
1379  case COMPACKETQUEUEIN_COM: {
1380  // Deserialize argument data
1381  Fw::ComBuffer data;
1382  _deserStatus = _msg.deserialize(data);
1383  FW_ASSERT(
1384  _deserStatus == Fw::FW_SERIALIZE_OK,
1385  static_cast<FwAssertArgType>(_deserStatus)
1386  );
1387 
1388  // Deserialize argument context
1389  U32 context;
1390  _deserStatus = _msg.deserialize(context);
1391  FW_ASSERT(
1392  _deserStatus == Fw::FW_SERIALIZE_OK,
1393  static_cast<FwAssertArgType>(_deserStatus)
1394  );
1395  // Call handler function
1397  portNum,
1398  data,
1399  context
1400  );
1401 
1402  break;
1403  }
1404 
1405  // Handle async input port comStatusIn
1406  case COMSTATUSIN_SUCCESSCONDITION: {
1407  // Deserialize argument condition
1408  Fw::Success condition;
1409  _deserStatus = _msg.deserialize(condition);
1410  FW_ASSERT(
1411  _deserStatus == Fw::FW_SERIALIZE_OK,
1412  static_cast<FwAssertArgType>(_deserStatus)
1413  );
1414  // Call handler function
1415  this->comStatusIn_handler(
1416  portNum,
1417  condition
1418  );
1419 
1420  break;
1421  }
1422 
1423  // Handle async input port run
1424  case RUN_SCHED: {
1425  // Deserialize argument context
1426  U32 context;
1427  _deserStatus = _msg.deserialize(context);
1428  FW_ASSERT(
1429  _deserStatus == Fw::FW_SERIALIZE_OK,
1430  static_cast<FwAssertArgType>(_deserStatus)
1431  );
1432  // Call handler function
1433  this->run_handler(
1434  portNum,
1435  context
1436  );
1437 
1438  break;
1439  }
1440 
1441  default:
1442  return MSG_DISPATCH_ERROR;
1443  }
1444 
1445  return MSG_DISPATCH_OK;
1446  }
1447 
1448  // ----------------------------------------------------------------------
1449  // Calls for messages received on typed input ports
1450  // ----------------------------------------------------------------------
1451 
1452  void ComQueueComponentBase ::
1453  m_p_bufferQueueIn_in(
1454  Fw::PassiveComponentBase* callComp,
1455  FwIndexType portNum,
1456  Fw::Buffer& fwBuffer
1457  )
1458  {
1459  FW_ASSERT(callComp);
1460  ComQueueComponentBase* compPtr = static_cast<ComQueueComponentBase*>(callComp);
1461  compPtr->bufferQueueIn_handlerBase(
1462  portNum,
1463  fwBuffer
1464  );
1465  }
1466 
1467  void ComQueueComponentBase ::
1468  m_p_bufferReturnIn_in(
1469  Fw::PassiveComponentBase* callComp,
1470  FwIndexType portNum,
1471  Fw::Buffer& data,
1472  const ComCfg::FrameContext& context
1473  )
1474  {
1475  FW_ASSERT(callComp);
1476  ComQueueComponentBase* compPtr = static_cast<ComQueueComponentBase*>(callComp);
1477  compPtr->bufferReturnIn_handlerBase(
1478  portNum,
1479  data,
1480  context
1481  );
1482  }
1483 
1484  void ComQueueComponentBase ::
1485  m_p_comPacketQueueIn_in(
1486  Fw::PassiveComponentBase* callComp,
1487  FwIndexType portNum,
1488  Fw::ComBuffer& data,
1489  U32 context
1490  )
1491  {
1492  FW_ASSERT(callComp);
1493  ComQueueComponentBase* compPtr = static_cast<ComQueueComponentBase*>(callComp);
1494  compPtr->comPacketQueueIn_handlerBase(
1495  portNum,
1496  data,
1497  context
1498  );
1499  }
1500 
1501  void ComQueueComponentBase ::
1502  m_p_comStatusIn_in(
1503  Fw::PassiveComponentBase* callComp,
1504  FwIndexType portNum,
1505  Fw::Success& condition
1506  )
1507  {
1508  FW_ASSERT(callComp);
1509  ComQueueComponentBase* compPtr = static_cast<ComQueueComponentBase*>(callComp);
1510  compPtr->comStatusIn_handlerBase(
1511  portNum,
1512  condition
1513  );
1514  }
1515 
1516  void ComQueueComponentBase ::
1517  m_p_run_in(
1518  Fw::PassiveComponentBase* callComp,
1519  FwIndexType portNum,
1520  U32 context
1521  )
1522  {
1523  FW_ASSERT(callComp);
1524  ComQueueComponentBase* compPtr = static_cast<ComQueueComponentBase*>(callComp);
1525  compPtr->run_handlerBase(
1526  portNum,
1527  context
1528  );
1529  }
1530 
1531 }
Serialization/Deserialization operation was successful.
virtual void comStatusIn_handler(FwIndexType portNum, Fw::Success &condition)=0
Handler for input port comStatusIn.
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
virtual ~ComQueueComponentBase()
Destroy ComQueueComponentBase object.
Definition: Time.hpp:9
virtual void bufferReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port bufferReturnIn.
Operation succeeded.
Definition: Os.hpp:26
FwIndexType getNum_bufferReturnOut_OutputPorts() const
PlatformSizeType FwSizeType
void tlmWrite_buffQueueDepth(const Svc::BuffQueueDepth &arg, Fw::Time _tlmTime=Fw::Time()) const
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
Definition: Queue.cpp:59
I32 FwEnumStoreType
The size of the serial representations of the port arguments.
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
Status
status returned from the queue send function
Definition: Queue.hpp:30
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
void init()
Initialization function.
Definition: SchedPortAc.cpp:56
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
const char * toChar() const
Definition: String.hpp:50
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
FwIndexType getNum_bufferQueueIn_InputPorts() const
FwIndexType getNum_Log_OutputPorts() const
Svc::InputSchedPort * get_run_InputPort(FwIndexType portNum)
U32 FwChanIdType
The type of a telemetry channel identifier.
void set_bufferReturnOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to bufferReturnOut[portNum].
const Time ZERO_TIME
Definition: Time.cpp:5
bool isConnected_bufferReturnOut_OutputPort(FwIndexType portNum)
void init()
Initialization function.
Definition: TlmPortAc.cpp:144
Os::Queue m_queue
queue object for active component
void addCallPort(InputComDataWithContextPort *callPort)
Register an input port.
Array of queue depths for Fw::Com types.
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:150
An enumeration of queue data types.
bool isConnected_Log_OutputPort(FwIndexType portNum)
void init()
Object initializer.
Definition: ObjBase.cpp:26
FwIndexType getNum_comPacketQueueIn_InputPorts() const
void init()
Initialization function.
Definition: ComPortAc.cpp:56
void comStatusIn_handlerBase(FwIndexType portNum, Fw::Success &condition)
Handler base-class function for input port comStatusIn.
U32 FwEventIdType
The type of an event identifier.
SerializeStatus
forward declaration for string
Message will block until space is available.
Definition: Queue.hpp:46
virtual void bufferQueueIn_preMsgHook(FwIndexType portNum, Fw::Buffer &fwBuffer)
Pre-message hook for async input port bufferQueueIn.
Svc::InputComDataWithContextPort * get_bufferReturnIn_InputPort(FwIndexType portNum)
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
void init()
Initialization function.
Definition: TimePortAc.cpp:128
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: ComPortAc.cpp:62
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
bool isConnected_Time_OutputPort(FwIndexType portNum)
void invoke(Fw::Buffer &fwBuffer) const
Invoke a port interface.
virtual void run_handler(FwIndexType portNum, U32 context)=0
Handler for input port run.
void run_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port run.
void init()
Initialization function.
void addCallPort(InputBufferSendPort *callPort)
Register an input port.
void invoke(Fw::Time &time) const
Invoke a port interface.
Definition: TimePortAc.cpp:147
Array of queue depths for Fw::Buffer types.
virtual void run_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port run.
const char * toChar() const
Definition: ObjectName.hpp:50
No time base has been established.
Definition: FpConfig.h:30
FwSizeType SizeType
void invoke(Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke a port interface.
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Definition: Queue.cpp:42
void log_WARNING_HI_QueueOverflow(Svc::QueueType queueType, U32 index) const
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
message to exit active component task
Fw::InputComPort * get_comPacketQueueIn_InputPort(FwIndexType portNum)
The size of the serial representations of the port arguments.
A serious but recoverable event.
void init()
Initialization function.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port interface.
Definition: TlmPortAc.cpp:163
bool isConnected() const
Definition: PortBase.cpp:42
virtual void bufferQueueIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port bufferQueueIn.
virtual void comPacketQueueIn_handler(FwIndexType portNum, Fw::ComBuffer &data, U32 context)=0
Handler for input port comPacketQueueIn.
void comPacketQueueIn_handlerBase(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Handler base-class function for input port comPacketQueueIn.
#define PRI_FwIndexType
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:55
void init()
Initialization function.
Definition: LogPortAc.cpp:151
virtual void comPacketQueueIn_preMsgHook(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Pre-message hook for async input port comPacketQueueIn.
void setPortNum(FwIndexType portNum)
Fw::InputBufferSendPort * get_bufferQueueIn_InputPort(FwIndexType portNum)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:56
FwIndexType getNum_bufferReturnIn_InputPorts() const
BlockingType
message type
Definition: Queue.hpp:45
The size of the serial representations of the port arguments.
Definition: ComPortAc.hpp:37
The size of the serial representations of the port arguments.
Definition: SchedPortAc.hpp:36
void init()
Initialization function.
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
void init()
Initialization function.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: SchedPortAc.cpp:62
Fw::InputSuccessConditionPort * get_comStatusIn_InputPort(FwIndexType portNum)
The size of the serial representation.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
Definition: LogPortAc.cpp:170
A message was sent requesting an exit of the loop.
bool isConnected_Tlm_OutputPort(FwIndexType portNum)
FwIndexType getNum_Time_OutputPorts() const
ComQueueComponentBase(const char *compName="")
Construct ComQueueComponentBase object.
PlatformIndexType FwIndexType
void queueSend_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port queueSend.
void bufferReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port bufferReturnIn.
bool isConnected_queueSend_OutputPort(FwIndexType portNum)
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.h:93
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
FwIndexType getNum_Tlm_OutputPorts() const
FwIndexType getNum_comStatusIn_InputPorts() const
Type used to pass context info between components during framing/deframing.
void incNumMsgDropped()
increment the number of messages dropped
void tlmWrite_comQueueDepth(const Svc::ComQueueDepth &arg, Fw::Time _tlmTime=Fw::Time()) const
RateGroupDivider component implementation.
message sent/received okay
Definition: Queue.hpp:31
U8 BYTE
byte type
Definition: BasicTypes.h:59
void set_queueSend_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to queueSend[portNum].
virtual void comStatusIn_preMsgHook(FwIndexType portNum, Fw::Success &condition)
Pre-message hook for async input port comStatusIn.
Message will return with status when space is unavailable.
Definition: Queue.hpp:47
virtual void bufferQueueIn_overflowHook(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Overflow hook for async input port bufferQueueIn.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:53
#define FW_ASSERT(...)
Definition: Assert.hpp:14
FwIndexType getNum_queueSend_OutputPorts() const
Success/Failure.
void init()
Initialization function.
void bufferQueueIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port bufferQueueIn.
void bufferReturnOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port bufferReturnOut.
FwIndexType getNum_run_InputPorts() const