F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
AssertFatalAdapterComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title AssertFatalAdapterComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for AssertFatalAdapter component base class
5 // ======================================================================
6 
7 #ifndef Svc_AssertFatalAdapterComponentAc_HPP
8 #define Svc_AssertFatalAdapterComponentAc_HPP
9 
10 #include <atomic>
11 
13 #include "Fw/FPrimeBasicTypes.hpp"
14 #include "Fw/Log/LogPortAc.hpp"
15 #include "Fw/Log/LogString.hpp"
16 #if FW_ENABLE_TEXT_LOGGING == 1
17 #include "Fw/Log/LogTextPortAc.hpp"
18 #endif
19 #if !FW_DIRECT_PORT_CALLS
21 #endif
22 #if !FW_DIRECT_PORT_CALLS
24 #endif
25 #include "Fw/Time/TimePortAc.hpp"
27 
28 namespace Svc {
29 
36  {
37 
38  // ----------------------------------------------------------------------
39  // Friend classes
40  // ----------------------------------------------------------------------
41 
46 
47  protected:
48 
49  // ----------------------------------------------------------------------
50  // Constants
51  // ----------------------------------------------------------------------
52 
54  enum {
58  };
59 
61  enum {
70  };
71 
72  public:
73 
74  // ----------------------------------------------------------------------
75  // Component initialization
76  // ----------------------------------------------------------------------
77 
79  void init(
80  FwEnumStoreType instance = 0
81  );
82 
83 #if !FW_DIRECT_PORT_CALLS
84 
85  public:
86 
87  // ----------------------------------------------------------------------
88  // Connect input ports to special output ports
89  // ----------------------------------------------------------------------
90 
92  void set_Log_OutputPort(
93  FwIndexType portNum,
94  Fw::InputLogPort* port
95  );
96 
97 #if FW_ENABLE_TEXT_LOGGING == 1
98 
100  void set_LogText_OutputPort(
101  FwIndexType portNum,
102  Fw::InputLogTextPort* port
103  );
104 
105 #endif
106 
108  void set_Time_OutputPort(
109  FwIndexType portNum,
110  Fw::InputTimePort* port
111  );
112 
113 #endif
114 
115 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
116 
117  public:
118 
119  // ----------------------------------------------------------------------
120  // Connect serial input ports to special output ports
121  // ----------------------------------------------------------------------
122 
124  void set_Log_OutputPort(
125  FwIndexType portNum,
126  Fw::InputSerializePort* port
127  );
128 
129 #if FW_ENABLE_TEXT_LOGGING == 1
130 
132  void set_LogText_OutputPort(
133  FwIndexType portNum,
134  Fw::InputSerializePort* port
135  );
136 
137 #endif
138 
140  void set_Time_OutputPort(
141  FwIndexType portNum,
142  Fw::InputSerializePort* port
143  );
144 
145 #endif
146 
147  protected:
148 
149  // ----------------------------------------------------------------------
150  // Component construction and destruction
151  // ----------------------------------------------------------------------
152 
155  const char* compName = ""
156  );
157 
160 
161  protected:
162 
163  // ----------------------------------------------------------------------
164  // Getters for numbers of special output ports
165  // ----------------------------------------------------------------------
166 
170  static constexpr FwIndexType getNum_Log_OutputPorts() {
171  return NUM_LOG_OUTPUT_PORTS;
172  }
173 
174 #if FW_ENABLE_TEXT_LOGGING == 1
175 
179  static constexpr FwIndexType getNum_LogText_OutputPorts() {
181  }
182 
183 #endif
184 
189  return NUM_TIME_OUTPUT_PORTS;
190  }
191 
192  protected:
193 
194  // ----------------------------------------------------------------------
195  // Connection status queries for special output ports
196  // ----------------------------------------------------------------------
197 
202  FwIndexType portNum
203  ) const;
204 
205 #if FW_ENABLE_TEXT_LOGGING == 1
206 
210  bool isConnected_LogText_OutputPort(
211  FwIndexType portNum
212  ) const;
213 
214 #endif
215 
220  FwIndexType portNum
221  ) const;
222 
223  protected:
224 
225  // ----------------------------------------------------------------------
226  // Event logging functions
227  // ----------------------------------------------------------------------
228 
233  const Fw::StringBase& file,
234  U32 line
235  ) const;
236 
241  const Fw::StringBase& file,
242  U32 line,
243  U32 arg1
244  ) const;
245 
250  const Fw::StringBase& file,
251  U32 line,
252  U32 arg1,
253  U32 arg2
254  ) const;
255 
260  const Fw::StringBase& file,
261  U32 line,
262  U32 arg1,
263  U32 arg2,
264  U32 arg3
265  ) const;
266 
271  const Fw::StringBase& file,
272  U32 line,
273  U32 arg1,
274  U32 arg2,
275  U32 arg3,
276  U32 arg4
277  ) const;
278 
283  const Fw::StringBase& file,
284  U32 line,
285  U32 arg1,
286  U32 arg2,
287  U32 arg3,
288  U32 arg4,
289  U32 arg5
290  ) const;
291 
296  const Fw::StringBase& file,
297  U32 line,
298  U32 arg1,
299  U32 arg2,
300  U32 arg3,
301  U32 arg4,
302  U32 arg5,
303  U32 arg6
304  ) const;
305 
310  const Fw::StringBase& file,
311  U32 line,
312  U32 numArgs
313  ) const;
314 
315  protected:
316 
317  // ----------------------------------------------------------------------
318  // Time
319  // ----------------------------------------------------------------------
320 
324  Fw::Time getTime() const;
325 
326  private:
327 
328  // ----------------------------------------------------------------------
329  // Invocation functions for special output ports
330  // ----------------------------------------------------------------------
331 
333  void Log_out(
334  FwIndexType portNum,
335  FwEventIdType id,
336  Fw::Time& timeTag,
337  const Fw::LogSeverity& severity,
338  Fw::LogBuffer& args
339  ) const;
340 
341 #if FW_ENABLE_TEXT_LOGGING
342 
344  void LogText_out(
345  FwIndexType portNum,
346  FwEventIdType id,
347  Fw::Time& timeTag,
348  const Fw::LogSeverity& severity,
349  Fw::TextLogString& text
350  ) const;
351 
352 #endif
353 
355  void Time_out(
356  FwIndexType portNum,
357  Fw::Time& time
358  ) const;
359 
360 #if !FW_DIRECT_PORT_CALLS
361 
362  private:
363 
364  // ----------------------------------------------------------------------
365  // Special output ports
366  // ----------------------------------------------------------------------
367 
369  Fw::OutputLogPort m_Log_OutputPort[NUM_LOG_OUTPUT_PORTS];
370 
371 #if FW_ENABLE_TEXT_LOGGING == 1
372 
374  Fw::OutputLogTextPort m_LogText_OutputPort[NUM_LOGTEXT_OUTPUT_PORTS];
375 
376 #endif
377 
379  Fw::OutputTimePort m_Time_OutputPort[NUM_TIME_OUTPUT_PORTS];
380 
381 #endif
382 
383  };
384 
385 }
386 
387 #endif
void log_FATAL_AF_UNEXPECTED_ASSERT(const Fw::StringBase &file, U32 line, U32 numArgs) const
void log_FATAL_AF_ASSERT_1(const Fw::StringBase &file, U32 line, U32 arg1) const
friend class AssertFatalAdapterTesterBase
Friend class tester to support autocoded test harness.
void log_FATAL_AF_ASSERT_3(const Fw::StringBase &file, U32 line, U32 arg1, U32 arg2, U32 arg3) const
I32 FwEnumStoreType
bool isConnected_Time_OutputPort(FwIndexType portNum) const
AssertFatalAdapterComponentBase(const char *compName="")
Construct AssertFatalAdapterComponentBase object.
friend class AssertFatalAdapterTester
Friend class tester implementation to support white-box testing.
void log_FATAL_AF_ASSERT_2(const Fw::StringBase &file, U32 line, U32 arg1, U32 arg2) const
void init()
Object initializer.
Definition: ObjBase.cpp:24
FwIdType FwEventIdType
The type of an event identifier.
void log_FATAL_AF_ASSERT_5(const Fw::StringBase &file, U32 line, U32 arg1, U32 arg2, U32 arg3, U32 arg4, U32 arg5) const
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
void log_FATAL_AF_ASSERT_4(const Fw::StringBase &file, U32 line, U32 arg1, U32 arg2, U32 arg3, U32 arg4) const
bool isConnected_Log_OutputPort(FwIndexType portNum) const
void log_FATAL_AF_ASSERT_0(const Fw::StringBase &file, U32 line) const
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
Enum representing event severity.
virtual ~AssertFatalAdapterComponentBase()
Destroy AssertFatalAdapterComponentBase object.
PlatformIndexType FwIndexType
RateGroupDivider component implementation.
static constexpr FwIndexType getNum_Time_OutputPorts()
static constexpr FwIndexType getNum_Log_OutputPorts()
Auto-generated base for AssertFatalAdapter component.
void log_FATAL_AF_ASSERT_6(const Fw::StringBase &file, U32 line, U32 arg1, U32 arg2, U32 arg3, U32 arg4, U32 arg5, U32 arg6) const