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 
54  return CAPACITY;
55  }
56 
59  U8* getBuffAddr() override {
60  return m_buff;
61  }
62 
65  const U8* getBuffAddr() const override {
66  return m_buff;
67  }
68 
69  private:
70 
71  // ----------------------------------------------------------------------
72  // Private member variables
73  // ----------------------------------------------------------------------
74 
75  U8 m_buff[CAPACITY];
76 
77  };
78 
83 
84  public:
85 
86  // ----------------------------------------------------------------------
87  // Public constructors for LogTextPortSerializer
88  // ----------------------------------------------------------------------
89 
92 
93  public:
94 
95  // ----------------------------------------------------------------------
96  // Public member functions for LogTextPortSerializer
97  // ----------------------------------------------------------------------
98 
101  Fw::SerialBufferBase& _buffer
102  );
103 
104  public:
105 
106  // ----------------------------------------------------------------------
107  // Public static functions for LogTextPortSerializer
108  // ----------------------------------------------------------------------
109 
112  FwEventIdType id,
113  Fw::Time& timeTag,
114  const Fw::LogSeverity& severity,
115  Fw::TextLogString& text,
116  Fw::SerialBufferBase& _buffer
117  );
118 
119  public:
120 
121  // ----------------------------------------------------------------------
122  // Public member variables for LogTextPortSerializer
123  // ----------------------------------------------------------------------
124 
129 
130  };
131 
132 #if !FW_DIRECT_PORT_CALLS
133 
138  public Fw::InputPortBase
139  {
140 
141  public:
142 
143  // ----------------------------------------------------------------------
144  // Public types for InputLogTextPort
145  // ----------------------------------------------------------------------
146 
148  typedef void (*CompFuncPtr)(
149  Fw::PassiveComponentBase* callComp,
150  FwIndexType portNum,
151  FwEventIdType id,
152  Fw::Time& timeTag,
153  const Fw::LogSeverity& severity,
154  Fw::TextLogString& text
155  );
156 
157  public:
158 
159  // ----------------------------------------------------------------------
160  // Public constructors for InputLogTextPort
161  // ----------------------------------------------------------------------
162 
165 
166  public:
167 
168  // ----------------------------------------------------------------------
169  // Public member functions for InputLogTextPort
170  // ----------------------------------------------------------------------
171 
173  void init();
174 
176  void addCallComp(
177  Fw::PassiveComponentBase* callComp,
178  CompFuncPtr funcPtr
179  );
180 
182  void invoke(
183  FwEventIdType id,
184  Fw::Time& timeTag,
185  const Fw::LogSeverity& severity,
186  Fw::TextLogString& text
187  );
188 
189  private:
190 
191  // ----------------------------------------------------------------------
192  // Private member functions for InputLogTextPort
193  // ----------------------------------------------------------------------
194 
195 #if FW_PORT_SERIALIZATION == 1
196 
199  Fw::SerializeStatus invokeSerial(
200  Fw::LinearBufferBase& _buffer
201  );
202 
203 #endif
204 
205  private:
206 
207  // ----------------------------------------------------------------------
208  // Private member variables for InputLogTextPort
209  // ----------------------------------------------------------------------
210 
212  CompFuncPtr m_func;
213 
214  };
215 
220  public Fw::OutputPortBase
221  {
222 
223  public:
224 
225  // ----------------------------------------------------------------------
226  // Public constructors for OutputLogTextPort
227  // ----------------------------------------------------------------------
228 
231 
232  public:
233 
234  // ----------------------------------------------------------------------
235  // Public member functions for OutputLogTextPort
236  // ----------------------------------------------------------------------
237 
239  void init();
240 
242  void addCallPort(
243  InputLogTextPort* callPort
244  );
245 
247  void invoke(
248  FwEventIdType id,
249  Fw::Time& timeTag,
250  const Fw::LogSeverity& severity,
251  Fw::TextLogString& text
252  ) const;
253 
254  private:
255 
256  // ----------------------------------------------------------------------
257  // Private member variables for OutputLogTextPort
258  // ----------------------------------------------------------------------
259 
261  InputLogTextPort* m_port;
262 
263  };
264 
265 #endif
266 
267 }
268 
269 #endif
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
InputLogTextPort()
Constructor.
void init()
Initialization function.
LogTextPortSerializer()
Constructor.
PlatformSizeType FwSizeType
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
FwIdType FwEventIdType
The type of an event identifier.
The size of the serial representation.
FwSizeType SizeType
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:53
Fw::Serializable::SizeType getCapacity() const override
static constexpr FwSizeType CAPACITY
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::TextLogString &text) const
Invoke a port connection.
U8 * getBuffAddr() override
PlatformIndexType FwIndexType
void init()
Initialization function.
Implementation of malloc based allocator.
const U8 * getBuffAddr() const override
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::TextLogString &text)
The port callback function type.