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 
52 
53  }
54 
55  private:
56 
57  // ----------------------------------------------------------------------
58  // Private member variables
59  // ----------------------------------------------------------------------
60 
61  U8 m_buff[CAPACITY];
62 
63  };
64 
68 
69  public:
70 
71  // ----------------------------------------------------------------------
72  // Public constructors for LogPortSerializer
73  // ----------------------------------------------------------------------
74 
77 
78  public:
79 
80  // ----------------------------------------------------------------------
81  // Public member functions for LogPortSerializer
82  // ----------------------------------------------------------------------
83 
86  Fw::SerialBufferBase& _buffer
87  );
88 
89  public:
90 
91  // ----------------------------------------------------------------------
92  // Public static functions for LogPortSerializer
93  // ----------------------------------------------------------------------
94 
97  FwEventIdType id,
98  Fw::Time& timeTag,
99  const Fw::LogSeverity& severity,
100  Fw::LogBuffer& args,
101  Fw::SerialBufferBase& _buffer
102  );
103 
104  public:
105 
106  // ----------------------------------------------------------------------
107  // Public member variables for LogPortSerializer
108  // ----------------------------------------------------------------------
109 
114 
115  };
116 
117 #if !FW_DIRECT_PORT_CALLS
118 
121  class InputLogPort :
122  public Fw::InputPortBase
123  {
124 
125  public:
126 
127  // ----------------------------------------------------------------------
128  // Public types for InputLogPort
129  // ----------------------------------------------------------------------
130 
132  typedef void (*CompFuncPtr)(
133  Fw::PassiveComponentBase* callComp,
134  FwIndexType portNum,
135  FwEventIdType id,
136  Fw::Time& timeTag,
137  const Fw::LogSeverity& severity,
138  Fw::LogBuffer& args
139  );
140 
141  public:
142 
143  // ----------------------------------------------------------------------
144  // Public constructors for InputLogPort
145  // ----------------------------------------------------------------------
146 
148  InputLogPort();
149 
150  public:
151 
152  // ----------------------------------------------------------------------
153  // Public member functions for InputLogPort
154  // ----------------------------------------------------------------------
155 
157  void init();
158 
160  void addCallComp(
161  Fw::PassiveComponentBase* callComp,
162  CompFuncPtr funcPtr
163  );
164 
166  void invoke(
167  FwEventIdType id,
168  Fw::Time& timeTag,
169  const Fw::LogSeverity& severity,
170  Fw::LogBuffer& args
171  );
172 
173  private:
174 
175  // ----------------------------------------------------------------------
176  // Private member functions for InputLogPort
177  // ----------------------------------------------------------------------
178 
179 #if FW_PORT_SERIALIZATION == 1
180 
183  Fw::SerializeStatus invokeSerial(
184  Fw::LinearBufferBase& _buffer
185  );
186 
187 #endif
188 
189  private:
190 
191  // ----------------------------------------------------------------------
192  // Private member variables for InputLogPort
193  // ----------------------------------------------------------------------
194 
196  CompFuncPtr m_func;
197 
198  };
199 
203  public Fw::OutputPortBase
204  {
205 
206  public:
207 
208  // ----------------------------------------------------------------------
209  // Public constructors for OutputLogPort
210  // ----------------------------------------------------------------------
211 
213  OutputLogPort();
214 
215  public:
216 
217  // ----------------------------------------------------------------------
218  // Public member functions for OutputLogPort
219  // ----------------------------------------------------------------------
220 
222  void init();
223 
225  void addCallPort(
226  InputLogPort* callPort
227  );
228 
230  void invoke(
231  FwEventIdType id,
232  Fw::Time& timeTag,
233  const Fw::LogSeverity& severity,
234  Fw::LogBuffer& args
235  ) const;
236 
237  private:
238 
239  // ----------------------------------------------------------------------
240  // Private member variables for OutputLogPort
241  // ----------------------------------------------------------------------
242 
244  InputLogPort* m_port;
245 
246  };
247 
248 #endif
249 
250 }
251 
252 #endif
The size of the serial representation.
Fw::LogSeverity m_severity
Definition: LogPortAc.hpp:112
PlatformSizeType FwSizeType
LogPortBuffer()
Constructor.
Definition: LogPortAc.hpp:51
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:132
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
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:54
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:110
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
Implementation of malloc based allocator.
Fw::LogBuffer m_args
Definition: LogPortAc.hpp:113
LogPortSerializer()
Constructor.
Definition: LogPortAc.cpp:17