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"
24 
25 namespace Svc {
26 
33  {
34 
35  // ----------------------------------------------------------------------
36  // Friend classes
37  // ----------------------------------------------------------------------
38 
43 
44  PROTECTED:
45 
46  // ----------------------------------------------------------------------
47  // Constants
48  // ----------------------------------------------------------------------
49 
51  enum {
53  };
54 
56  enum {
60  };
61 
63  enum {
67  };
68 
70  enum {
73  };
74 
75  public:
76 
77  // ----------------------------------------------------------------------
78  // Component initialization
79  // ----------------------------------------------------------------------
80 
82  void init(
83  FwEnumStoreType instance = 0
84  );
85 
86  public:
87 
88  // ----------------------------------------------------------------------
89  // Getters for typed input ports
90  // ----------------------------------------------------------------------
91 
96  FwIndexType portNum
97  );
98 
99  public:
100 
101  // ----------------------------------------------------------------------
102  // Connect input ports to special output ports
103  // ----------------------------------------------------------------------
104 
106  void set_Log_OutputPort(
107  FwIndexType portNum,
108  Fw::InputLogPort* port
109  );
110 
111 #if FW_ENABLE_TEXT_LOGGING == 1
112 
114  void set_LogText_OutputPort(
115  FwIndexType portNum,
116  Fw::InputLogTextPort* port
117  );
118 
119 #endif
120 
122  void set_Time_OutputPort(
123  FwIndexType portNum,
124  Fw::InputTimePort* port
125  );
126 
127  public:
128 
129  // ----------------------------------------------------------------------
130  // Connect typed input ports to typed output ports
131  // ----------------------------------------------------------------------
132 
135  FwIndexType portNum,
137  );
138 
141  FwIndexType portNum,
143  );
144 
147  FwIndexType portNum,
149  );
150 
151 #if FW_PORT_SERIALIZATION
152 
153  public:
154 
155  // ----------------------------------------------------------------------
156  // Connect serial input ports to special output ports
157  // ----------------------------------------------------------------------
158 
160  void set_Log_OutputPort(
161  FwIndexType portNum,
162  Fw::InputSerializePort* port
163  );
164 
165 #if FW_ENABLE_TEXT_LOGGING == 1
166 
168  void set_LogText_OutputPort(
169  FwIndexType portNum,
170  Fw::InputSerializePort* port
171  );
172 
173 #endif
174 
176  void set_Time_OutputPort(
177  FwIndexType portNum,
178  Fw::InputSerializePort* port
179  );
180 
181 #endif
182 
183 #if FW_PORT_SERIALIZATION
184 
185  public:
186 
187  // ----------------------------------------------------------------------
188  // Connect serial input ports to typed output ports
189  // ----------------------------------------------------------------------
190 
193  FwIndexType portNum,
194  Fw::InputSerializePort* port
195  );
196 
199  FwIndexType portNum,
200  Fw::InputSerializePort* port
201  );
202 
203 #endif
204 
205  PROTECTED:
206 
207  // ----------------------------------------------------------------------
208  // Component construction and destruction
209  // ----------------------------------------------------------------------
210 
213  const char* compName = ""
214  );
215 
218 
219  PROTECTED:
220 
221  // ----------------------------------------------------------------------
222  // Getters for numbers of typed input ports
223  // ----------------------------------------------------------------------
224 
229 
230  PROTECTED:
231 
232  // ----------------------------------------------------------------------
233  // Getters for numbers of special output ports
234  // ----------------------------------------------------------------------
235 
240 
241 #if FW_ENABLE_TEXT_LOGGING == 1
242 
246  FwIndexType getNum_LogText_OutputPorts() const;
247 
248 #endif
249 
254 
255  PROTECTED:
256 
257  // ----------------------------------------------------------------------
258  // Getters for numbers of typed output ports
259  // ----------------------------------------------------------------------
260 
265 
270 
275 
276  PROTECTED:
277 
278  // ----------------------------------------------------------------------
279  // Connection status queries for special output ports
280  // ----------------------------------------------------------------------
281 
286  FwIndexType portNum
287  );
288 
289 #if FW_ENABLE_TEXT_LOGGING == 1
290 
294  bool isConnected_LogText_OutputPort(
295  FwIndexType portNum
296  );
297 
298 #endif
299 
304  FwIndexType portNum
305  );
306 
307  PROTECTED:
308 
309  // ----------------------------------------------------------------------
310  // Connection status queries for typed output ports
311  // ----------------------------------------------------------------------
312 
317  FwIndexType portNum
318  );
319 
324  FwIndexType portNum
325  );
326 
331  FwIndexType portNum
332  );
333 
334  PROTECTED:
335 
336  // ----------------------------------------------------------------------
337  // Handlers to implement for typed input ports
338  // ----------------------------------------------------------------------
339 
341  virtual void portIn_handler(
342  FwIndexType portNum,
343  Fw::Buffer& fwBuffer
344  ) = 0;
345 
346  PROTECTED:
347 
348  // ----------------------------------------------------------------------
349  // Port handler base-class functions for typed input ports
350  //
351  // Call these functions directly to bypass the corresponding ports
352  // ----------------------------------------------------------------------
353 
355  void portIn_handlerBase(
356  FwIndexType portNum,
357  Fw::Buffer& fwBuffer
358  );
359 
360  PROTECTED:
361 
362  // ----------------------------------------------------------------------
363  // Invocation functions for typed output ports
364  // ----------------------------------------------------------------------
365 
368  FwIndexType portNum,
369  U32 size
370  );
371 
373  void deallocate_out(
374  FwIndexType portNum,
375  Fw::Buffer& fwBuffer
376  );
377 
379  void portOut_out(
380  FwIndexType portNum,
381  Fw::Buffer& fwBuffer
382  );
383 
384  PROTECTED:
385 
386  // ----------------------------------------------------------------------
387  // Event logging functions
388  // ----------------------------------------------------------------------
389 
394  I32 port,
395  U32 size
396  ) const;
397 
402  I32 port,
403  U32 size
404  ) const;
405 
406  PROTECTED:
407 
408  // ----------------------------------------------------------------------
409  // Time
410  // ----------------------------------------------------------------------
411 
415  Fw::Time getTime() const;
416 
417  PRIVATE:
418 
419  // ----------------------------------------------------------------------
420  // Calls for messages received on typed input ports
421  // ----------------------------------------------------------------------
422 
424  static void m_p_portIn_in(
425  Fw::PassiveComponentBase* callComp,
426  FwIndexType portNum,
427  Fw::Buffer& fwBuffer
428  );
429 
430  PRIVATE:
431 
432  // ----------------------------------------------------------------------
433  // Typed input ports
434  // ----------------------------------------------------------------------
435 
438 
439  PRIVATE:
440 
441  // ----------------------------------------------------------------------
442  // Special output ports
443  // ----------------------------------------------------------------------
444 
446  Fw::OutputLogPort m_Log_OutputPort[NUM_LOG_OUTPUT_PORTS];
447 
448 #if FW_ENABLE_TEXT_LOGGING == 1
449 
451  Fw::OutputLogTextPort m_LogText_OutputPort[NUM_LOGTEXT_OUTPUT_PORTS];
452 
453 #endif
454 
456  Fw::OutputTimePort m_Time_OutputPort[NUM_TIME_OUTPUT_PORTS];
457 
458  PRIVATE:
459 
460  // ----------------------------------------------------------------------
461  // Typed output ports
462  // ----------------------------------------------------------------------
463 
465  Fw::OutputBufferGetPort m_allocate_OutputPort[NUM_ALLOCATE_OUTPUT_PORTS];
466 
468  Fw::OutputBufferSendPort m_deallocate_OutputPort[NUM_DEALLOCATE_OUTPUT_PORTS];
469 
472 
473  };
474 
475 }
476 
477 #endif
Definition: Time.hpp:9
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 init()
Object initializer.
Definition: ObjBase.cpp:26
bool isConnected_allocate_OutputPort(FwIndexType portNum)
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)
friend class BufferRepeaterComponentBaseFriend
Friend class for white-box testing.
bool isConnected_Log_OutputPort(FwIndexType portNum)
Fw::Buffer allocate_out(FwIndexType portNum, U32 size)
Invoke output port allocate.
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].
PlatformIndexType FwIndexType
RateGroupDivider component implementation.
void log_FATAL_AllocationHardFailure(I32 port, U32 size) const
void log_WARNING_HI_AllocationSoftFailure(I32 port, U32 size) const
Auto-generated base for BufferRepeater component.
void set_allocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to allocate[portNum].
void deallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port deallocate.