F´ Flight Software - C/C++ Documentation NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ComLoggerComponentAc.hpp
Go to the documentation of this file.
1// ======================================================================
2// \title ComLoggerComponentAc.hpp
3// \author Generated by fpp-to-cpp
4// \brief hpp file for ComLogger component base class
5// ======================================================================
6
7#ifndef Svc_ComLoggerComponentAc_HPP
8#define Svc_ComLoggerComponentAc_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/LogPortAc.hpp"
18#include "Fw/Log/LogString.hpp"
19#if FW_ENABLE_TEXT_LOGGING == 1
21#endif
26
27namespace Svc {
28
35 {
36
37 // ----------------------------------------------------------------------
38 // Friend classes
39 // ----------------------------------------------------------------------
40
43
44 PROTECTED:
45
46 // ----------------------------------------------------------------------
47 // Constants
48 // ----------------------------------------------------------------------
49
51 enum {
53 };
54
56 enum {
59 };
60
62 enum {
68 };
69
71 enum {
73 };
74
76 enum {
78 };
79
81 enum {
87 };
88
90 enum {
92 };
93
94 public:
95
96 // ----------------------------------------------------------------------
97 // Component initialization
98 // ----------------------------------------------------------------------
99
101 void init(
102 NATIVE_INT_TYPE queueDepth,
103 NATIVE_INT_TYPE instance = 0
104 );
105
106 public:
107
108 // ----------------------------------------------------------------------
109 // Getters for special input ports
110 // ----------------------------------------------------------------------
111
116 NATIVE_INT_TYPE portNum
117 );
118
119 public:
120
121 // ----------------------------------------------------------------------
122 // Getters for typed input ports
123 // ----------------------------------------------------------------------
124
129 NATIVE_INT_TYPE portNum
130 );
131
136 NATIVE_INT_TYPE portNum
137 );
138
139 public:
140
141 // ----------------------------------------------------------------------
142 // Connect special input ports to special output ports
143 // ----------------------------------------------------------------------
144
145#if FW_ENABLE_TEXT_LOGGING == 1
146
148 void set_LogText_OutputPort(
149 NATIVE_INT_TYPE portNum,
151 );
152
153#endif
154
157 NATIVE_INT_TYPE portNum,
159 );
160
163 NATIVE_INT_TYPE portNum,
165 );
166
169 NATIVE_INT_TYPE portNum,
170 Fw::InputLogPort* port
171 );
172
175 NATIVE_INT_TYPE portNum,
176 Fw::InputTimePort* port
177 );
178
179 public:
180
181 // ----------------------------------------------------------------------
182 // Connect typed input ports to typed output ports
183 // ----------------------------------------------------------------------
184
187 NATIVE_INT_TYPE portNum,
188 Svc::InputPingPort* port
189 );
190
191#if FW_PORT_SERIALIZATION
192
193 public:
194
195 // ----------------------------------------------------------------------
196 // Connect serial input ports to special output ports
197 // ----------------------------------------------------------------------
198
199#if FW_ENABLE_TEXT_LOGGING == 1
200
202 void set_LogText_OutputPort(
203 NATIVE_INT_TYPE portNum,
204 Fw::InputSerializePort* port
205 );
206
207#endif
208
211 NATIVE_INT_TYPE portNum,
212 Fw::InputSerializePort* port
213 );
214
217 NATIVE_INT_TYPE portNum,
218 Fw::InputSerializePort* port
219 );
220
223 NATIVE_INT_TYPE portNum,
224 Fw::InputSerializePort* port
225 );
226
229 NATIVE_INT_TYPE portNum,
230 Fw::InputSerializePort* port
231 );
232
233#endif
234
235#if FW_PORT_SERIALIZATION
236
237 public:
238
239 // ----------------------------------------------------------------------
240 // Connect serial input ports to typed output ports
241 // ----------------------------------------------------------------------
242
245 NATIVE_INT_TYPE portNum,
246 Fw::InputSerializePort* port
247 );
248
249#endif
250
251 public:
252
253 // ----------------------------------------------------------------------
254 // Command registration
255 // ----------------------------------------------------------------------
256
260 void regCommands();
261
262 PROTECTED:
263
264 // ----------------------------------------------------------------------
265 // Component construction and destruction
266 // ----------------------------------------------------------------------
267
270 const char* compName = ""
271 );
272
274 virtual ~ComLoggerComponentBase();
275
276 PROTECTED:
277
278 // ----------------------------------------------------------------------
279 // Getters for numbers of special input ports
280 // ----------------------------------------------------------------------
281
286
287 PROTECTED:
288
289 // ----------------------------------------------------------------------
290 // Getters for numbers of typed input ports
291 // ----------------------------------------------------------------------
292
297
302
303 PROTECTED:
304
305 // ----------------------------------------------------------------------
306 // Getters for numbers of special output ports
307 // ----------------------------------------------------------------------
308
309#if FW_ENABLE_TEXT_LOGGING == 1
310
314 NATIVE_INT_TYPE getNum_LogText_OutputPorts();
315
316#endif
317
322
327
332
337
338 PROTECTED:
339
340 // ----------------------------------------------------------------------
341 // Getters for numbers of typed output ports
342 // ----------------------------------------------------------------------
343
348
349 PROTECTED:
350
351 // ----------------------------------------------------------------------
352 // Connection status queries for special output ports
353 // ----------------------------------------------------------------------
354
355#if FW_ENABLE_TEXT_LOGGING == 1
356
360 bool isConnected_LogText_OutputPort(
361 NATIVE_INT_TYPE portNum
362 );
363
364#endif
365
370 NATIVE_INT_TYPE portNum
371 );
372
377 NATIVE_INT_TYPE portNum
378 );
379
384 NATIVE_INT_TYPE portNum
385 );
386
391 NATIVE_INT_TYPE portNum
392 );
393
394 PROTECTED:
395
396 // ----------------------------------------------------------------------
397 // Connection status queries for typed output ports
398 // ----------------------------------------------------------------------
399
404 NATIVE_INT_TYPE portNum
405 );
406
407 PROTECTED:
408
409 // ----------------------------------------------------------------------
410 // Handlers to implement for typed input ports
411 // ----------------------------------------------------------------------
412
414 virtual void comIn_handler(
415 NATIVE_INT_TYPE portNum,
416 Fw::ComBuffer& data,
417 U32 context
418 ) = 0;
419
421 virtual void pingIn_handler(
422 NATIVE_INT_TYPE portNum,
423 U32 key
424 ) = 0;
425
426 PROTECTED:
427
428 // ----------------------------------------------------------------------
429 // Port handler base-class functions for typed input ports
430 //
431 // Call these functions directly to bypass the corresponding ports
432 // ----------------------------------------------------------------------
433
436 NATIVE_INT_TYPE portNum,
437 Fw::ComBuffer& data,
438 U32 context
439 );
440
443 NATIVE_INT_TYPE portNum,
444 U32 key
445 );
446
447 PROTECTED:
448
449 // ----------------------------------------------------------------------
450 // Pre-message hooks for typed async input ports
451 //
452 // Each of these functions is invoked just before processing a message
453 // on the corresponding port. By default, they do nothing. You can
454 // override them to provide specific pre-message behavior.
455 // ----------------------------------------------------------------------
456
458 virtual void comIn_preMsgHook(
459 NATIVE_INT_TYPE portNum,
460 Fw::ComBuffer& data,
461 U32 context
462 );
463
465 virtual void pingIn_preMsgHook(
466 NATIVE_INT_TYPE portNum,
467 U32 key
468 );
469
470 PROTECTED:
471
472 // ----------------------------------------------------------------------
473 // Invocation functions for typed output ports
474 // ----------------------------------------------------------------------
475
477 void pingOut_out(
478 NATIVE_INT_TYPE portNum,
479 U32 key
480 );
481
482 PROTECTED:
483
484 // ----------------------------------------------------------------------
485 // Command response
486 // ----------------------------------------------------------------------
487
489 void cmdResponse_out(
490 FwOpcodeType opCode,
491 U32 cmdSeq,
492 Fw::CmdResponse response
493 );
494
495 PROTECTED:
496
497 // ----------------------------------------------------------------------
498 // Command handlers to implement
499 // ----------------------------------------------------------------------
500
505 FwOpcodeType opCode,
506 U32 cmdSeq
507 ) = 0;
508
509 PROTECTED:
510
511 // ----------------------------------------------------------------------
512 // Command handler base-class functions
513 //
514 // Call these functions directly to bypass the command input port
515 // ----------------------------------------------------------------------
516
521 FwOpcodeType opCode,
522 U32 cmdSeq,
523 Fw::CmdArgBuffer& args
524 );
525
526 PROTECTED:
527
528 // ----------------------------------------------------------------------
529 // Pre-message hooks for async commands
530 //
531 // Each of these functions is invoked just before processing the
532 // corresponding command. By default they do nothing. You can
533 // override them to provide specific pre-command behavior.
534 // ----------------------------------------------------------------------
535
537 virtual void CloseFile_preMsgHook(
538 FwOpcodeType opCode,
539 U32 cmdSeq
540 );
541
542 PROTECTED:
543
544 // ----------------------------------------------------------------------
545 // Event logging functions
546 // ----------------------------------------------------------------------
547
552 U32 errornum,
553 const Fw::LogStringArg& file
554 );
555
560 U32 errornum,
561 U32 bytesWritten,
562 U32 bytesToWrite,
563 const Fw::LogStringArg& file
564 );
565
570 const Fw::LogStringArg& validationFile,
571 const Fw::LogStringArg& file,
572 U32 status
573 );
574
579 const Fw::LogStringArg& file
580 );
581
584
585 PROTECTED:
586
587 // ----------------------------------------------------------------------
588 // Event throttle reset functions
589 // ----------------------------------------------------------------------
590
593
594 PROTECTED:
595
596 // ----------------------------------------------------------------------
597 // Time
598 // ----------------------------------------------------------------------
599
604
605 PRIVATE:
606
607 // ----------------------------------------------------------------------
608 // Message dispatch functions
609 // ----------------------------------------------------------------------
610
612 virtual MsgDispatchStatus doDispatch();
613
614 PRIVATE:
615
616 // ----------------------------------------------------------------------
617 // Calls for messages received on special input ports
618 // ----------------------------------------------------------------------
619
621 static void m_p_cmdIn_in(
622 Fw::PassiveComponentBase* callComp,
623 NATIVE_INT_TYPE portNum,
624 FwOpcodeType opCode,
625 U32 cmdSeq,
626 Fw::CmdArgBuffer& args
627 );
628
629 PRIVATE:
630
631 // ----------------------------------------------------------------------
632 // Calls for messages received on typed input ports
633 // ----------------------------------------------------------------------
634
636 static void m_p_comIn_in(
637 Fw::PassiveComponentBase* callComp,
638 NATIVE_INT_TYPE portNum,
639 Fw::ComBuffer& data,
640 U32 context
641 );
642
644 static void m_p_pingIn_in(
645 Fw::PassiveComponentBase* callComp,
646 NATIVE_INT_TYPE portNum,
647 U32 key
648 );
649
650 PRIVATE:
651
652 // ----------------------------------------------------------------------
653 // Special input ports
654 // ----------------------------------------------------------------------
655
657 Fw::InputCmdPort m_cmdIn_InputPort[NUM_CMDIN_INPUT_PORTS];
658
659 PRIVATE:
660
661 // ----------------------------------------------------------------------
662 // Typed input ports
663 // ----------------------------------------------------------------------
664
666 Fw::InputComPort m_comIn_InputPort[NUM_COMIN_INPUT_PORTS];
667
669 Svc::InputPingPort m_pingIn_InputPort[NUM_PINGIN_INPUT_PORTS];
670
671 PRIVATE:
672
673 // ----------------------------------------------------------------------
674 // Special output ports
675 // ----------------------------------------------------------------------
676
677#if FW_ENABLE_TEXT_LOGGING == 1
678
681
682#endif
683
685 Fw::OutputCmdRegPort m_cmdRegOut_OutputPort[NUM_CMDREGOUT_OUTPUT_PORTS];
686
689
691 Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
692
694 Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
695
696 PRIVATE:
697
698 // ----------------------------------------------------------------------
699 // Typed output ports
700 // ----------------------------------------------------------------------
701
703 Svc::OutputPingPort m_pingOut_OutputPort[NUM_PINGOUT_OUTPUT_PORTS];
704
705 PRIVATE:
706
707 // ----------------------------------------------------------------------
708 // Counter values for event throttling
709 // ----------------------------------------------------------------------
710
712 NATIVE_UINT_TYPE m_FileNotInitializedThrottle;
713
714 };
715
716}
717
718#endif
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:51
PlatformUIntType NATIVE_UINT_TYPE
Definition BasicTypes.h:52
U32 FwOpcodeType
Definition FpConfig.h:56
C++-compatible configuration header for fprime configuration.
Enum representing a command response.
void init()
Object initializer.
Definition ObjBase.cpp:27
Auto-generated base for ComLogger component.
void log_WARNING_HI_FileOpenError(U32 errornum, const Fw::LogStringArg &file)
virtual ~ComLoggerComponentBase()
Destroy ComLoggerComponentBase object.
bool isConnected_cmdRegOut_OutputPort(NATIVE_INT_TYPE portNum)
NATIVE_INT_TYPE getNum_cmdRegOut_OutputPorts()
void log_DIAGNOSTIC_FileClosed(const Fw::LogStringArg &file)
bool isConnected_cmdResponseOut_OutputPort(NATIVE_INT_TYPE portNum)
Fw::InputCmdPort * get_cmdIn_InputPort(NATIVE_INT_TYPE portNum)
@ EVENTID_FILECLOSED
The ComLogger successfully closed a file on command.
@ EVENTID_FILEWRITEERROR
The ComLogger encountered an error writing to a file.
@ EVENTID_FILEVALIDATIONERROR
The ComLogger encountered an error writing the validation file.
@ EVENTID_FILEOPENERROR
The ComLogger encountered an error opening a file.
ComLoggerComponentBase(const char *compName="")
Construct ComLoggerComponentBase object.
NATIVE_INT_TYPE getNum_cmdResponseOut_OutputPorts()
@ OPCODE_CLOSEFILE
Forces a close of the currently opened file.
virtual void comIn_handler(NATIVE_INT_TYPE portNum, Fw::ComBuffer &data, U32 context)=0
Handler for input port comIn.
friend class ComLoggerComponentBaseFriend
Friend class for white-box testing.
Fw::InputComPort * get_comIn_InputPort(NATIVE_INT_TYPE portNum)
virtual void pingIn_handler(NATIVE_INT_TYPE portNum, U32 key)=0
Handler for input port pingIn.
void log_WARNING_LO_FileValidationError(const Fw::LogStringArg &validationFile, const Fw::LogStringArg &file, U32 status)
virtual void comIn_preMsgHook(NATIVE_INT_TYPE portNum, Fw::ComBuffer &data, U32 context)
Pre-message hook for async input port comIn.
virtual void pingIn_preMsgHook(NATIVE_INT_TYPE portNum, U32 key)
Pre-message hook for async input port pingIn.
void comIn_handlerBase(NATIVE_INT_TYPE portNum, Fw::ComBuffer &data, U32 context)
Handler base-class function for input port comIn.
bool isConnected_pingOut_OutputPort(NATIVE_INT_TYPE portNum)
virtual void CloseFile_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
void log_WARNING_LO_FileNotInitialized()
Log event FileNotInitialized.
void CloseFile_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void set_timeCaller_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
void regCommands()
Register commands with the Command Dispatcher.
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
NATIVE_INT_TYPE getNum_timeCaller_OutputPorts()
@ EVENTID_FILENOTINITIALIZED_THROTTLE
Throttle reset count for FileNotInitialized.
virtual void CloseFile_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command CloseFile.
bool isConnected_timeCaller_OutputPort(NATIVE_INT_TYPE portNum)
Svc::InputPingPort * get_pingIn_InputPort(NATIVE_INT_TYPE portNum)
void set_cmdRegOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
void pingIn_handlerBase(NATIVE_INT_TYPE portNum, U32 key)
Handler base-class function for input port pingIn.
void set_logOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
void set_pingOut_OutputPort(NATIVE_INT_TYPE portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
void pingOut_out(NATIVE_INT_TYPE portNum, U32 key)
Invoke output port pingOut.
bool isConnected_logOut_OutputPort(NATIVE_INT_TYPE portNum)
void log_WARNING_HI_FileWriteError(U32 errornum, U32 bytesWritten, U32 bytesToWrite, const Fw::LogStringArg &file)
void set_cmdResponseOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
void log_WARNING_LO_FileNotInitialized_ThrottleClear()
Reset throttle value for FileNotInitialized.