F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ActiveLoggerComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title ActiveLoggerComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for ActiveLogger component base class
5 // ======================================================================
6 
7 #ifndef Svc_ActiveLoggerComponentAc_HPP
8 #define Svc_ActiveLoggerComponentAc_HPP
9 
10 #include "FpConfig.hpp"
11 #include "Fw/Cmd/CmdPortAc.hpp"
12 #include "Fw/Cmd/CmdRegPortAc.hpp"
14 #include "Fw/Cmd/CmdString.hpp"
15 #include "Fw/Com/ComPortAc.hpp"
17 #include "Fw/Log/LogBuffer.hpp"
18 #include "Fw/Log/LogPortAc.hpp"
20 #include "Fw/Log/LogString.hpp"
21 #if FW_ENABLE_TEXT_LOGGING == 1
22 #include "Fw/Log/LogTextPortAc.hpp"
23 #endif
26 #include "Fw/Time/Time.hpp"
27 #include "Fw/Time/TimePortAc.hpp"
32 #include "Svc/Ping/PingPortAc.hpp"
33 
34 namespace Svc {
35 
42  {
43 
44  // ----------------------------------------------------------------------
45  // Friend classes
46  // ----------------------------------------------------------------------
47 
50 
51  PROTECTED:
52 
53  // ----------------------------------------------------------------------
54  // Constants
55  // ----------------------------------------------------------------------
56 
58  enum {
60  };
61 
63  enum {
66  };
67 
69  enum {
75  };
76 
78  enum {
82  };
83 
85  enum {
89  };
90 
92  enum {
98  };
99 
100  public:
101 
102  // ----------------------------------------------------------------------
103  // Component initialization
104  // ----------------------------------------------------------------------
105 
107  void init(
108  FwSizeType queueDepth,
109  FwEnumStoreType instance = 0
110  );
111 
112  public:
113 
114  // ----------------------------------------------------------------------
115  // Getters for special input ports
116  // ----------------------------------------------------------------------
117 
122  FwIndexType portNum
123  );
124 
125  public:
126 
127  // ----------------------------------------------------------------------
128  // Getters for typed input ports
129  // ----------------------------------------------------------------------
130 
135  FwIndexType portNum
136  );
137 
142  FwIndexType portNum
143  );
144 
145  public:
146 
147  // ----------------------------------------------------------------------
148  // Connect input ports to special output ports
149  // ----------------------------------------------------------------------
150 
153  FwIndexType portNum,
154  Fw::InputCmdRegPort* port
155  );
156 
159  FwIndexType portNum,
161  );
162 
164  void set_Log_OutputPort(
165  FwIndexType portNum,
166  Fw::InputLogPort* port
167  );
168 
169 #if FW_ENABLE_TEXT_LOGGING == 1
170 
172  void set_LogText_OutputPort(
173  FwIndexType portNum,
174  Fw::InputLogTextPort* port
175  );
176 
177 #endif
178 
180  void set_Time_OutputPort(
181  FwIndexType portNum,
182  Fw::InputTimePort* port
183  );
184 
185  public:
186 
187  // ----------------------------------------------------------------------
188  // Connect typed input ports to typed output ports
189  // ----------------------------------------------------------------------
190 
193  FwIndexType portNum,
195  );
196 
199  FwIndexType portNum,
200  Fw::InputComPort* port
201  );
202 
205  FwIndexType portNum,
206  Svc::InputPingPort* port
207  );
208 
209 #if FW_PORT_SERIALIZATION
210 
211  public:
212 
213  // ----------------------------------------------------------------------
214  // Connect serial input ports to special output ports
215  // ----------------------------------------------------------------------
216 
219  FwIndexType portNum,
220  Fw::InputSerializePort* port
221  );
222 
225  FwIndexType portNum,
226  Fw::InputSerializePort* port
227  );
228 
230  void set_Log_OutputPort(
231  FwIndexType portNum,
232  Fw::InputSerializePort* port
233  );
234 
235 #if FW_ENABLE_TEXT_LOGGING == 1
236 
238  void set_LogText_OutputPort(
239  FwIndexType portNum,
240  Fw::InputSerializePort* port
241  );
242 
243 #endif
244 
246  void set_Time_OutputPort(
247  FwIndexType portNum,
248  Fw::InputSerializePort* port
249  );
250 
251 #endif
252 
253 #if FW_PORT_SERIALIZATION
254 
255  public:
256 
257  // ----------------------------------------------------------------------
258  // Connect serial input ports to typed output ports
259  // ----------------------------------------------------------------------
260 
263  FwIndexType portNum,
264  Fw::InputSerializePort* port
265  );
266 
269  FwIndexType portNum,
270  Fw::InputSerializePort* port
271  );
272 
275  FwIndexType portNum,
276  Fw::InputSerializePort* port
277  );
278 
279 #endif
280 
281  public:
282 
283  // ----------------------------------------------------------------------
284  // Command registration
285  // ----------------------------------------------------------------------
286 
290  void regCommands();
291 
292  PROTECTED:
293 
294  // ----------------------------------------------------------------------
295  // Component construction and destruction
296  // ----------------------------------------------------------------------
297 
300  const char* compName = ""
301  );
302 
304  virtual ~ActiveLoggerComponentBase();
305 
306  PROTECTED:
307 
308  // ----------------------------------------------------------------------
309  // Getters for numbers of special input ports
310  // ----------------------------------------------------------------------
311 
316 
317  PROTECTED:
318 
319  // ----------------------------------------------------------------------
320  // Getters for numbers of typed input ports
321  // ----------------------------------------------------------------------
322 
327 
332 
333  PROTECTED:
334 
335  // ----------------------------------------------------------------------
336  // Getters for numbers of special output ports
337  // ----------------------------------------------------------------------
338 
343 
348 
353 
354 #if FW_ENABLE_TEXT_LOGGING == 1
355 
359  FwIndexType getNum_LogText_OutputPorts() const;
360 
361 #endif
362 
367 
368  PROTECTED:
369 
370  // ----------------------------------------------------------------------
371  // Getters for numbers of typed output ports
372  // ----------------------------------------------------------------------
373 
378 
383 
388 
389  PROTECTED:
390 
391  // ----------------------------------------------------------------------
392  // Connection status queries for special output ports
393  // ----------------------------------------------------------------------
394 
399  FwIndexType portNum
400  );
401 
406  FwIndexType portNum
407  );
408 
413  FwIndexType portNum
414  );
415 
416 #if FW_ENABLE_TEXT_LOGGING == 1
417 
421  bool isConnected_LogText_OutputPort(
422  FwIndexType portNum
423  );
424 
425 #endif
426 
431  FwIndexType portNum
432  );
433 
434  PROTECTED:
435 
436  // ----------------------------------------------------------------------
437  // Connection status queries for typed output ports
438  // ----------------------------------------------------------------------
439 
444  FwIndexType portNum
445  );
446 
451  FwIndexType portNum
452  );
453 
458  FwIndexType portNum
459  );
460 
461  PROTECTED:
462 
463  // ----------------------------------------------------------------------
464  // Handlers to implement for typed input ports
465  // ----------------------------------------------------------------------
466 
468  virtual void LogRecv_handler(
469  FwIndexType portNum,
470  FwEventIdType id,
471  Fw::Time& timeTag,
472  const Fw::LogSeverity& severity,
473  Fw::LogBuffer& args
474  ) = 0;
475 
477  virtual void pingIn_handler(
478  FwIndexType portNum,
479  U32 key
480  ) = 0;
481 
482  PROTECTED:
483 
484  // ----------------------------------------------------------------------
485  // Port handler base-class functions for typed input ports
486  //
487  // Call these functions directly to bypass the corresponding ports
488  // ----------------------------------------------------------------------
489 
491  void LogRecv_handlerBase(
492  FwIndexType portNum,
493  FwEventIdType id,
494  Fw::Time& timeTag,
495  const Fw::LogSeverity& severity,
496  Fw::LogBuffer& args
497  );
498 
500  void pingIn_handlerBase(
501  FwIndexType portNum,
502  U32 key
503  );
504 
505  PROTECTED:
506 
507  // ----------------------------------------------------------------------
508  // Pre-message hooks for typed async input ports
509  //
510  // Each of these functions is invoked just before processing a message
511  // on the corresponding port. By default, they do nothing. You can
512  // override them to provide specific pre-message behavior.
513  // ----------------------------------------------------------------------
514 
516  virtual void pingIn_preMsgHook(
517  FwIndexType portNum,
518  U32 key
519  );
520 
521  PROTECTED:
522 
523  // ----------------------------------------------------------------------
524  // Invocation functions for typed output ports
525  // ----------------------------------------------------------------------
526 
528  void FatalAnnounce_out(
529  FwIndexType portNum,
530  FwEventIdType Id
531  );
532 
534  void PktSend_out(
535  FwIndexType portNum,
536  Fw::ComBuffer& data,
537  U32 context
538  );
539 
541  void pingOut_out(
542  FwIndexType portNum,
543  U32 key
544  );
545 
546  PROTECTED:
547 
548  // ----------------------------------------------------------------------
549  // Internal interface handlers
550  // ----------------------------------------------------------------------
551 
554  FwEventIdType id,
555  const Fw::Time& timeTag,
556  const Fw::LogSeverity& severity,
557  const Fw::LogBuffer& args
558  ) = 0;
559 
560  PROTECTED:
561 
562  // ----------------------------------------------------------------------
563  // Internal interface base-class functions
564  // ----------------------------------------------------------------------
565 
568  FwEventIdType id,
569  const Fw::Time& timeTag,
570  const Fw::LogSeverity& severity,
571  const Fw::LogBuffer& args
572  );
573 
574  PROTECTED:
575 
576  // ----------------------------------------------------------------------
577  // Command response
578  // ----------------------------------------------------------------------
579 
581  void cmdResponse_out(
582  FwOpcodeType opCode,
583  U32 cmdSeq,
584  Fw::CmdResponse response
585  );
586 
587  PROTECTED:
588 
589  // ----------------------------------------------------------------------
590  // Command handlers to implement
591  // ----------------------------------------------------------------------
592 
597  FwOpcodeType opCode,
598  U32 cmdSeq,
600  Svc::ActiveLogger_Enabled filterEnabled
601  ) = 0;
602 
607  FwOpcodeType opCode,
608  U32 cmdSeq,
609  U32 ID,
610  Svc::ActiveLogger_Enabled idFilterEnabled
611  ) = 0;
612 
617  FwOpcodeType opCode,
618  U32 cmdSeq
619  ) = 0;
620 
621  PROTECTED:
622 
623  // ----------------------------------------------------------------------
624  // Command handler base-class functions
625  //
626  // Call these functions directly to bypass the command input port
627  // ----------------------------------------------------------------------
628 
633  FwOpcodeType opCode,
634  U32 cmdSeq,
635  Fw::CmdArgBuffer& args
636  );
637 
642  FwOpcodeType opCode,
643  U32 cmdSeq,
644  Fw::CmdArgBuffer& args
645  );
646 
651  FwOpcodeType opCode,
652  U32 cmdSeq,
653  Fw::CmdArgBuffer& args
654  );
655 
656  PROTECTED:
657 
658  // ----------------------------------------------------------------------
659  // Pre-message hooks for async commands
660  //
661  // Each of these functions is invoked just before processing the
662  // corresponding command. By default they do nothing. You can
663  // override them to provide specific pre-command behavior.
664  // ----------------------------------------------------------------------
665 
667  virtual void SET_ID_FILTER_preMsgHook(
668  FwOpcodeType opCode,
669  U32 cmdSeq
670  );
671 
673  virtual void DUMP_FILTER_STATE_preMsgHook(
674  FwOpcodeType opCode,
675  U32 cmdSeq
676  );
677 
678  PROTECTED:
679 
680  // ----------------------------------------------------------------------
681  // Event logging functions
682  // ----------------------------------------------------------------------
683 
689  bool enabled
690  );
691 
696  U32 ID
697  );
698 
703  U32 ID
704  );
705 
710  U32 ID
711  );
712 
717  U32 ID
718  );
719 
720  PROTECTED:
721 
722  // ----------------------------------------------------------------------
723  // Time
724  // ----------------------------------------------------------------------
725 
729  Fw::Time getTime();
730 
731  PRIVATE:
732 
733  // ----------------------------------------------------------------------
734  // Message dispatch functions
735  // ----------------------------------------------------------------------
736 
738  virtual MsgDispatchStatus doDispatch();
739 
740  PRIVATE:
741 
742  // ----------------------------------------------------------------------
743  // Calls for messages received on special input ports
744  // ----------------------------------------------------------------------
745 
747  static void m_p_CmdDisp_in(
748  Fw::PassiveComponentBase* callComp,
749  FwIndexType portNum,
750  FwOpcodeType opCode,
751  U32 cmdSeq,
752  Fw::CmdArgBuffer& args
753  );
754 
755  PRIVATE:
756 
757  // ----------------------------------------------------------------------
758  // Calls for messages received on typed input ports
759  // ----------------------------------------------------------------------
760 
762  static void m_p_LogRecv_in(
763  Fw::PassiveComponentBase* callComp,
764  FwIndexType portNum,
765  FwEventIdType id,
766  Fw::Time& timeTag,
767  const Fw::LogSeverity& severity,
768  Fw::LogBuffer& args
769  );
770 
772  static void m_p_pingIn_in(
773  Fw::PassiveComponentBase* callComp,
774  FwIndexType portNum,
775  U32 key
776  );
777 
778  PRIVATE:
779 
780  // ----------------------------------------------------------------------
781  // Special input ports
782  // ----------------------------------------------------------------------
783 
785  Fw::InputCmdPort m_CmdDisp_InputPort[NUM_CMDDISP_INPUT_PORTS];
786 
787  PRIVATE:
788 
789  // ----------------------------------------------------------------------
790  // Typed input ports
791  // ----------------------------------------------------------------------
792 
794  Fw::InputLogPort m_LogRecv_InputPort[NUM_LOGRECV_INPUT_PORTS];
795 
797  Svc::InputPingPort m_pingIn_InputPort[NUM_PINGIN_INPUT_PORTS];
798 
799  PRIVATE:
800 
801  // ----------------------------------------------------------------------
802  // Special output ports
803  // ----------------------------------------------------------------------
804 
806  Fw::OutputCmdRegPort m_CmdReg_OutputPort[NUM_CMDREG_OUTPUT_PORTS];
807 
810 
812  Fw::OutputLogPort m_Log_OutputPort[NUM_LOG_OUTPUT_PORTS];
813 
814 #if FW_ENABLE_TEXT_LOGGING == 1
815 
817  Fw::OutputLogTextPort m_LogText_OutputPort[NUM_LOGTEXT_OUTPUT_PORTS];
818 
819 #endif
820 
822  Fw::OutputTimePort m_Time_OutputPort[NUM_TIME_OUTPUT_PORTS];
823 
824  PRIVATE:
825 
826  // ----------------------------------------------------------------------
827  // Typed output ports
828  // ----------------------------------------------------------------------
829 
831  Svc::OutputFatalEventPort m_FatalAnnounce_OutputPort[NUM_FATALANNOUNCE_OUTPUT_PORTS];
832 
834  Fw::OutputComPort m_PktSend_OutputPort[NUM_PKTSEND_OUTPUT_PORTS];
835 
837  Svc::OutputPingPort m_pingOut_OutputPort[NUM_PINGOUT_OUTPUT_PORTS];
838 
839  };
840 
841 }
842 
843 #endif
I32 FwEnumStoreType
Definition: FpConfig.h:64
U32 FwEventIdType
Definition: FpConfig.h:103
U32 FwOpcodeType
Definition: FpConfig.h:91
PlatformSizeType FwSizeType
Definition: FpConfig.h:35
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
C++-compatible configuration header for fprime configuration.
Enum representing a command response.
Enum representing event severity.
void init()
Object initializer.
Definition: ObjBase.cpp:27
Definition: Time.hpp:9
Enabled and disabled state.
Auto-generated base for ActiveLogger component.
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_pingOut_OutputPort(FwIndexType portNum)
void regCommands()
Register commands with the Command Dispatcher.
void FatalAnnounce_out(FwIndexType portNum, FwEventIdType Id)
Invoke output port FatalAnnounce.
void set_CmdReg_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to CmdReg[portNum].
bool isConnected_CmdReg_OutputPort(FwIndexType portNum)
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
@ EVENTID_ID_FILTER_ENABLED
Indicate ID is filtered.
@ EVENTID_ID_FILTER_REMOVED
Removed an ID from the filter.
@ EVENTID_ID_FILTER_LIST_FULL
Attempted to add ID to full ID filter ID.
@ EVENTID_SEVERITY_FILTER_STATE
Dump severity filter state.
void set_FatalAnnounce_OutputPort(FwIndexType portNum, Svc::InputFatalEventPort *port)
Connect port to FatalAnnounce[portNum].
void set_PktSend_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to PktSend[portNum].
bool isConnected_FatalAnnounce_OutputPort(FwIndexType portNum)
void DUMP_FILTER_STATE_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
virtual void loqQueue_internalInterfaceHandler(FwEventIdType id, const Fw::Time &timeTag, const Fw::LogSeverity &severity, const Fw::LogBuffer &args)=0
Internal interface handler for loqQueue.
friend class ActiveLoggerComponentBaseFriend
Friend class for white-box testing.
Fw::InputCmdPort * get_CmdDisp_InputPort(FwIndexType portNum)
ActiveLoggerComponentBase(const char *compName="")
Construct ActiveLoggerComponentBase object.
bool isConnected_CmdStatus_OutputPort(FwIndexType portNum)
virtual void SET_ID_FILTER_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, U32 ID, Svc::ActiveLogger_Enabled idFilterEnabled)=0
virtual ~ActiveLoggerComponentBase()
Destroy ActiveLoggerComponentBase object.
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.
void SET_ID_FILTER_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void SET_EVENT_FILTER_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
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].
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
@ OPCODE_SET_EVENT_FILTER
Set filter for reporting events. Events are not stored in component.
@ OPCODE_DUMP_FILTER_STATE
Dump the filter states via events.
@ OPCODE_SET_ID_FILTER
Filter a particular ID.
virtual void DUMP_FILTER_STATE_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command DUMP_FILTER_STATE.
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
FwIndexType getNum_FatalAnnounce_OutputPorts() const
bool isConnected_Time_OutputPort(FwIndexType portNum)
void log_ACTIVITY_LO_SEVERITY_FILTER_STATE(Svc::ActiveLogger_FilterSeverity severity, bool enabled)
virtual void SET_EVENT_FILTER_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, Svc::ActiveLogger_FilterSeverity filterLevel, Svc::ActiveLogger_Enabled filterEnabled)=0
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
void pingOut_out(FwIndexType portNum, U32 key)
Invoke output port pingOut.
virtual void SET_ID_FILTER_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command SET_ID_FILTER.
void PktSend_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port PktSend.
bool isConnected_PktSend_OutputPort(FwIndexType portNum)
bool isConnected_Log_OutputPort(FwIndexType portNum)
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 DUMP_FILTER_STATE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
Fw::InputLogPort * get_LogRecv_InputPort(FwIndexType portNum)
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.