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 
7 #include "Fw/Types/Assert.hpp"
9 #if FW_ENABLE_TEXT_LOGGING
10 #include "Fw/Types/String.hpp"
11 #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 getCapacity() 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 comPacketQueueIn
108  for (
109  FwIndexType port = 0;
110  port < static_cast<FwIndexType>(this->getNum_comPacketQueueIn_InputPorts());
111  port++
112  ) {
113  this->m_comPacketQueueIn_InputPort[port].init();
114  this->m_comPacketQueueIn_InputPort[port].addCallComp(
115  this,
116  m_p_comPacketQueueIn_in
117  );
118  this->m_comPacketQueueIn_InputPort[port].setPortNum(port);
119 
120 #if FW_OBJECT_NAMES == 1
121  Fw::ObjectName portName;
122  portName.format(
123  "%s_comPacketQueueIn_InputPort[%" PRI_FwIndexType "]",
124  this->m_objName.toChar(),
125  port
126  );
127  this->m_comPacketQueueIn_InputPort[port].setObjName(portName.toChar());
128 #endif
129  }
130 
131  // Connect input port comStatusIn
132  for (
133  FwIndexType port = 0;
134  port < static_cast<FwIndexType>(this->getNum_comStatusIn_InputPorts());
135  port++
136  ) {
137  this->m_comStatusIn_InputPort[port].init();
138  this->m_comStatusIn_InputPort[port].addCallComp(
139  this,
140  m_p_comStatusIn_in
141  );
142  this->m_comStatusIn_InputPort[port].setPortNum(port);
143 
144 #if FW_OBJECT_NAMES == 1
145  Fw::ObjectName portName;
146  portName.format(
147  "%s_comStatusIn_InputPort[%" PRI_FwIndexType "]",
148  this->m_objName.toChar(),
149  port
150  );
151  this->m_comStatusIn_InputPort[port].setObjName(portName.toChar());
152 #endif
153  }
154 
155  // Connect input port dataReturnIn
156  for (
157  FwIndexType port = 0;
158  port < static_cast<FwIndexType>(this->getNum_dataReturnIn_InputPorts());
159  port++
160  ) {
161  this->m_dataReturnIn_InputPort[port].init();
162  this->m_dataReturnIn_InputPort[port].addCallComp(
163  this,
164  m_p_dataReturnIn_in
165  );
166  this->m_dataReturnIn_InputPort[port].setPortNum(port);
167 
168 #if FW_OBJECT_NAMES == 1
169  Fw::ObjectName portName;
170  portName.format(
171  "%s_dataReturnIn_InputPort[%" PRI_FwIndexType "]",
172  this->m_objName.toChar(),
173  port
174  );
175  this->m_dataReturnIn_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 dataOut
301  for (
302  FwIndexType port = 0;
303  port < static_cast<FwIndexType>(this->getNum_dataOut_OutputPorts());
304  port++
305  ) {
306  this->m_dataOut_OutputPort[port].init();
307 
308 #if FW_OBJECT_NAMES == 1
309  Fw::ObjectName portName;
310  portName.format(
311  "%s_dataOut_OutputPort[%" PRI_FwIndexType "]",
312  this->m_objName.toChar(),
313  port
314  );
315  this->m_dataOut_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_comPacketQueueIn_InputPorts()),
350  static_cast<FwAssertArgType>(portNum)
351  );
352 
353  return &this->m_comPacketQueueIn_InputPort[portNum];
354  }
355 
358  {
359  FW_ASSERT(
360  (0 <= portNum) && (portNum < this->getNum_comStatusIn_InputPorts()),
361  static_cast<FwAssertArgType>(portNum)
362  );
363 
364  return &this->m_comStatusIn_InputPort[portNum];
365  }
366 
369  {
370  FW_ASSERT(
371  (0 <= portNum) && (portNum < this->getNum_dataReturnIn_InputPorts()),
372  static_cast<FwAssertArgType>(portNum)
373  );
374 
375  return &this->m_dataReturnIn_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_dataOut_OutputPorts()),
479  static_cast<FwAssertArgType>(portNum)
480  );
481 
482  this->m_dataOut_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_dataOut_OutputPorts()),
581  static_cast<FwAssertArgType>(portNum)
582  );
583 
584  this->m_dataOut_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  // Connection status queries for special output ports
608  // ----------------------------------------------------------------------
609 
612  {
613  FW_ASSERT(
614  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
615  static_cast<FwAssertArgType>(portNum)
616  );
617 
618  return this->m_Log_OutputPort[portNum].isConnected();
619  }
620 
621 #if FW_ENABLE_TEXT_LOGGING == 1
622 
623  bool ComQueueComponentBase ::
624  isConnected_LogText_OutputPort(FwIndexType portNum)
625  {
626  FW_ASSERT(
627  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
628  static_cast<FwAssertArgType>(portNum)
629  );
630 
631  return this->m_LogText_OutputPort[portNum].isConnected();
632  }
633 
634 #endif
635 
638  {
639  FW_ASSERT(
640  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
641  static_cast<FwAssertArgType>(portNum)
642  );
643 
644  return this->m_Time_OutputPort[portNum].isConnected();
645  }
646 
649  {
650  FW_ASSERT(
651  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
652  static_cast<FwAssertArgType>(portNum)
653  );
654 
655  return this->m_Tlm_OutputPort[portNum].isConnected();
656  }
657 
658  // ----------------------------------------------------------------------
659  // Connection status queries for typed output ports
660  // ----------------------------------------------------------------------
661 
664  {
665  FW_ASSERT(
666  (0 <= portNum) && (portNum < this->getNum_bufferReturnOut_OutputPorts()),
667  static_cast<FwAssertArgType>(portNum)
668  );
669 
670  return this->m_bufferReturnOut_OutputPort[portNum].isConnected();
671  }
672 
675  {
676  FW_ASSERT(
677  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
678  static_cast<FwAssertArgType>(portNum)
679  );
680 
681  return this->m_dataOut_OutputPort[portNum].isConnected();
682  }
683 
684  // ----------------------------------------------------------------------
685  // Port handler base-class functions for typed input ports
686  //
687  // Call these functions directly to bypass the corresponding ports
688  // ----------------------------------------------------------------------
689 
692  FwIndexType portNum,
693  Fw::Buffer& fwBuffer
694  )
695  {
696  // Make sure port number is valid
697  FW_ASSERT(
698  (0 <= portNum) && (portNum < this->getNum_bufferQueueIn_InputPorts()),
699  static_cast<FwAssertArgType>(portNum)
700  );
701 
702  // Call pre-message hook
704  portNum,
705  fwBuffer
706  );
707  ComponentIpcSerializableBuffer msg;
709 
710  // Serialize message ID
711  _status = msg.serializeFrom(
712  static_cast<FwEnumStoreType>(BUFFERQUEUEIN_BUFFERSEND)
713  );
714  FW_ASSERT(
715  _status == Fw::FW_SERIALIZE_OK,
716  static_cast<FwAssertArgType>(_status)
717  );
718 
719  // Serialize port number
720  _status = msg.serializeFrom(portNum);
721  FW_ASSERT(
722  _status == Fw::FW_SERIALIZE_OK,
723  static_cast<FwAssertArgType>(_status)
724  );
725 
726  // Serialize argument fwBuffer
727  _status = msg.serializeFrom(fwBuffer);
728  FW_ASSERT(
729  _status == Fw::FW_SERIALIZE_OK,
730  static_cast<FwAssertArgType>(_status)
731  );
732 
733  // Send message
735  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
736 
737  if (qStatus == Os::Queue::Status::FULL) {
738  this->bufferQueueIn_overflowHook(portNum, fwBuffer);
739  return;
740  }
741 
742  FW_ASSERT(
743  qStatus == Os::Queue::OP_OK,
744  static_cast<FwAssertArgType>(qStatus)
745  );
746  }
747 
750  FwIndexType portNum,
751  Fw::ComBuffer& data,
752  U32 context
753  )
754  {
755  // Make sure port number is valid
756  FW_ASSERT(
757  (0 <= portNum) && (portNum < this->getNum_comPacketQueueIn_InputPorts()),
758  static_cast<FwAssertArgType>(portNum)
759  );
760 
761  // Call pre-message hook
763  portNum,
764  data,
765  context
766  );
767  ComponentIpcSerializableBuffer msg;
769 
770  // Serialize message ID
771  _status = msg.serializeFrom(
772  static_cast<FwEnumStoreType>(COMPACKETQUEUEIN_COM)
773  );
774  FW_ASSERT(
775  _status == Fw::FW_SERIALIZE_OK,
776  static_cast<FwAssertArgType>(_status)
777  );
778 
779  // Serialize port number
780  _status = msg.serializeFrom(portNum);
781  FW_ASSERT(
782  _status == Fw::FW_SERIALIZE_OK,
783  static_cast<FwAssertArgType>(_status)
784  );
785 
786  // Serialize argument data
787  _status = msg.serializeFrom(data);
788  FW_ASSERT(
789  _status == Fw::FW_SERIALIZE_OK,
790  static_cast<FwAssertArgType>(_status)
791  );
792 
793  // Serialize argument context
794  _status = msg.serializeFrom(context);
795  FW_ASSERT(
796  _status == Fw::FW_SERIALIZE_OK,
797  static_cast<FwAssertArgType>(_status)
798  );
799 
800  // Send message
802  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
803 
804  if (qStatus == Os::Queue::Status::FULL) {
805  this->incNumMsgDropped();
806  return;
807  }
808 
809  FW_ASSERT(
810  qStatus == Os::Queue::OP_OK,
811  static_cast<FwAssertArgType>(qStatus)
812  );
813  }
814 
817  FwIndexType portNum,
818  Fw::Success& condition
819  )
820  {
821  // Make sure port number is valid
822  FW_ASSERT(
823  (0 <= portNum) && (portNum < this->getNum_comStatusIn_InputPorts()),
824  static_cast<FwAssertArgType>(portNum)
825  );
826 
827  // Call pre-message hook
829  portNum,
830  condition
831  );
832  ComponentIpcSerializableBuffer msg;
834 
835  // Serialize message ID
836  _status = msg.serializeFrom(
837  static_cast<FwEnumStoreType>(COMSTATUSIN_SUCCESSCONDITION)
838  );
839  FW_ASSERT(
840  _status == Fw::FW_SERIALIZE_OK,
841  static_cast<FwAssertArgType>(_status)
842  );
843 
844  // Serialize port number
845  _status = msg.serializeFrom(portNum);
846  FW_ASSERT(
847  _status == Fw::FW_SERIALIZE_OK,
848  static_cast<FwAssertArgType>(_status)
849  );
850 
851  // Serialize argument condition
852  _status = msg.serializeFrom(condition);
853  FW_ASSERT(
854  _status == Fw::FW_SERIALIZE_OK,
855  static_cast<FwAssertArgType>(_status)
856  );
857 
858  // Send message
860  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
861 
862  FW_ASSERT(
863  qStatus == Os::Queue::OP_OK,
864  static_cast<FwAssertArgType>(qStatus)
865  );
866  }
867 
870  FwIndexType portNum,
871  Fw::Buffer& data,
872  const ComCfg::FrameContext& context
873  )
874  {
875  // Make sure port number is valid
876  FW_ASSERT(
877  (0 <= portNum) && (portNum < this->getNum_dataReturnIn_InputPorts()),
878  static_cast<FwAssertArgType>(portNum)
879  );
880 
881  // Call handler function
882  this->dataReturnIn_handler(
883  portNum,
884  data,
885  context
886  );
887  }
888 
891  FwIndexType portNum,
892  U32 context
893  )
894  {
895  // Make sure port number is valid
896  FW_ASSERT(
897  (0 <= portNum) && (portNum < this->getNum_run_InputPorts()),
898  static_cast<FwAssertArgType>(portNum)
899  );
900 
901  // Call pre-message hook
903  portNum,
904  context
905  );
906  ComponentIpcSerializableBuffer msg;
908 
909  // Serialize message ID
910  _status = msg.serializeFrom(
911  static_cast<FwEnumStoreType>(RUN_SCHED)
912  );
913  FW_ASSERT(
914  _status == Fw::FW_SERIALIZE_OK,
915  static_cast<FwAssertArgType>(_status)
916  );
917 
918  // Serialize port number
919  _status = msg.serializeFrom(portNum);
920  FW_ASSERT(
921  _status == Fw::FW_SERIALIZE_OK,
922  static_cast<FwAssertArgType>(_status)
923  );
924 
925  // Serialize argument context
926  _status = msg.serializeFrom(context);
927  FW_ASSERT(
928  _status == Fw::FW_SERIALIZE_OK,
929  static_cast<FwAssertArgType>(_status)
930  );
931 
932  // Send message
934  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
935 
936  if (qStatus == Os::Queue::Status::FULL) {
937  this->incNumMsgDropped();
938  return;
939  }
940 
941  FW_ASSERT(
942  qStatus == Os::Queue::OP_OK,
943  static_cast<FwAssertArgType>(qStatus)
944  );
945  }
946 
947  // ----------------------------------------------------------------------
948  // Pre-message hooks for typed async input ports
949  //
950  // Each of these functions is invoked just before processing a message
951  // on the corresponding port. By default, they do nothing. You can
952  // override them to provide specific pre-message behavior.
953  // ----------------------------------------------------------------------
954 
957  FwIndexType portNum,
958  Fw::Buffer& fwBuffer
959  )
960  {
961  // Default: no-op
962  }
963 
966  FwIndexType portNum,
967  Fw::ComBuffer& data,
968  U32 context
969  )
970  {
971  // Default: no-op
972  }
973 
976  FwIndexType portNum,
977  Fw::Success& condition
978  )
979  {
980  // Default: no-op
981  }
982 
985  FwIndexType portNum,
986  U32 context
987  )
988  {
989  // Default: no-op
990  }
991 
992  // ----------------------------------------------------------------------
993  // Invocation functions for typed output ports
994  // ----------------------------------------------------------------------
995 
998  FwIndexType portNum,
999  Fw::Buffer& fwBuffer
1000  )
1001  {
1002  FW_ASSERT(
1003  (0 <= portNum) && (portNum < this->getNum_bufferReturnOut_OutputPorts()),
1004  static_cast<FwAssertArgType>(portNum)
1005  );
1006 
1007  FW_ASSERT(
1008  this->m_bufferReturnOut_OutputPort[portNum].isConnected(),
1009  static_cast<FwAssertArgType>(portNum)
1010  );
1011  this->m_bufferReturnOut_OutputPort[portNum].invoke(
1012  fwBuffer
1013  );
1014  }
1015 
1018  FwIndexType portNum,
1019  Fw::Buffer& data,
1020  const ComCfg::FrameContext& context
1021  )
1022  {
1023  FW_ASSERT(
1024  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
1025  static_cast<FwAssertArgType>(portNum)
1026  );
1027 
1028  FW_ASSERT(
1029  this->m_dataOut_OutputPort[portNum].isConnected(),
1030  static_cast<FwAssertArgType>(portNum)
1031  );
1032  this->m_dataOut_OutputPort[portNum].invoke(
1033  data,
1034  context
1035  );
1036  }
1037 
1038  // ----------------------------------------------------------------------
1039  // Event logging functions
1040  // ----------------------------------------------------------------------
1041 
1044  Svc::QueueType queueType,
1045  U32 index
1046  ) const
1047  {
1048  // Get the time
1049  Fw::Time _logTime;
1050  if (this->m_Time_OutputPort[0].isConnected()) {
1051  this->m_Time_OutputPort[0].invoke(_logTime);
1052  }
1053 
1054  FwEventIdType _id = static_cast<FwEventIdType>(0);
1055 
1056  _id = this->getIdBase() + EVENTID_QUEUEOVERFLOW;
1057 
1058  // Emit the event on the log port
1059  if (this->m_Log_OutputPort[0].isConnected()) {
1060  Fw::LogBuffer _logBuff;
1062 
1063 #if FW_AMPCS_COMPATIBLE
1064  // Serialize the number of arguments
1065  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1066  FW_ASSERT(
1067  _status == Fw::FW_SERIALIZE_OK,
1068  static_cast<FwAssertArgType>(_status)
1069  );
1070 #endif
1071 
1072 #if FW_AMPCS_COMPATIBLE
1073  // Serialize the argument size
1074  _status = _logBuff.serializeFrom(
1075  static_cast<U8>(Svc::QueueType::SERIALIZED_SIZE)
1076  );
1077  FW_ASSERT(
1078  _status == Fw::FW_SERIALIZE_OK,
1079  static_cast<FwAssertArgType>(_status)
1080  );
1081 #endif
1082  _status = _logBuff.serializeFrom(queueType);
1083  FW_ASSERT(
1084  _status == Fw::FW_SERIALIZE_OK,
1085  static_cast<FwAssertArgType>(_status)
1086  );
1087 
1088 #if FW_AMPCS_COMPATIBLE
1089  // Serialize the argument size
1090  _status = _logBuff.serializeFrom(
1091  static_cast<U8>(sizeof(U32))
1092  );
1093  FW_ASSERT(
1094  _status == Fw::FW_SERIALIZE_OK,
1095  static_cast<FwAssertArgType>(_status)
1096  );
1097 #endif
1098  _status = _logBuff.serializeFrom(index);
1099  FW_ASSERT(
1100  _status == Fw::FW_SERIALIZE_OK,
1101  static_cast<FwAssertArgType>(_status)
1102  );
1103 
1104  this->m_Log_OutputPort[0].invoke(
1105  _id,
1106  _logTime,
1108  _logBuff
1109  );
1110  }
1111 
1112  // Emit the event on the text log port
1113 #if FW_ENABLE_TEXT_LOGGING
1114  if (this->m_LogText_OutputPort[0].isConnected()) {
1115 #if FW_OBJECT_NAMES == 1
1116  const char* _formatString =
1117  "(%s) %s: The %s queue at index %" PRIu32 " overflowed";
1118 #else
1119  const char* _formatString =
1120  "%s: The %s queue at index %" PRIu32 " overflowed";
1121 #endif
1122 
1123  Fw::String queueTypeStr;
1124  queueType.toString(queueTypeStr);
1125 
1126  Fw::TextLogString _logString;
1127  _logString.format(
1128  _formatString,
1129 #if FW_OBJECT_NAMES == 1
1130  this->m_objName.toChar(),
1131 #endif
1132  "QueueOverflow ",
1133  queueTypeStr.toChar(),
1134  index
1135  );
1136 
1137  this->m_LogText_OutputPort[0].invoke(
1138  _id,
1139  _logTime,
1141  _logString
1142  );
1143  }
1144 #endif
1145  }
1146 
1147  // ----------------------------------------------------------------------
1148  // Telemetry write functions
1149  // ----------------------------------------------------------------------
1150 
1153  const Svc::ComQueueDepth& arg,
1154  Fw::Time _tlmTime
1155  ) const
1156  {
1157  if (this->m_Tlm_OutputPort[0].isConnected()) {
1158  if (
1159  this->m_Time_OutputPort[0].isConnected() &&
1160  (_tlmTime == Fw::ZERO_TIME)
1161  ) {
1162  this->m_Time_OutputPort[0].invoke(_tlmTime);
1163  }
1164 
1165  Fw::TlmBuffer _tlmBuff;
1166  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1167  FW_ASSERT(
1168  _stat == Fw::FW_SERIALIZE_OK,
1169  static_cast<FwAssertArgType>(_stat)
1170  );
1171 
1172  FwChanIdType _id;
1173 
1174  _id = this->getIdBase() + CHANNELID_COMQUEUEDEPTH;
1175 
1176  this->m_Tlm_OutputPort[0].invoke(
1177  _id,
1178  _tlmTime,
1179  _tlmBuff
1180  );
1181  }
1182  }
1183 
1186  const Svc::BuffQueueDepth& arg,
1187  Fw::Time _tlmTime
1188  ) const
1189  {
1190  if (this->m_Tlm_OutputPort[0].isConnected()) {
1191  if (
1192  this->m_Time_OutputPort[0].isConnected() &&
1193  (_tlmTime == Fw::ZERO_TIME)
1194  ) {
1195  this->m_Time_OutputPort[0].invoke(_tlmTime);
1196  }
1197 
1198  Fw::TlmBuffer _tlmBuff;
1199  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1200  FW_ASSERT(
1201  _stat == Fw::FW_SERIALIZE_OK,
1202  static_cast<FwAssertArgType>(_stat)
1203  );
1204 
1205  FwChanIdType _id;
1206 
1207  _id = this->getIdBase() + CHANNELID_BUFFQUEUEDEPTH;
1208 
1209  this->m_Tlm_OutputPort[0].invoke(
1210  _id,
1211  _tlmTime,
1212  _tlmBuff
1213  );
1214  }
1215  }
1216 
1217  // ----------------------------------------------------------------------
1218  // Time
1219  // ----------------------------------------------------------------------
1220 
1222  getTime() const
1223  {
1224  if (this->m_Time_OutputPort[0].isConnected()) {
1225  Fw::Time _time;
1226  this->m_Time_OutputPort[0].invoke(_time);
1227  return _time;
1228  }
1229  else {
1230  return Fw::Time(TimeBase::TB_NONE, 0, 0);
1231  }
1232  }
1233 
1234  // ----------------------------------------------------------------------
1235  // Message dispatch functions
1236  // ----------------------------------------------------------------------
1237 
1238  Fw::QueuedComponentBase::MsgDispatchStatus ComQueueComponentBase ::
1239  doDispatch()
1240  {
1241  ComponentIpcSerializableBuffer _msg;
1242  FwQueuePriorityType _priority = 0;
1243 
1244  Os::Queue::Status _msgStatus = this->m_queue.receive(
1245  _msg,
1247  _priority
1248  );
1249  FW_ASSERT(
1250  _msgStatus == Os::Queue::OP_OK,
1251  static_cast<FwAssertArgType>(_msgStatus)
1252  );
1253 
1254  // Reset to beginning of buffer
1255  _msg.resetDeser();
1256 
1257  FwEnumStoreType _desMsg = 0;
1258  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
1259  FW_ASSERT(
1260  _deserStatus == Fw::FW_SERIALIZE_OK,
1261  static_cast<FwAssertArgType>(_deserStatus)
1262  );
1263 
1264  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
1265 
1266  if (_msgType == COMQUEUE_COMPONENT_EXIT) {
1267  return MSG_DISPATCH_EXIT;
1268  }
1269 
1270  FwIndexType portNum = 0;
1271  _deserStatus = _msg.deserializeTo(portNum);
1272  FW_ASSERT(
1273  _deserStatus == Fw::FW_SERIALIZE_OK,
1274  static_cast<FwAssertArgType>(_deserStatus)
1275  );
1276 
1277  switch (_msgType) {
1278  // Handle async input port bufferQueueIn
1279  case BUFFERQUEUEIN_BUFFERSEND: {
1280  // Deserialize argument fwBuffer
1281  Fw::Buffer fwBuffer;
1282  _deserStatus = _msg.deserializeTo(fwBuffer);
1283  FW_ASSERT(
1284  _deserStatus == Fw::FW_SERIALIZE_OK,
1285  static_cast<FwAssertArgType>(_deserStatus)
1286  );
1287  // Call handler function
1288  this->bufferQueueIn_handler(
1289  portNum,
1290  fwBuffer
1291  );
1292 
1293  break;
1294  }
1295 
1296  // Handle async input port comPacketQueueIn
1297  case COMPACKETQUEUEIN_COM: {
1298  // Deserialize argument data
1299  Fw::ComBuffer data;
1300  _deserStatus = _msg.deserializeTo(data);
1301  FW_ASSERT(
1302  _deserStatus == Fw::FW_SERIALIZE_OK,
1303  static_cast<FwAssertArgType>(_deserStatus)
1304  );
1305 
1306  // Deserialize argument context
1307  U32 context;
1308  _deserStatus = _msg.deserializeTo(context);
1309  FW_ASSERT(
1310  _deserStatus == Fw::FW_SERIALIZE_OK,
1311  static_cast<FwAssertArgType>(_deserStatus)
1312  );
1313  // Call handler function
1315  portNum,
1316  data,
1317  context
1318  );
1319 
1320  break;
1321  }
1322 
1323  // Handle async input port comStatusIn
1324  case COMSTATUSIN_SUCCESSCONDITION: {
1325  // Deserialize argument condition
1326  Fw::Success condition;
1327  _deserStatus = _msg.deserializeTo(condition);
1328  FW_ASSERT(
1329  _deserStatus == Fw::FW_SERIALIZE_OK,
1330  static_cast<FwAssertArgType>(_deserStatus)
1331  );
1332  // Call handler function
1333  this->comStatusIn_handler(
1334  portNum,
1335  condition
1336  );
1337 
1338  break;
1339  }
1340 
1341  // Handle async input port run
1342  case RUN_SCHED: {
1343  // Deserialize argument context
1344  U32 context;
1345  _deserStatus = _msg.deserializeTo(context);
1346  FW_ASSERT(
1347  _deserStatus == Fw::FW_SERIALIZE_OK,
1348  static_cast<FwAssertArgType>(_deserStatus)
1349  );
1350  // Call handler function
1351  this->run_handler(
1352  portNum,
1353  context
1354  );
1355 
1356  break;
1357  }
1358 
1359  default:
1360  return MSG_DISPATCH_ERROR;
1361  }
1362 
1363  return MSG_DISPATCH_OK;
1364  }
1365 
1366  // ----------------------------------------------------------------------
1367  // Calls for messages received on typed input ports
1368  // ----------------------------------------------------------------------
1369 
1370  void ComQueueComponentBase ::
1371  m_p_bufferQueueIn_in(
1372  Fw::PassiveComponentBase* callComp,
1373  FwIndexType portNum,
1374  Fw::Buffer& fwBuffer
1375  )
1376  {
1377  FW_ASSERT(callComp);
1378  ComQueueComponentBase* compPtr = static_cast<ComQueueComponentBase*>(callComp);
1379  compPtr->bufferQueueIn_handlerBase(
1380  portNum,
1381  fwBuffer
1382  );
1383  }
1384 
1385  void ComQueueComponentBase ::
1386  m_p_comPacketQueueIn_in(
1387  Fw::PassiveComponentBase* callComp,
1388  FwIndexType portNum,
1389  Fw::ComBuffer& data,
1390  U32 context
1391  )
1392  {
1393  FW_ASSERT(callComp);
1394  ComQueueComponentBase* compPtr = static_cast<ComQueueComponentBase*>(callComp);
1395  compPtr->comPacketQueueIn_handlerBase(
1396  portNum,
1397  data,
1398  context
1399  );
1400  }
1401 
1402  void ComQueueComponentBase ::
1403  m_p_comStatusIn_in(
1404  Fw::PassiveComponentBase* callComp,
1405  FwIndexType portNum,
1406  Fw::Success& condition
1407  )
1408  {
1409  FW_ASSERT(callComp);
1410  ComQueueComponentBase* compPtr = static_cast<ComQueueComponentBase*>(callComp);
1411  compPtr->comStatusIn_handlerBase(
1412  portNum,
1413  condition
1414  );
1415  }
1416 
1417  void ComQueueComponentBase ::
1418  m_p_dataReturnIn_in(
1419  Fw::PassiveComponentBase* callComp,
1420  FwIndexType portNum,
1421  Fw::Buffer& data,
1422  const ComCfg::FrameContext& context
1423  )
1424  {
1425  FW_ASSERT(callComp);
1426  ComQueueComponentBase* compPtr = static_cast<ComQueueComponentBase*>(callComp);
1427  compPtr->dataReturnIn_handlerBase(
1428  portNum,
1429  data,
1430  context
1431  );
1432  }
1433 
1434  void ComQueueComponentBase ::
1435  m_p_run_in(
1436  Fw::PassiveComponentBase* callComp,
1437  FwIndexType portNum,
1438  U32 context
1439  )
1440  {
1441  FW_ASSERT(callComp);
1442  ComQueueComponentBase* compPtr = static_cast<ComQueueComponentBase*>(callComp);
1443  compPtr->run_handlerBase(
1444  portNum,
1445  context
1446  );
1447  }
1448 
1449 }
Serialization/Deserialization operation was successful.
virtual void comStatusIn_handler(FwIndexType portNum, Fw::Success &condition)=0
Handler for input port comStatusIn.
static constexpr FwIndexType getNum_Tlm_OutputPorts()
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
virtual ~ComQueueComponentBase()
Destroy ComQueueComponentBase object.
static constexpr FwIndexType getNum_dataReturnIn_InputPorts()
Operation succeeded.
Definition: Os.hpp:26
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
static constexpr FwIndexType getNum_bufferReturnOut_OutputPorts()
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:63
I32 FwEnumStoreType
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
void init()
Initialization function.
Definition: SchedPortAc.cpp:56
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
const char * toChar() const
Convert to a C-style char*.
Definition: String.hpp:50
The size of the serial representations of the port arguments.
Definition: ComPortAc.hpp:37
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
virtual void dataReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataReturnIn.
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataOut.
void dataReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataReturnIn.
Svc::InputSchedPort * get_run_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_comPacketQueueIn_InputPorts()
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
The size of the serial representations of the port arguments.
Definition: SchedPortAc.hpp:36
void set_dataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataOut[portNum].
No time base has been established (Required)
Os::Queue m_queue
queue object for active component
The size of the serial representations of the port arguments.
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:24
void init()
Initialization function.
Definition: ComPortAc.cpp:56
void comStatusIn_handlerBase(FwIndexType portNum, Fw::Success &condition)
Handler base-class function for input port comStatusIn.
SerializeStatus
forward declaration for string
Message will block until space is available.
Definition: Queue.hpp:47
virtual void bufferQueueIn_preMsgHook(FwIndexType portNum, Fw::Buffer &fwBuffer)
Pre-message hook for async input port bufferQueueIn.
FwIdType FwEventIdType
The type of an event identifier.
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:26
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)
The size of the serial representations of the port arguments.
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
static constexpr FwIndexType getNum_bufferQueueIn_InputPorts()
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
Convert to a C-style char*.
Definition: ObjectName.hpp:50
FwIdType FwChanIdType
The type of a telemetry channel identifier.
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:46
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].
Fw::InputComPort * get_comPacketQueueIn_InputPort(FwIndexType portNum)
The size of the serial representation.
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:38
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.
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
#define PRI_FwIndexType
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:39
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:53
BlockingType
message type
Definition: Queue.hpp:46
static constexpr FwIndexType getNum_dataOut_OutputPorts()
void init()
Initialization function.
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
void init()
Initialization function.
static constexpr FwIndexType getNum_comStatusIn_InputPorts()
static constexpr FwIndexType getNum_Log_OutputPorts()
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: SchedPortAc.cpp:62
Fw::InputSuccessConditionPort * get_comStatusIn_InputPort(FwIndexType portNum)
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)
ComQueueComponentBase(const char *compName="")
Construct ComQueueComponentBase object.
PlatformIndexType FwIndexType
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
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:56
static constexpr FwIndexType getNum_Time_OutputPorts()
message to exit active component task
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:48
Implementation of malloc based allocator.
virtual void bufferQueueIn_overflowHook(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Overflow hook for async input port bufferQueueIn.
bool isConnected_dataOut_OutputPort(FwIndexType portNum)
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Success/Failure.
static constexpr FwIndexType getNum_run_InputPorts()
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.