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"
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
23#endif
26#include "Fw/Time/Time.hpp"
33
34namespace 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 NATIVE_INT_TYPE queueDepth,
109 NATIVE_INT_TYPE instance = 0
110 );
111
112 public:
113
114 // ----------------------------------------------------------------------
115 // Getters for special input ports
116 // ----------------------------------------------------------------------
117
122 NATIVE_INT_TYPE portNum
123 );
124
125 public:
126
127 // ----------------------------------------------------------------------
128 // Getters for typed input ports
129 // ----------------------------------------------------------------------
130
135 NATIVE_INT_TYPE portNum
136 );
137
142 NATIVE_INT_TYPE portNum
143 );
144
145 public:
146
147 // ----------------------------------------------------------------------
148 // Connect input ports to special output ports
149 // ----------------------------------------------------------------------
150
153 NATIVE_INT_TYPE portNum,
155 );
156
159 NATIVE_INT_TYPE portNum,
161 );
162
165 NATIVE_INT_TYPE portNum,
166 Fw::InputLogPort* port
167 );
168
169#if FW_ENABLE_TEXT_LOGGING == 1
170
172 void set_LogText_OutputPort(
173 NATIVE_INT_TYPE portNum,
175 );
176
177#endif
178
181 NATIVE_INT_TYPE portNum,
182 Fw::InputTimePort* port
183 );
184
185 public:
186
187 // ----------------------------------------------------------------------
188 // Connect typed input ports to typed output ports
189 // ----------------------------------------------------------------------
190
193 NATIVE_INT_TYPE portNum,
195 );
196
199 NATIVE_INT_TYPE portNum,
200 Fw::InputComPort* port
201 );
202
205 NATIVE_INT_TYPE 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 NATIVE_INT_TYPE portNum,
220 Fw::InputSerializePort* port
221 );
222
225 NATIVE_INT_TYPE portNum,
226 Fw::InputSerializePort* port
227 );
228
231 NATIVE_INT_TYPE portNum,
232 Fw::InputSerializePort* port
233 );
234
235#if FW_ENABLE_TEXT_LOGGING == 1
236
238 void set_LogText_OutputPort(
239 NATIVE_INT_TYPE portNum,
240 Fw::InputSerializePort* port
241 );
242
243#endif
244
247 NATIVE_INT_TYPE 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 NATIVE_INT_TYPE portNum,
264 Fw::InputSerializePort* port
265 );
266
269 NATIVE_INT_TYPE portNum,
270 Fw::InputSerializePort* port
271 );
272
275 NATIVE_INT_TYPE 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
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 NATIVE_INT_TYPE 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 NATIVE_INT_TYPE portNum
400 );
401
406 NATIVE_INT_TYPE portNum
407 );
408
413 NATIVE_INT_TYPE portNum
414 );
415
416#if FW_ENABLE_TEXT_LOGGING == 1
417
421 bool isConnected_LogText_OutputPort(
422 NATIVE_INT_TYPE portNum
423 );
424
425#endif
426
431 NATIVE_INT_TYPE portNum
432 );
433
434 PROTECTED:
435
436 // ----------------------------------------------------------------------
437 // Connection status queries for typed output ports
438 // ----------------------------------------------------------------------
439
444 NATIVE_INT_TYPE portNum
445 );
446
451 NATIVE_INT_TYPE portNum
452 );
453
458 NATIVE_INT_TYPE portNum
459 );
460
461 PROTECTED:
462
463 // ----------------------------------------------------------------------
464 // Handlers to implement for typed input ports
465 // ----------------------------------------------------------------------
466
468 virtual void LogRecv_handler(
469 NATIVE_INT_TYPE 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 NATIVE_INT_TYPE 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
492 NATIVE_INT_TYPE portNum,
493 FwEventIdType id,
494 Fw::Time& timeTag,
495 const Fw::LogSeverity& severity,
496 Fw::LogBuffer& args
497 );
498
501 NATIVE_INT_TYPE 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 NATIVE_INT_TYPE portNum,
518 U32 key
519 );
520
521 PROTECTED:
522
523 // ----------------------------------------------------------------------
524 // Invocation functions for typed output ports
525 // ----------------------------------------------------------------------
526
529 NATIVE_INT_TYPE portNum,
530 FwEventIdType Id
531 );
532
534 void PktSend_out(
535 NATIVE_INT_TYPE portNum,
536 Fw::ComBuffer& data,
537 U32 context
538 );
539
541 void pingOut_out(
542 NATIVE_INT_TYPE 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
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 NATIVE_INT_TYPE 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 NATIVE_INT_TYPE 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 NATIVE_INT_TYPE 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
807
810
812 Fw::OutputLogPort m_Log_OutputPort[NUM_LOG_OUTPUT_PORTS];
813
814#if FW_ENABLE_TEXT_LOGGING == 1
815
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
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
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:51
U32 FwEventIdType
Definition FpConfig.h:62
U32 FwOpcodeType
Definition FpConfig.h:56
C++-compatible configuration header for fprime configuration.
Enum representing a command response.
Enum representing event severity.
void init()
Object initializer.
Definition ObjBase.cpp:27
Auto-generated base for ActiveLogger component.
virtual void pingIn_preMsgHook(NATIVE_INT_TYPE portNum, U32 key)
Pre-message hook for async input port pingIn.
NATIVE_INT_TYPE getNum_CmdReg_OutputPorts() const
bool isConnected_CmdStatus_OutputPort(NATIVE_INT_TYPE portNum)
void regCommands()
Register commands with the Command Dispatcher.
bool isConnected_CmdReg_OutputPort(NATIVE_INT_TYPE portNum)
void set_CmdStatus_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputCmdResponsePort *port)
Connect port to CmdStatus[portNum].
bool isConnected_PktSend_OutputPort(NATIVE_INT_TYPE portNum)
void FatalAnnounce_out(NATIVE_INT_TYPE portNum, FwEventIdType Id)
Invoke output port FatalAnnounce.
void DUMP_FILTER_STATE_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
NATIVE_INT_TYPE getNum_pingIn_InputPorts() const
NATIVE_INT_TYPE getNum_pingOut_OutputPorts() const
void set_FatalAnnounce_OutputPort(NATIVE_INT_TYPE portNum, Svc::InputFatalEventPort *port)
Connect port to FatalAnnounce[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.
void set_Time_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
friend class ActiveLoggerComponentBaseFriend
Friend class for white-box testing.
bool isConnected_Log_OutputPort(NATIVE_INT_TYPE portNum)
bool isConnected_pingOut_OutputPort(NATIVE_INT_TYPE portNum)
@ 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.
void PktSend_out(NATIVE_INT_TYPE portNum, Fw::ComBuffer &data, U32 context)
Invoke output port PktSend.
void set_Log_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
ActiveLoggerComponentBase(const char *compName="")
Construct ActiveLoggerComponentBase object.
NATIVE_INT_TYPE getNum_Time_OutputPorts() const
virtual void SET_ID_FILTER_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, U32 ID, Svc::ActiveLogger_Enabled idFilterEnabled)=0
void set_pingOut_OutputPort(NATIVE_INT_TYPE portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
virtual ~ActiveLoggerComponentBase()
Destroy ActiveLoggerComponentBase object.
void SET_ID_FILTER_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void SET_EVENT_FILTER_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
NATIVE_INT_TYPE getNum_Log_OutputPorts() const
NATIVE_INT_TYPE getNum_CmdStatus_OutputPorts() const
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
NATIVE_INT_TYPE getNum_PktSend_OutputPorts() const
Svc::InputPingPort * get_pingIn_InputPort(NATIVE_INT_TYPE 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.
virtual void DUMP_FILTER_STATE_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command DUMP_FILTER_STATE.
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
NATIVE_INT_TYPE getNum_CmdDisp_InputPorts() const
void pingIn_handlerBase(NATIVE_INT_TYPE portNum, U32 key)
Handler base-class function for input port pingIn.
virtual void SET_ID_FILTER_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command SET_ID_FILTER.
bool isConnected_FatalAnnounce_OutputPort(NATIVE_INT_TYPE portNum)
bool isConnected_Time_OutputPort(NATIVE_INT_TYPE portNum)
void LogRecv_handlerBase(NATIVE_INT_TYPE portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Handler base-class function for input port LogRecv.
void loqQueue_internalInterfaceInvoke(FwEventIdType id, const Fw::Time &timeTag, const Fw::LogSeverity &severity, const Fw::LogBuffer &args)
Internal interface base-class function for loqQueue.
void set_PktSend_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputComPort *port)
Connect port to PktSend[portNum].
Fw::InputLogPort * get_LogRecv_InputPort(NATIVE_INT_TYPE portNum)
virtual void DUMP_FILTER_STATE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
virtual void pingIn_handler(NATIVE_INT_TYPE portNum, U32 key)=0
Handler for input port pingIn.
void pingOut_out(NATIVE_INT_TYPE portNum, U32 key)
Invoke output port pingOut.
NATIVE_INT_TYPE getNum_FatalAnnounce_OutputPorts() const
NATIVE_INT_TYPE getNum_LogRecv_InputPorts() const
Fw::InputCmdPort * get_CmdDisp_InputPort(NATIVE_INT_TYPE portNum)
virtual void LogRecv_handler(NATIVE_INT_TYPE portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)=0
Handler for input port LogRecv.
void set_CmdReg_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputCmdRegPort *port)
Connect port to CmdReg[portNum].