F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
LogPortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title LogPortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for Log port
5 // ======================================================================
6 
7 #ifndef Fw_LogPortAc_HPP
8 #define Fw_LogPortAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
11 #include "Fw/Log/LogBuffer.hpp"
13 #include "Fw/Time/Time.hpp"
16 #if !FW_DIRECT_PORT_CALLS
20 #endif
21 
22 namespace Fw {
23 
26  class LogPortBuffer :
28  {
29 
30  public:
31 
32  // ----------------------------------------------------------------------
33  // Public constants for LogPortBuffer
34  // ----------------------------------------------------------------------
35 
38  static constexpr FwSizeType CAPACITY =
39  sizeof(FwEventIdType) +
43 
44  public:
45 
46  // ----------------------------------------------------------------------
47  // Public member functions for LogPortBuffer
48  // ----------------------------------------------------------------------
49 
53  return CAPACITY;
54  }
55 
58  U8* getBuffAddr() override {
59  return m_buff;
60  }
61 
64  const U8* getBuffAddr() const override {
65  return m_buff;
66  }
67 
68  private:
69 
70  // ----------------------------------------------------------------------
71  // Private member variables
72  // ----------------------------------------------------------------------
73 
74  U8 m_buff[CAPACITY];
75 
76  };
77 
81 
82  public:
83 
84  // ----------------------------------------------------------------------
85  // Public constructors for LogPortSerializer
86  // ----------------------------------------------------------------------
87 
90 
91  public:
92 
93  // ----------------------------------------------------------------------
94  // Public member functions for LogPortSerializer
95  // ----------------------------------------------------------------------
96 
99  Fw::SerialBufferBase& _buffer
100  );
101 
102  public:
103 
104  // ----------------------------------------------------------------------
105  // Public static functions for LogPortSerializer
106  // ----------------------------------------------------------------------
107 
110  FwEventIdType id,
111  Fw::Time& timeTag,
112  const Fw::LogSeverity& severity,
113  Fw::LogBuffer& args,
114  Fw::SerialBufferBase& _buffer
115  );
116 
117  public:
118 
119  // ----------------------------------------------------------------------
120  // Public member variables for LogPortSerializer
121  // ----------------------------------------------------------------------
122 
127 
128  };
129 
130 #if !FW_DIRECT_PORT_CALLS
131 
134  class InputLogPort :
135  public Fw::InputPortBase
136  {
137 
138  public:
139 
140  // ----------------------------------------------------------------------
141  // Public types for InputLogPort
142  // ----------------------------------------------------------------------
143 
145  typedef void (*CompFuncPtr)(
146  Fw::PassiveComponentBase* callComp,
147  FwIndexType portNum,
148  FwEventIdType id,
149  Fw::Time& timeTag,
150  const Fw::LogSeverity& severity,
151  Fw::LogBuffer& args
152  );
153 
154  public:
155 
156  // ----------------------------------------------------------------------
157  // Public constructors for InputLogPort
158  // ----------------------------------------------------------------------
159 
161  InputLogPort();
162 
163  public:
164 
165  // ----------------------------------------------------------------------
166  // Public member functions for InputLogPort
167  // ----------------------------------------------------------------------
168 
170  void init();
171 
173  void addCallComp(
174  Fw::PassiveComponentBase* callComp,
175  CompFuncPtr funcPtr
176  );
177 
179  void invoke(
180  FwEventIdType id,
181  Fw::Time& timeTag,
182  const Fw::LogSeverity& severity,
183  Fw::LogBuffer& args
184  );
185 
186  private:
187 
188  // ----------------------------------------------------------------------
189  // Private member functions for InputLogPort
190  // ----------------------------------------------------------------------
191 
192 #if FW_PORT_SERIALIZATION == 1
193 
196  Fw::SerializeStatus invokeSerial(
197  Fw::LinearBufferBase& _buffer
198  );
199 
200 #endif
201 
202  private:
203 
204  // ----------------------------------------------------------------------
205  // Private member variables for InputLogPort
206  // ----------------------------------------------------------------------
207 
209  CompFuncPtr m_func;
210 
211  };
212 
216  public Fw::OutputPortBase
217  {
218 
219  public:
220 
221  // ----------------------------------------------------------------------
222  // Public constructors for OutputLogPort
223  // ----------------------------------------------------------------------
224 
226  OutputLogPort();
227 
228  public:
229 
230  // ----------------------------------------------------------------------
231  // Public member functions for OutputLogPort
232  // ----------------------------------------------------------------------
233 
235  void init();
236 
238  void addCallPort(
239  InputLogPort* callPort
240  );
241 
243  void invoke(
244  FwEventIdType id,
245  Fw::Time& timeTag,
246  const Fw::LogSeverity& severity,
247  Fw::LogBuffer& args
248  ) const;
249 
250  private:
251 
252  // ----------------------------------------------------------------------
253  // Private member variables for OutputLogPort
254  // ----------------------------------------------------------------------
255 
257  InputLogPort* m_port;
258 
259  };
260 
261 #endif
262 
263 }
264 
265 #endif
Fw::LogSeverity m_severity
Definition: LogPortAc.hpp:125
PlatformSizeType FwSizeType
The size of the serial representation.
U8 * getBuffAddr() override
Definition: LogPortAc.hpp:58
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
The port callback function type.
Definition: LogPortAc.hpp:145
SerializeStatus
forward declaration for string
static Fw::SerializeStatus serializePortArgs(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args, Fw::SerialBufferBase &_buffer)
Serialize port arguments into a buffer.
Definition: LogPortAc.cpp:54
FwIdType FwEventIdType
The type of an event identifier.
void init()
Initialization function.
Definition: LogPortAc.cpp:97
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Invoke a port interface.
Definition: LogPortAc.cpp:117
static constexpr FwSizeType CAPACITY
Definition: LogPortAc.hpp:38
FwSizeType SizeType
Enum representing event severity.
void init()
Initialization function.
Definition: LogPortAc.cpp:180
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: LogPortAc.cpp:103
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
const U8 * getBuffAddr() const override
Definition: LogPortAc.hpp:64
InputLogPort()
Constructor.
Definition: LogPortAc.cpp:85
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port connection.
Definition: LogPortAc.cpp:199
FwEventIdType m_id
Definition: LogPortAc.hpp:123
OutputLogPort()
Constructor.
Definition: LogPortAc.cpp:168
Fw::SerializeStatus deserializePortArgs(Fw::SerialBufferBase &_buffer)
Deserialze port arguments into members.
Definition: LogPortAc.cpp:31
PlatformIndexType FwIndexType
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:186
Fw::Serializable::SizeType getCapacity() const override
Definition: LogPortAc.hpp:52
Implementation of malloc based allocator.
Fw::LogBuffer m_args
Definition: LogPortAc.hpp:126
LogPortSerializer()
Constructor.
Definition: LogPortAc.cpp:17