F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
EventManagerComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title EventManagerComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for EventManager component base class
5 // ======================================================================
6 
7 #ifndef Svc_EventManagerComponentAc_HPP
8 #define Svc_EventManagerComponentAc_HPP
9 
10 #include <atomic>
11 
12 #include "Fw/Cmd/CmdPortAc.hpp"
13 #include "Fw/Cmd/CmdRegPortAc.hpp"
15 #include "Fw/Cmd/CmdString.hpp"
16 #include "Fw/Com/ComPortAc.hpp"
18 #include "Fw/FPrimeBasicTypes.hpp"
19 #include "Fw/Log/LogBuffer.hpp"
20 #include "Fw/Log/LogPortAc.hpp"
22 #include "Fw/Log/LogString.hpp"
23 #if FW_ENABLE_TEXT_LOGGING == 1
24 #include "Fw/Log/LogTextPortAc.hpp"
25 #endif
28 #include "Fw/Time/Time.hpp"
29 #include "Fw/Time/TimePortAc.hpp"
34 #include "Svc/Ping/PingPortAc.hpp"
36 
37 namespace Svc {
38 
45  {
46 
47  // ----------------------------------------------------------------------
48  // Friend classes
49  // ----------------------------------------------------------------------
50 
52  friend class EventManagerTesterBase;
54  friend class EventManagerTester;
55 
56  protected:
57 
58  // ----------------------------------------------------------------------
59  // Constants
60  // ----------------------------------------------------------------------
61 
63  enum {
65  };
66 
68  enum {
71  };
72 
74  enum {
80  };
81 
83  enum {
87  };
88 
90  enum {
94  };
95 
97  enum {
103  };
104 
105  public:
106 
107  // ----------------------------------------------------------------------
108  // Component initialization
109  // ----------------------------------------------------------------------
110 
112  void init(
113  FwSizeType queueDepth,
114  FwEnumStoreType instance = 0
115  );
116 
117  public:
118 
119  // ----------------------------------------------------------------------
120  // Getters for special input ports
121  // ----------------------------------------------------------------------
122 
127  FwIndexType portNum
128  );
129 
130  public:
131 
132  // ----------------------------------------------------------------------
133  // Getters for typed input ports
134  // ----------------------------------------------------------------------
135 
140  FwIndexType portNum
141  );
142 
147  FwIndexType portNum
148  );
149 
150  public:
151 
152  // ----------------------------------------------------------------------
153  // Connect input ports to special output ports
154  // ----------------------------------------------------------------------
155 
158  FwIndexType portNum,
159  Fw::InputCmdRegPort* port
160  );
161 
164  FwIndexType portNum,
166  );
167 
169  void set_Log_OutputPort(
170  FwIndexType portNum,
171  Fw::InputLogPort* port
172  );
173 
174 #if FW_ENABLE_TEXT_LOGGING == 1
175 
177  void set_LogText_OutputPort(
178  FwIndexType portNum,
179  Fw::InputLogTextPort* port
180  );
181 
182 #endif
183 
185  void set_Time_OutputPort(
186  FwIndexType portNum,
187  Fw::InputTimePort* port
188  );
189 
190  public:
191 
192  // ----------------------------------------------------------------------
193  // Connect typed input ports to typed output ports
194  // ----------------------------------------------------------------------
195 
198  FwIndexType portNum,
200  );
201 
204  FwIndexType portNum,
205  Fw::InputComPort* port
206  );
207 
210  FwIndexType portNum,
211  Svc::InputPingPort* port
212  );
213 
214 #if FW_PORT_SERIALIZATION
215 
216  public:
217 
218  // ----------------------------------------------------------------------
219  // Connect serial input ports to special output ports
220  // ----------------------------------------------------------------------
221 
224  FwIndexType portNum,
225  Fw::InputSerializePort* port
226  );
227 
230  FwIndexType portNum,
231  Fw::InputSerializePort* port
232  );
233 
235  void set_Log_OutputPort(
236  FwIndexType portNum,
237  Fw::InputSerializePort* port
238  );
239 
240 #if FW_ENABLE_TEXT_LOGGING == 1
241 
243  void set_LogText_OutputPort(
244  FwIndexType portNum,
245  Fw::InputSerializePort* port
246  );
247 
248 #endif
249 
251  void set_Time_OutputPort(
252  FwIndexType portNum,
253  Fw::InputSerializePort* port
254  );
255 
256 #endif
257 
258 #if FW_PORT_SERIALIZATION
259 
260  public:
261 
262  // ----------------------------------------------------------------------
263  // Connect serial input ports to typed output ports
264  // ----------------------------------------------------------------------
265 
268  FwIndexType portNum,
269  Fw::InputSerializePort* port
270  );
271 
274  FwIndexType portNum,
275  Fw::InputSerializePort* port
276  );
277 
280  FwIndexType portNum,
281  Fw::InputSerializePort* port
282  );
283 
284 #endif
285 
286  public:
287 
288  // ----------------------------------------------------------------------
289  // Command registration
290  // ----------------------------------------------------------------------
291 
295  void regCommands();
296 
297  protected:
298 
299  // ----------------------------------------------------------------------
300  // Component construction and destruction
301  // ----------------------------------------------------------------------
302 
305  const char* compName = ""
306  );
307 
309  virtual ~EventManagerComponentBase();
310 
311  protected:
312 
313  // ----------------------------------------------------------------------
314  // Getters for numbers of special input ports
315  // ----------------------------------------------------------------------
316 
322  }
323 
324  protected:
325 
326  // ----------------------------------------------------------------------
327  // Getters for numbers of typed input ports
328  // ----------------------------------------------------------------------
329 
335  }
336 
341  return NUM_PINGIN_INPUT_PORTS;
342  }
343 
344  protected:
345 
346  // ----------------------------------------------------------------------
347  // Getters for numbers of special output ports
348  // ----------------------------------------------------------------------
349 
355  }
356 
362  }
363 
367  static constexpr FwIndexType getNum_Log_OutputPorts() {
368  return NUM_LOG_OUTPUT_PORTS;
369  }
370 
371 #if FW_ENABLE_TEXT_LOGGING == 1
372 
376  static constexpr FwIndexType getNum_LogText_OutputPorts() {
378  }
379 
380 #endif
381 
386  return NUM_TIME_OUTPUT_PORTS;
387  }
388 
389  protected:
390 
391  // ----------------------------------------------------------------------
392  // Getters for numbers of typed output ports
393  // ----------------------------------------------------------------------
394 
400  }
401 
407  }
408 
414  }
415 
416  protected:
417 
418  // ----------------------------------------------------------------------
419  // Connection status queries for special output ports
420  // ----------------------------------------------------------------------
421 
426  FwIndexType portNum
427  );
428 
433  FwIndexType portNum
434  );
435 
440  FwIndexType portNum
441  );
442 
443 #if FW_ENABLE_TEXT_LOGGING == 1
444 
448  bool isConnected_LogText_OutputPort(
449  FwIndexType portNum
450  );
451 
452 #endif
453 
458  FwIndexType portNum
459  );
460 
461  protected:
462 
463  // ----------------------------------------------------------------------
464  // Connection status queries for typed output ports
465  // ----------------------------------------------------------------------
466 
471  FwIndexType portNum
472  );
473 
478  FwIndexType portNum
479  );
480 
485  FwIndexType portNum
486  );
487 
488  protected:
489 
490  // ----------------------------------------------------------------------
491  // Handlers to implement for typed input ports
492  // ----------------------------------------------------------------------
493 
495  virtual void LogRecv_handler(
496  FwIndexType portNum,
497  FwEventIdType id,
498  Fw::Time& timeTag,
499  const Fw::LogSeverity& severity,
500  Fw::LogBuffer& args
501  ) = 0;
502 
504  virtual void pingIn_handler(
505  FwIndexType portNum,
506  U32 key
507  ) = 0;
508 
509  protected:
510 
511  // ----------------------------------------------------------------------
512  // Port handler base-class functions for typed input ports
513  //
514  // Call these functions directly to bypass the corresponding ports
515  // ----------------------------------------------------------------------
516 
518  void LogRecv_handlerBase(
519  FwIndexType portNum,
520  FwEventIdType id,
521  Fw::Time& timeTag,
522  const Fw::LogSeverity& severity,
523  Fw::LogBuffer& args
524  );
525 
527  void pingIn_handlerBase(
528  FwIndexType portNum,
529  U32 key
530  );
531 
532  protected:
533 
534  // ----------------------------------------------------------------------
535  // Pre-message hooks for typed async input ports
536  //
537  // Each of these functions is invoked just before processing a message
538  // on the corresponding port. By default, they do nothing. You can
539  // override them to provide specific pre-message behavior.
540  // ----------------------------------------------------------------------
541 
543  virtual void pingIn_preMsgHook(
544  FwIndexType portNum,
545  U32 key
546  );
547 
548  protected:
549 
550  // ----------------------------------------------------------------------
551  // Invocation functions for typed output ports
552  // ----------------------------------------------------------------------
553 
555  void FatalAnnounce_out(
556  FwIndexType portNum,
557  FwEventIdType Id
558  );
559 
561  void PktSend_out(
562  FwIndexType portNum,
563  Fw::ComBuffer& data,
564  U32 context
565  );
566 
568  void pingOut_out(
569  FwIndexType portNum,
570  U32 key
571  );
572 
573  protected:
574 
575  // ----------------------------------------------------------------------
576  // Internal interface handlers
577  // ----------------------------------------------------------------------
578 
581  FwEventIdType id,
582  const Fw::Time& timeTag,
583  const Fw::LogSeverity& severity,
584  const Fw::LogBuffer& args
585  ) = 0;
586 
587  protected:
588 
589  // ----------------------------------------------------------------------
590  // Internal interface base-class functions
591  // ----------------------------------------------------------------------
592 
595  FwEventIdType id,
596  const Fw::Time& timeTag,
597  const Fw::LogSeverity& severity,
598  const Fw::LogBuffer& args
599  );
600 
601  protected:
602 
603  // ----------------------------------------------------------------------
604  // Command response
605  // ----------------------------------------------------------------------
606 
608  void cmdResponse_out(
609  FwOpcodeType opCode,
610  U32 cmdSeq,
611  Fw::CmdResponse response
612  );
613 
614  protected:
615 
616  // ----------------------------------------------------------------------
617  // Command handlers to implement
618  // ----------------------------------------------------------------------
619 
623  virtual void SET_EVENT_FILTER_cmdHandler(
624  FwOpcodeType opCode,
625  U32 cmdSeq,
627  Svc::EventManager_Enabled filterEnabled
628  ) = 0;
629 
633  virtual void SET_ID_FILTER_cmdHandler(
634  FwOpcodeType opCode,
635  U32 cmdSeq,
636  FwEventIdType ID,
637  Svc::EventManager_Enabled idFilterEnabled
638  ) = 0;
639 
643  virtual void DUMP_FILTER_STATE_cmdHandler(
644  FwOpcodeType opCode,
645  U32 cmdSeq
646  ) = 0;
647 
648  protected:
649 
650  // ----------------------------------------------------------------------
651  // Command handler base-class functions
652  //
653  // Call these functions directly to bypass the command input port
654  // ----------------------------------------------------------------------
655 
660  FwOpcodeType opCode,
661  U32 cmdSeq,
662  Fw::CmdArgBuffer& args
663  );
664 
669  FwOpcodeType opCode,
670  U32 cmdSeq,
671  Fw::CmdArgBuffer& args
672  );
673 
678  FwOpcodeType opCode,
679  U32 cmdSeq,
680  Fw::CmdArgBuffer& args
681  );
682 
683  protected:
684 
685  // ----------------------------------------------------------------------
686  // Pre-message hooks for async commands
687  //
688  // Each of these functions is invoked just before processing the
689  // corresponding command. By default they do nothing. You can
690  // override them to provide specific pre-command behavior.
691  // ----------------------------------------------------------------------
692 
694  virtual void SET_ID_FILTER_preMsgHook(
695  FwOpcodeType opCode,
696  U32 cmdSeq
697  );
698 
700  virtual void DUMP_FILTER_STATE_preMsgHook(
701  FwOpcodeType opCode,
702  U32 cmdSeq
703  );
704 
705  protected:
706 
707  // ----------------------------------------------------------------------
708  // Event logging functions
709  // ----------------------------------------------------------------------
710 
716  bool enabled
717  ) const;
718 
723  FwEventIdType ID
724  ) const;
725 
730  FwEventIdType ID
731  ) const;
732 
737  FwEventIdType ID
738  ) const;
739 
744  FwEventIdType ID
745  ) const;
746 
747  protected:
748 
749  // ----------------------------------------------------------------------
750  // Time
751  // ----------------------------------------------------------------------
752 
756  Fw::Time getTime() const;
757 
758  private:
759 
760  // ----------------------------------------------------------------------
761  // Message dispatch functions
762  // ----------------------------------------------------------------------
763 
765  virtual MsgDispatchStatus doDispatch();
766 
767  private:
768 
769  // ----------------------------------------------------------------------
770  // Calls for messages received on special input ports
771  // ----------------------------------------------------------------------
772 
774  static void m_p_CmdDisp_in(
775  Fw::PassiveComponentBase* callComp,
776  FwIndexType portNum,
777  FwOpcodeType opCode,
778  U32 cmdSeq,
779  Fw::CmdArgBuffer& args
780  );
781 
782  private:
783 
784  // ----------------------------------------------------------------------
785  // Calls for messages received on typed input ports
786  // ----------------------------------------------------------------------
787 
789  static void m_p_LogRecv_in(
790  Fw::PassiveComponentBase* callComp,
791  FwIndexType portNum,
792  FwEventIdType id,
793  Fw::Time& timeTag,
794  const Fw::LogSeverity& severity,
795  Fw::LogBuffer& args
796  );
797 
799  static void m_p_pingIn_in(
800  Fw::PassiveComponentBase* callComp,
801  FwIndexType portNum,
802  U32 key
803  );
804 
805  private:
806 
807  // ----------------------------------------------------------------------
808  // Special input ports
809  // ----------------------------------------------------------------------
810 
812  Fw::InputCmdPort m_CmdDisp_InputPort[NUM_CMDDISP_INPUT_PORTS];
813 
814  private:
815 
816  // ----------------------------------------------------------------------
817  // Typed input ports
818  // ----------------------------------------------------------------------
819 
821  Fw::InputLogPort m_LogRecv_InputPort[NUM_LOGRECV_INPUT_PORTS];
822 
824  Svc::InputPingPort m_pingIn_InputPort[NUM_PINGIN_INPUT_PORTS];
825 
826  private:
827 
828  // ----------------------------------------------------------------------
829  // Special output ports
830  // ----------------------------------------------------------------------
831 
833  Fw::OutputCmdRegPort m_CmdReg_OutputPort[NUM_CMDREG_OUTPUT_PORTS];
834 
837 
839  Fw::OutputLogPort m_Log_OutputPort[NUM_LOG_OUTPUT_PORTS];
840 
841 #if FW_ENABLE_TEXT_LOGGING == 1
842 
844  Fw::OutputLogTextPort m_LogText_OutputPort[NUM_LOGTEXT_OUTPUT_PORTS];
845 
846 #endif
847 
849  Fw::OutputTimePort m_Time_OutputPort[NUM_TIME_OUTPUT_PORTS];
850 
851  private:
852 
853  // ----------------------------------------------------------------------
854  // Typed output ports
855  // ----------------------------------------------------------------------
856 
858  Svc::OutputFatalEventPort m_FatalAnnounce_OutputPort[NUM_FATALANNOUNCE_OUTPUT_PORTS];
859 
861  Fw::OutputComPort m_PktSend_OutputPort[NUM_PKTSEND_OUTPUT_PORTS];
862 
864  Svc::OutputPingPort m_pingOut_OutputPort[NUM_PINGOUT_OUTPUT_PORTS];
865 
866  };
867 
868 }
869 
870 #endif
bool isConnected_CmdStatus_OutputPort(FwIndexType portNum)
friend class EventManagerTesterBase
Friend class tester to support autocoded test harness.
void set_CmdReg_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to CmdReg[portNum].
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
Enabled and disabled state.
void LogRecv_handlerBase(FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Handler base-class function for input port LogRecv.
FwIdType FwOpcodeType
The type of a command opcode.
bool isConnected_pingOut_OutputPort(FwIndexType portNum)
PlatformSizeType FwSizeType
I32 FwEnumStoreType
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
static constexpr FwIndexType getNum_CmdReg_OutputPorts()
void pingOut_out(FwIndexType portNum, U32 key)
Invoke output port pingOut.
static constexpr FwIndexType getNum_LogRecv_InputPorts()
Fw::InputCmdPort * get_CmdDisp_InputPort(FwIndexType portNum)
Enum representing a command response.
static constexpr FwIndexType getNum_pingOut_OutputPorts()
void set_PktSend_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to PktSend[portNum].
void PktSend_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port PktSend.
void init()
Object initializer.
Definition: ObjBase.cpp:24
static constexpr FwIndexType getNum_CmdStatus_OutputPorts()
void regCommands()
Register commands with the Command Dispatcher.
static constexpr FwIndexType getNum_pingIn_InputPorts()
FwIdType FwEventIdType
The type of an event identifier.
void SET_EVENT_FILTER_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void log_ACTIVITY_HI_ID_FILTER_ENABLED(FwEventIdType ID) const
virtual void SET_ID_FILTER_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command SET_ID_FILTER.
virtual void DUMP_FILTER_STATE_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command DUMP_FILTER_STATE.
void log_WARNING_LO_ID_FILTER_LIST_FULL(FwEventIdType ID) const
friend class EventManagerTester
Friend class tester implementation to support white-box testing.
static constexpr FwIndexType getNum_FatalAnnounce_OutputPorts()
static constexpr FwIndexType getNum_PktSend_OutputPorts()
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
bool isConnected_FatalAnnounce_OutputPort(FwIndexType portNum)
Auto-generated base for EventManager component.
bool isConnected_Time_OutputPort(FwIndexType portNum)
Enum representing event severity.
virtual void SET_EVENT_FILTER_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, Svc::EventManager_FilterSeverity filterLevel, Svc::EventManager_Enabled filterEnabled)=0
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
void log_WARNING_LO_ID_FILTER_NOT_FOUND(FwEventIdType ID) const
void loqQueue_internalInterfaceInvoke(FwEventIdType id, const Fw::Time &timeTag, const Fw::LogSeverity &severity, const Fw::LogBuffer &args)
Internal interface base-class function for loqQueue.
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
void set_CmdStatus_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to CmdStatus[portNum].
void SET_ID_FILTER_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
virtual void LogRecv_handler(FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)=0
Handler for input port LogRecv.
bool isConnected_CmdReg_OutputPort(FwIndexType portNum)
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
PlatformIndexType FwIndexType
void DUMP_FILTER_STATE_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
virtual void DUMP_FILTER_STATE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
static constexpr FwIndexType getNum_Time_OutputPorts()
static constexpr FwIndexType getNum_CmdDisp_InputPorts()
virtual void loqQueue_internalInterfaceHandler(FwEventIdType id, const Fw::Time &timeTag, const Fw::LogSeverity &severity, const Fw::LogBuffer &args)=0
Internal interface handler for loqQueue.
RateGroupDivider component implementation.
static constexpr FwIndexType getNum_Log_OutputPorts()
void log_ACTIVITY_LO_SEVERITY_FILTER_STATE(Svc::EventManager_FilterSeverity severity, bool enabled) const
Set filter for reporting events. Events are not stored in component.
void FatalAnnounce_out(FwIndexType portNum, FwEventIdType Id)
Invoke output port FatalAnnounce.
bool isConnected_PktSend_OutputPort(FwIndexType portNum)
bool isConnected_Log_OutputPort(FwIndexType portNum)
virtual ~EventManagerComponentBase()
Destroy EventManagerComponentBase object.
EventManagerComponentBase(const char *compName="")
Construct EventManagerComponentBase object.
void set_FatalAnnounce_OutputPort(FwIndexType portNum, Svc::InputFatalEventPort *port)
Connect port to FatalAnnounce[portNum].
Fw::InputLogPort * get_LogRecv_InputPort(FwIndexType portNum)
void log_ACTIVITY_HI_ID_FILTER_REMOVED(FwEventIdType ID) const
virtual void SET_ID_FILTER_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, FwEventIdType ID, Svc::EventManager_Enabled idFilterEnabled)=0