F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
PassiveTextLoggerComponentAc.cpp
Go to the documentation of this file.
1// ======================================================================
2// \title PassiveTextLoggerComponentAc.cpp
3// \author Generated by fpp-to-cpp
4// \brief cpp file for PassiveTextLogger component base class
5// ======================================================================
6
8#include "Fw/Types/Assert.hpp"
10#if FW_ENABLE_TEXT_LOGGING
11#include "Fw/Types/String.hpp"
12#endif
13
14namespace Svc {
15
16 // ----------------------------------------------------------------------
17 // Component initialization
18 // ----------------------------------------------------------------------
19
20 void PassiveTextLoggerComponentBase ::
21 init(FwEnumStoreType instance)
22 {
23 // Initialize base class
25
26 // Connect input port TextLogger
27 for (
28 FwIndexType port = 0;
29 port < static_cast<FwIndexType>(this->getNum_TextLogger_InputPorts());
30 port++
31 ) {
32 this->m_TextLogger_InputPort[port].init();
33 this->m_TextLogger_InputPort[port].addCallComp(
34 this,
35 m_p_TextLogger_in
36 );
37 this->m_TextLogger_InputPort[port].setPortNum(port);
38
39#if FW_OBJECT_NAMES == 1
40 Fw::ObjectName portName;
41 portName.format(
42 "%s_TextLogger_InputPort[%" PRI_PlatformIntType "]",
43 this->m_objName.toChar(),
44 port
45 );
46 this->m_TextLogger_InputPort[port].setObjName(portName.toChar());
47#endif
48 }
49 }
50
51 // ----------------------------------------------------------------------
52 // Getters for typed input ports
53 // ----------------------------------------------------------------------
54
55 Fw::InputLogTextPort* PassiveTextLoggerComponentBase ::
56 get_TextLogger_InputPort(FwIndexType portNum)
57 {
59 portNum < this->getNum_TextLogger_InputPorts(),
60 static_cast<FwAssertArgType>(portNum)
61 );
62
63 return &this->m_TextLogger_InputPort[portNum];
64 }
65
66 // ----------------------------------------------------------------------
67 // Component construction and destruction
68 // ----------------------------------------------------------------------
69
70 PassiveTextLoggerComponentBase ::
71 PassiveTextLoggerComponentBase(const char* compName) :
72 Fw::PassiveComponentBase(compName)
73 {
74
75 }
76
77 PassiveTextLoggerComponentBase ::
78 ~PassiveTextLoggerComponentBase()
79 {
80
81 }
82
83 // ----------------------------------------------------------------------
84 // Getters for numbers of typed input ports
85 // ----------------------------------------------------------------------
86
87 FwIndexType PassiveTextLoggerComponentBase ::
88 getNum_TextLogger_InputPorts() const
89 {
90 return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_TextLogger_InputPort));
91 }
92
93 // ----------------------------------------------------------------------
94 // Port handler base-class functions for typed input ports
95 //
96 // Call these functions directly to bypass the corresponding ports
97 // ----------------------------------------------------------------------
98
99 void PassiveTextLoggerComponentBase ::
100 TextLogger_handlerBase(
101 FwIndexType portNum,
102 FwEventIdType id,
103 Fw::Time& timeTag,
104 const Fw::LogSeverity& severity,
106 )
107 {
108 // Make sure port number is valid
109 FW_ASSERT(
110 portNum < this->getNum_TextLogger_InputPorts(),
111 static_cast<FwAssertArgType>(portNum)
112 );
113
114 // Call handler function
115 this->TextLogger_handler(
116 portNum,
117 id,
118 timeTag,
119 severity,
120 text
121 );
122 }
123
124 // ----------------------------------------------------------------------
125 // Calls for messages received on typed input ports
126 // ----------------------------------------------------------------------
127
128 void PassiveTextLoggerComponentBase ::
129 m_p_TextLogger_in(
130 Fw::PassiveComponentBase* callComp,
131 FwIndexType portNum,
132 FwEventIdType id,
133 Fw::Time& timeTag,
134 const Fw::LogSeverity& severity,
136 )
137 {
138 FW_ASSERT(callComp);
139 PassiveTextLoggerComponentBase* compPtr = static_cast<PassiveTextLoggerComponentBase*>(callComp);
140 compPtr->TextLogger_handlerBase(
141 portNum,
142 id,
143 timeTag,
144 severity,
145 text
146 );
147 }
148
149}
#define FW_ASSERT(...)
Definition Assert.hpp:14
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition BasicTypes.h:70
#define PRI_PlatformIntType
I32 FwEnumStoreType
Definition FpConfig.h:64
PlatformAssertArgType FwAssertArgType
Definition FpConfig.h:39
U32 FwEventIdType
Definition FpConfig.h:103
PlatformIndexType FwIndexType
Definition FpConfig.h:25
Enum representing event severity.
void init()
Object initializer.
Definition ObjBase.cpp:27
const char * toChar() const
void format(const CHAR *formatString,...)
write formatted string to buffer
Auto-generated base for PassiveTextLogger component.
void TextLogger_handlerBase(FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::TextLogString &text)
Handler base-class function for input port TextLogger.