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 #include "Fw/Log/LogTextPortAc.hpp"
17 #if !FW_DIRECT_PORT_CALLS
19 #endif
20 #if !FW_DIRECT_PORT_CALLS
22 #endif
23 #include "Fw/Time/TimePortAc.hpp"
25 
26 namespace Svc {
27 
34  {
35 
36  // ----------------------------------------------------------------------
37  // Friend classes
38  // ----------------------------------------------------------------------
39 
44 
45  protected:
46 
47  // ----------------------------------------------------------------------
48  // Constants
49  // ----------------------------------------------------------------------
50 
52  enum {
56  };
57 
59  enum {
68  };
69 
70  public:
71 
72  // ----------------------------------------------------------------------
73  // Component initialization
74  // ----------------------------------------------------------------------
75 
77  void init(
78  FwEnumStoreType instance = 0
79  );
80 
81 #if !FW_DIRECT_PORT_CALLS
82 
83  public:
84 
85  // ----------------------------------------------------------------------
86  // Connect input ports to special output ports
87  // ----------------------------------------------------------------------
88 
90  void set_Log_OutputPort(
91  FwIndexType portNum,
92  Fw::InputLogPort* port
93  );
94 
95 #if FW_ENABLE_TEXT_LOGGING == 1
96 
98  void set_LogText_OutputPort(
99  FwIndexType portNum,
100  Fw::InputLogTextPort* port
101  );
102 
103 #endif
104 
106  void set_Time_OutputPort(
107  FwIndexType portNum,
108  Fw::InputTimePort* port
109  );
110 
111 #endif
112 
113 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
114 
115  public:
116 
117  // ----------------------------------------------------------------------
118  // Connect serial input ports to special output ports
119  // ----------------------------------------------------------------------
120 
122  void set_Log_OutputPort(
123  FwIndexType portNum,
124  Fw::InputSerializePort* port
125  );
126 
127 #if FW_ENABLE_TEXT_LOGGING == 1
128 
130  void set_LogText_OutputPort(
131  FwIndexType portNum,
132  Fw::InputSerializePort* port
133  );
134 
135 #endif
136 
138  void set_Time_OutputPort(
139  FwIndexType portNum,
140  Fw::InputSerializePort* port
141  );
142 
143 #endif
144 
145  protected:
146 
147  // ----------------------------------------------------------------------
148  // Component construction and destruction
149  // ----------------------------------------------------------------------
150 
153  const char* compName = ""
154  );
155 
158 
159  protected:
160 
161  // ----------------------------------------------------------------------
162  // Getters for numbers of special output ports
163  // ----------------------------------------------------------------------
164 
168  static constexpr FwIndexType getNum_Log_OutputPorts() {
169  return NUM_LOG_OUTPUT_PORTS;
170  }
171 
172 #if FW_ENABLE_TEXT_LOGGING == 1
173 
177  static constexpr FwIndexType getNum_LogText_OutputPorts() {
179  }
180 
181 #endif
182 
187  return NUM_TIME_OUTPUT_PORTS;
188  }
189 
190  protected:
191 
192  // ----------------------------------------------------------------------
193  // Connection status queries for special output ports
194  // ----------------------------------------------------------------------
195 
200  FwIndexType portNum
201  ) const;
202 
203 #if FW_ENABLE_TEXT_LOGGING == 1
204 
208  bool isConnected_LogText_OutputPort(
209  FwIndexType portNum
210  ) const;
211 
212 #endif
213 
218  FwIndexType portNum
219  ) const;
220 
221  protected:
222 
223  // ----------------------------------------------------------------------
224  // Event logging functions
225  // ----------------------------------------------------------------------
226 
231  const Fw::StringBase& file,
232  U32 line
233  ) const;
234 
239  const Fw::StringBase& file,
240  U32 line,
241  U32 arg1
242  ) const;
243 
248  const Fw::StringBase& file,
249  U32 line,
250  U32 arg1,
251  U32 arg2
252  ) const;
253 
258  const Fw::StringBase& file,
259  U32 line,
260  U32 arg1,
261  U32 arg2,
262  U32 arg3
263  ) const;
264 
269  const Fw::StringBase& file,
270  U32 line,
271  U32 arg1,
272  U32 arg2,
273  U32 arg3,
274  U32 arg4
275  ) const;
276 
281  const Fw::StringBase& file,
282  U32 line,
283  U32 arg1,
284  U32 arg2,
285  U32 arg3,
286  U32 arg4,
287  U32 arg5
288  ) const;
289 
294  const Fw::StringBase& file,
295  U32 line,
296  U32 arg1,
297  U32 arg2,
298  U32 arg3,
299  U32 arg4,
300  U32 arg5,
301  U32 arg6
302  ) const;
303 
308  const Fw::StringBase& file,
309  U32 line,
310  U32 numArgs
311  ) const;
312 
313  protected:
314 
315  // ----------------------------------------------------------------------
316  // Time
317  // ----------------------------------------------------------------------
318 
322  Fw::Time getTime() const;
323 
324  private:
325 
326  // ----------------------------------------------------------------------
327  // Invocation functions for special output ports
328  // ----------------------------------------------------------------------
329 
331  void Log_out(
332  FwIndexType portNum,
333  FwEventIdType id,
334  Fw::Time& timeTag,
335  const Fw::LogSeverity& severity,
336  Fw::LogBuffer& args
337  ) const;
338 
339 #if FW_ENABLE_TEXT_LOGGING
340 
342  void LogText_out(
343  FwIndexType portNum,
344  FwEventIdType id,
345  Fw::Time& timeTag,
346  const Fw::LogSeverity& severity,
347  Fw::TextLogString& text
348  ) const;
349 
350 #endif
351 
353  void Time_out(
354  FwIndexType portNum,
355  Fw::Time& time
356  ) const;
357 
358 #if !FW_DIRECT_PORT_CALLS
359 
360  private:
361 
362  // ----------------------------------------------------------------------
363  // Special output ports
364  // ----------------------------------------------------------------------
365 
367  Fw::OutputLogPort m_Log_OutputPort[NUM_LOG_OUTPUT_PORTS];
368 
369 #if FW_ENABLE_TEXT_LOGGING == 1
370 
372  Fw::OutputLogTextPort m_LogText_OutputPort[NUM_LOGTEXT_OUTPUT_PORTS];
373 
374 #endif
375 
377  Fw::OutputTimePort m_Time_OutputPort[NUM_TIME_OUTPUT_PORTS];
378 
379 #endif
380 
381  };
382 
383 }
384 
385 #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