F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
BufferRepeaterComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title BufferRepeaterComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for BufferRepeater component base class
5 // ======================================================================
6 
7 #ifndef Svc_BufferRepeaterComponentAc_HPP
8 #define Svc_BufferRepeaterComponentAc_HPP
9 
10 #include <atomic>
11 
15 #include "Fw/FPrimeBasicTypes.hpp"
16 #include "Fw/Log/LogPortAc.hpp"
17 #include "Fw/Log/LogString.hpp"
18 #if FW_ENABLE_TEXT_LOGGING == 1
19 #include "Fw/Log/LogTextPortAc.hpp"
20 #endif
23 #include "Fw/Time/TimePortAc.hpp"
25 
26 namespace Svc {
27 
34  {
35 
36  // ----------------------------------------------------------------------
37  // Friend classes
38  // ----------------------------------------------------------------------
39 
43  friend class BufferRepeaterTester;
44 
45  PROTECTED:
46 
47  // ----------------------------------------------------------------------
48  // Constants
49  // ----------------------------------------------------------------------
50 
52  enum {
54  };
55 
57  enum {
61  };
62 
64  enum {
68  };
69 
71  enum {
74  };
75 
76  public:
77 
78  // ----------------------------------------------------------------------
79  // Component initialization
80  // ----------------------------------------------------------------------
81 
83  void init(
84  FwEnumStoreType instance = 0
85  );
86 
87  public:
88 
89  // ----------------------------------------------------------------------
90  // Getters for typed input ports
91  // ----------------------------------------------------------------------
92 
97  FwIndexType portNum
98  );
99 
100  public:
101 
102  // ----------------------------------------------------------------------
103  // Connect input ports to special output ports
104  // ----------------------------------------------------------------------
105 
107  void set_Log_OutputPort(
108  FwIndexType portNum,
109  Fw::InputLogPort* port
110  );
111 
112 #if FW_ENABLE_TEXT_LOGGING == 1
113 
115  void set_LogText_OutputPort(
116  FwIndexType portNum,
117  Fw::InputLogTextPort* port
118  );
119 
120 #endif
121 
123  void set_Time_OutputPort(
124  FwIndexType portNum,
125  Fw::InputTimePort* port
126  );
127 
128  public:
129 
130  // ----------------------------------------------------------------------
131  // Connect typed input ports to typed output ports
132  // ----------------------------------------------------------------------
133 
136  FwIndexType portNum,
138  );
139 
142  FwIndexType portNum,
144  );
145 
148  FwIndexType portNum,
150  );
151 
152 #if FW_PORT_SERIALIZATION
153 
154  public:
155 
156  // ----------------------------------------------------------------------
157  // Connect serial input ports to special output ports
158  // ----------------------------------------------------------------------
159 
161  void set_Log_OutputPort(
162  FwIndexType portNum,
163  Fw::InputSerializePort* port
164  );
165 
166 #if FW_ENABLE_TEXT_LOGGING == 1
167 
169  void set_LogText_OutputPort(
170  FwIndexType portNum,
171  Fw::InputSerializePort* port
172  );
173 
174 #endif
175 
177  void set_Time_OutputPort(
178  FwIndexType portNum,
179  Fw::InputSerializePort* port
180  );
181 
182 #endif
183 
184 #if FW_PORT_SERIALIZATION
185 
186  public:
187 
188  // ----------------------------------------------------------------------
189  // Connect serial input ports to typed output ports
190  // ----------------------------------------------------------------------
191 
194  FwIndexType portNum,
195  Fw::InputSerializePort* port
196  );
197 
200  FwIndexType portNum,
201  Fw::InputSerializePort* port
202  );
203 
204 #endif
205 
206  PROTECTED:
207 
208  // ----------------------------------------------------------------------
209  // Component construction and destruction
210  // ----------------------------------------------------------------------
211 
214  const char* compName = ""
215  );
216 
219 
220  PROTECTED:
221 
222  // ----------------------------------------------------------------------
223  // Getters for numbers of typed input ports
224  // ----------------------------------------------------------------------
225 
230 
231  PROTECTED:
232 
233  // ----------------------------------------------------------------------
234  // Getters for numbers of special output ports
235  // ----------------------------------------------------------------------
236 
241 
242 #if FW_ENABLE_TEXT_LOGGING == 1
243 
247  FwIndexType getNum_LogText_OutputPorts() const;
248 
249 #endif
250 
255 
256  PROTECTED:
257 
258  // ----------------------------------------------------------------------
259  // Getters for numbers of typed output ports
260  // ----------------------------------------------------------------------
261 
266 
271 
276 
277  PROTECTED:
278 
279  // ----------------------------------------------------------------------
280  // Connection status queries for special output ports
281  // ----------------------------------------------------------------------
282 
287  FwIndexType portNum
288  );
289 
290 #if FW_ENABLE_TEXT_LOGGING == 1
291 
295  bool isConnected_LogText_OutputPort(
296  FwIndexType portNum
297  );
298 
299 #endif
300 
305  FwIndexType portNum
306  );
307 
308  PROTECTED:
309 
310  // ----------------------------------------------------------------------
311  // Connection status queries for typed output ports
312  // ----------------------------------------------------------------------
313 
318  FwIndexType portNum
319  );
320 
325  FwIndexType portNum
326  );
327 
332  FwIndexType portNum
333  );
334 
335  PROTECTED:
336 
337  // ----------------------------------------------------------------------
338  // Handlers to implement for typed input ports
339  // ----------------------------------------------------------------------
340 
342  virtual void portIn_handler(
343  FwIndexType portNum,
344  Fw::Buffer& fwBuffer
345  ) = 0;
346 
347  PROTECTED:
348 
349  // ----------------------------------------------------------------------
350  // Port handler base-class functions for typed input ports
351  //
352  // Call these functions directly to bypass the corresponding ports
353  // ----------------------------------------------------------------------
354 
356  void portIn_handlerBase(
357  FwIndexType portNum,
358  Fw::Buffer& fwBuffer
359  );
360 
361  PROTECTED:
362 
363  // ----------------------------------------------------------------------
364  // Invocation functions for typed output ports
365  // ----------------------------------------------------------------------
366 
369  FwIndexType portNum,
370  FwSizeType size
371  );
372 
374  void deallocate_out(
375  FwIndexType portNum,
376  Fw::Buffer& fwBuffer
377  );
378 
380  void portOut_out(
381  FwIndexType portNum,
382  Fw::Buffer& fwBuffer
383  );
384 
385  PROTECTED:
386 
387  // ----------------------------------------------------------------------
388  // Event logging functions
389  // ----------------------------------------------------------------------
390 
395  I32 port,
396  FwSizeType size
397  ) const;
398 
403  I32 port,
404  FwSizeType size
405  ) const;
406 
407  PROTECTED:
408 
409  // ----------------------------------------------------------------------
410  // Time
411  // ----------------------------------------------------------------------
412 
416  Fw::Time getTime() const;
417 
418  PRIVATE:
419 
420  // ----------------------------------------------------------------------
421  // Calls for messages received on typed input ports
422  // ----------------------------------------------------------------------
423 
425  static void m_p_portIn_in(
426  Fw::PassiveComponentBase* callComp,
427  FwIndexType portNum,
428  Fw::Buffer& fwBuffer
429  );
430 
431  PRIVATE:
432 
433  // ----------------------------------------------------------------------
434  // Typed input ports
435  // ----------------------------------------------------------------------
436 
439 
440  PRIVATE:
441 
442  // ----------------------------------------------------------------------
443  // Special output ports
444  // ----------------------------------------------------------------------
445 
447  Fw::OutputLogPort m_Log_OutputPort[NUM_LOG_OUTPUT_PORTS];
448 
449 #if FW_ENABLE_TEXT_LOGGING == 1
450 
452  Fw::OutputLogTextPort m_LogText_OutputPort[NUM_LOGTEXT_OUTPUT_PORTS];
453 
454 #endif
455 
457  Fw::OutputTimePort m_Time_OutputPort[NUM_TIME_OUTPUT_PORTS];
458 
459  PRIVATE:
460 
461  // ----------------------------------------------------------------------
462  // Typed output ports
463  // ----------------------------------------------------------------------
464 
466  Fw::OutputBufferGetPort m_allocate_OutputPort[NUM_ALLOCATE_OUTPUT_PORTS];
467 
469  Fw::OutputBufferSendPort m_deallocate_OutputPort[NUM_DEALLOCATE_OUTPUT_PORTS];
470 
473 
474  };
475 
476 }
477 
478 #endif
Definition: Time.hpp:9
PlatformSizeType FwSizeType
I32 FwEnumStoreType
bool isConnected_deallocate_OutputPort(FwIndexType portNum)
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
void portOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port portOut.
void log_WARNING_HI_AllocationSoftFailure(I32 port, FwSizeType size) const
void init()
Object initializer.
Definition: ObjBase.cpp:26
bool isConnected_allocate_OutputPort(FwIndexType portNum)
friend class BufferRepeaterTester
Friend class tester implementation to support white-box testing.
BufferRepeaterComponentBase(const char *compName="")
Construct BufferRepeaterComponentBase object.
virtual void portIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port portIn.
void set_portOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to portOut[portNum].
bool isConnected_Time_OutputPort(FwIndexType portNum)
bool isConnected_Log_OutputPort(FwIndexType portNum)
Fw::InputBufferSendPort * get_portIn_InputPort(FwIndexType portNum)
virtual ~BufferRepeaterComponentBase()
Destroy BufferRepeaterComponentBase object.
friend class BufferRepeaterTesterBase
Friend class tester to support autocoded test harness.
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
void portIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port portIn.
bool isConnected_portOut_OutputPort(FwIndexType portNum)
void set_deallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to deallocate[portNum].
void log_FATAL_AllocationHardFailure(I32 port, FwSizeType size) const
PlatformIndexType FwIndexType
RateGroupDivider component implementation.
Auto-generated base for BufferRepeater component.
void set_allocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to allocate[portNum].
Fw::Buffer allocate_out(FwIndexType portNum, FwSizeType size)
Invoke output port allocate.
void deallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port deallocate.