F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
LogTextPortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title LogTextPortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for LogText port
5 // ======================================================================
6 
7 #ifndef Fw_LogTextPortAc_HPP
8 #define Fw_LogTextPortAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
12 #include "Fw/Log/TextLogString.hpp"
13 #include "Fw/Time/Time.hpp"
16 #if !FW_DIRECT_PORT_CALLS
20 #endif
21 
22 namespace Fw {
23 
29  {
30 
31  public:
32 
33  // ----------------------------------------------------------------------
34  // Public constants for LogTextPortBuffer
35  // ----------------------------------------------------------------------
36 
39  static constexpr FwSizeType CAPACITY =
40  sizeof(FwEventIdType) +
44 
45  public:
46 
47  // ----------------------------------------------------------------------
48  // Public member functions for LogTextPortBuffer
49  // ----------------------------------------------------------------------
50 
53 
54  }
55 
56  private:
57 
58  // ----------------------------------------------------------------------
59  // Private member variables
60  // ----------------------------------------------------------------------
61 
62  U8 m_buff[CAPACITY];
63 
64  };
65 
70 
71  public:
72 
73  // ----------------------------------------------------------------------
74  // Public constructors for LogTextPortSerializer
75  // ----------------------------------------------------------------------
76 
79 
80  public:
81 
82  // ----------------------------------------------------------------------
83  // Public member functions for LogTextPortSerializer
84  // ----------------------------------------------------------------------
85 
88  Fw::SerialBufferBase& _buffer
89  );
90 
91  public:
92 
93  // ----------------------------------------------------------------------
94  // Public static functions for LogTextPortSerializer
95  // ----------------------------------------------------------------------
96 
99  FwEventIdType id,
100  Fw::Time& timeTag,
101  const Fw::LogSeverity& severity,
102  Fw::TextLogString& text,
103  Fw::SerialBufferBase& _buffer
104  );
105 
106  public:
107 
108  // ----------------------------------------------------------------------
109  // Public member variables for LogTextPortSerializer
110  // ----------------------------------------------------------------------
111 
116 
117  };
118 
119 #if !FW_DIRECT_PORT_CALLS
120 
125  public Fw::InputPortBase
126  {
127 
128  public:
129 
130  // ----------------------------------------------------------------------
131  // Public types for InputLogTextPort
132  // ----------------------------------------------------------------------
133 
135  typedef void (*CompFuncPtr)(
136  Fw::PassiveComponentBase* callComp,
137  FwIndexType portNum,
138  FwEventIdType id,
139  Fw::Time& timeTag,
140  const Fw::LogSeverity& severity,
141  Fw::TextLogString& text
142  );
143 
144  public:
145 
146  // ----------------------------------------------------------------------
147  // Public constructors for InputLogTextPort
148  // ----------------------------------------------------------------------
149 
152 
153  public:
154 
155  // ----------------------------------------------------------------------
156  // Public member functions for InputLogTextPort
157  // ----------------------------------------------------------------------
158 
160  void init();
161 
163  void addCallComp(
164  Fw::PassiveComponentBase* callComp,
165  CompFuncPtr funcPtr
166  );
167 
169  void invoke(
170  FwEventIdType id,
171  Fw::Time& timeTag,
172  const Fw::LogSeverity& severity,
173  Fw::TextLogString& text
174  );
175 
176  private:
177 
178  // ----------------------------------------------------------------------
179  // Private member functions for InputLogTextPort
180  // ----------------------------------------------------------------------
181 
182 #if FW_PORT_SERIALIZATION == 1
183 
186  Fw::SerializeStatus invokeSerial(
187  Fw::LinearBufferBase& _buffer
188  );
189 
190 #endif
191 
192  private:
193 
194  // ----------------------------------------------------------------------
195  // Private member variables for InputLogTextPort
196  // ----------------------------------------------------------------------
197 
199  CompFuncPtr m_func;
200 
201  };
202 
207  public Fw::OutputPortBase
208  {
209 
210  public:
211 
212  // ----------------------------------------------------------------------
213  // Public constructors for OutputLogTextPort
214  // ----------------------------------------------------------------------
215 
218 
219  public:
220 
221  // ----------------------------------------------------------------------
222  // Public member functions for OutputLogTextPort
223  // ----------------------------------------------------------------------
224 
226  void init();
227 
229  void addCallPort(
230  InputLogTextPort* callPort
231  );
232 
234  void invoke(
235  FwEventIdType id,
236  Fw::Time& timeTag,
237  const Fw::LogSeverity& severity,
238  Fw::TextLogString& text
239  ) const;
240 
241  private:
242 
243  // ----------------------------------------------------------------------
244  // Private member variables for OutputLogTextPort
245  // ----------------------------------------------------------------------
246 
248  InputLogTextPort* m_port;
249 
250  };
251 
252 #endif
253 
254 }
255 
256 #endif
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
InputLogTextPort()
Constructor.
void init()
Initialization function.
LogTextPortSerializer()
Constructor.
PlatformSizeType FwSizeType
LogTextPortBuffer()
Constructor.
OutputLogTextPort()
Constructor.
Fw::SerializeStatus deserializePortArgs(Fw::SerialBufferBase &_buffer)
Deserialze port arguments into members.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::TextLogString &text)
Invoke a port interface.
SerializeStatus
forward declaration for string
The size of the serial representation.
FwIdType FwEventIdType
The type of an event identifier.
void addCallPort(InputLogTextPort *callPort)
Register an input port.
static Fw::SerializeStatus serializePortArgs(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::TextLogString &text, Fw::SerialBufferBase &_buffer)
Serialize port arguments into a buffer.
Fw::TextLogString m_text
Enum representing event severity.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
static constexpr FwSizeType CAPACITY
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::TextLogString &text) const
Invoke a port connection.
PlatformIndexType FwIndexType
void init()
Initialization function.
Implementation of malloc based allocator.
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::TextLogString &text)
The port callback function type.