F´ Flight Software - C/C++ Documentation  devel
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 "FpConfig.hpp"
14 #include "Fw/Log/LogPortAc.hpp"
15 #include "Fw/Log/LogString.hpp"
16 #if FW_ENABLE_TEXT_LOGGING == 1
17 #include "Fw/Log/LogTextPortAc.hpp"
18 #endif
21 #include "Fw/Time/TimePortAc.hpp"
22 
23 namespace Svc {
24 
31  {
32 
33  // ----------------------------------------------------------------------
34  // Friend classes
35  // ----------------------------------------------------------------------
36 
39 
40  PROTECTED:
41 
42  // ----------------------------------------------------------------------
43  // Constants
44  // ----------------------------------------------------------------------
45 
47  enum {
49  };
50 
52  enum {
56  };
57 
59  enum {
63  };
64 
66  enum {
69  };
70 
71  public:
72 
73  // ----------------------------------------------------------------------
74  // Component initialization
75  // ----------------------------------------------------------------------
76 
78  void init(
79  FwEnumStoreType instance = 0
80  );
81 
82  public:
83 
84  // ----------------------------------------------------------------------
85  // Getters for typed input ports
86  // ----------------------------------------------------------------------
87 
92  FwIndexType portNum
93  );
94 
95  public:
96 
97  // ----------------------------------------------------------------------
98  // Connect input ports to special output ports
99  // ----------------------------------------------------------------------
100 
102  void set_Log_OutputPort(
103  FwIndexType portNum,
104  Fw::InputLogPort* port
105  );
106 
107 #if FW_ENABLE_TEXT_LOGGING == 1
108 
110  void set_LogText_OutputPort(
111  FwIndexType portNum,
112  Fw::InputLogTextPort* port
113  );
114 
115 #endif
116 
118  void set_Time_OutputPort(
119  FwIndexType portNum,
120  Fw::InputTimePort* port
121  );
122 
123  public:
124 
125  // ----------------------------------------------------------------------
126  // Connect typed input ports to typed output ports
127  // ----------------------------------------------------------------------
128 
131  FwIndexType portNum,
133  );
134 
137  FwIndexType portNum,
139  );
140 
143  FwIndexType portNum,
145  );
146 
147 #if FW_PORT_SERIALIZATION
148 
149  public:
150 
151  // ----------------------------------------------------------------------
152  // Connect serial input ports to special output ports
153  // ----------------------------------------------------------------------
154 
156  void set_Log_OutputPort(
157  FwIndexType portNum,
158  Fw::InputSerializePort* port
159  );
160 
161 #if FW_ENABLE_TEXT_LOGGING == 1
162 
164  void set_LogText_OutputPort(
165  FwIndexType portNum,
166  Fw::InputSerializePort* port
167  );
168 
169 #endif
170 
172  void set_Time_OutputPort(
173  FwIndexType portNum,
174  Fw::InputSerializePort* port
175  );
176 
177 #endif
178 
179 #if FW_PORT_SERIALIZATION
180 
181  public:
182 
183  // ----------------------------------------------------------------------
184  // Connect serial input ports to typed output ports
185  // ----------------------------------------------------------------------
186 
189  FwIndexType portNum,
190  Fw::InputSerializePort* port
191  );
192 
195  FwIndexType portNum,
196  Fw::InputSerializePort* port
197  );
198 
199 #endif
200 
201  PROTECTED:
202 
203  // ----------------------------------------------------------------------
204  // Component construction and destruction
205  // ----------------------------------------------------------------------
206 
209  const char* compName = ""
210  );
211 
214 
215  PROTECTED:
216 
217  // ----------------------------------------------------------------------
218  // Getters for numbers of typed input ports
219  // ----------------------------------------------------------------------
220 
225 
226  PROTECTED:
227 
228  // ----------------------------------------------------------------------
229  // Getters for numbers of special output ports
230  // ----------------------------------------------------------------------
231 
236 
237 #if FW_ENABLE_TEXT_LOGGING == 1
238 
242  FwIndexType getNum_LogText_OutputPorts() const;
243 
244 #endif
245 
250 
251  PROTECTED:
252 
253  // ----------------------------------------------------------------------
254  // Getters for numbers of typed output ports
255  // ----------------------------------------------------------------------
256 
261 
266 
271 
272  PROTECTED:
273 
274  // ----------------------------------------------------------------------
275  // Connection status queries for special output ports
276  // ----------------------------------------------------------------------
277 
282  FwIndexType portNum
283  );
284 
285 #if FW_ENABLE_TEXT_LOGGING == 1
286 
290  bool isConnected_LogText_OutputPort(
291  FwIndexType portNum
292  );
293 
294 #endif
295 
300  FwIndexType portNum
301  );
302 
303  PROTECTED:
304 
305  // ----------------------------------------------------------------------
306  // Connection status queries for typed output ports
307  // ----------------------------------------------------------------------
308 
313  FwIndexType portNum
314  );
315 
320  FwIndexType portNum
321  );
322 
327  FwIndexType portNum
328  );
329 
330  PROTECTED:
331 
332  // ----------------------------------------------------------------------
333  // Handlers to implement for typed input ports
334  // ----------------------------------------------------------------------
335 
337  virtual void portIn_handler(
338  FwIndexType portNum,
339  Fw::Buffer& fwBuffer
340  ) = 0;
341 
342  PROTECTED:
343 
344  // ----------------------------------------------------------------------
345  // Port handler base-class functions for typed input ports
346  //
347  // Call these functions directly to bypass the corresponding ports
348  // ----------------------------------------------------------------------
349 
351  void portIn_handlerBase(
352  FwIndexType portNum,
353  Fw::Buffer& fwBuffer
354  );
355 
356  PROTECTED:
357 
358  // ----------------------------------------------------------------------
359  // Invocation functions for typed output ports
360  // ----------------------------------------------------------------------
361 
364  FwIndexType portNum,
365  U32 size
366  );
367 
369  void deallocate_out(
370  FwIndexType portNum,
371  Fw::Buffer& fwBuffer
372  );
373 
375  void portOut_out(
376  FwIndexType portNum,
377  Fw::Buffer& fwBuffer
378  );
379 
380  PROTECTED:
381 
382  // ----------------------------------------------------------------------
383  // Event logging functions
384  // ----------------------------------------------------------------------
385 
390  I32 port,
391  U32 size
392  );
393 
398  I32 port,
399  U32 size
400  );
401 
402  PROTECTED:
403 
404  // ----------------------------------------------------------------------
405  // Time
406  // ----------------------------------------------------------------------
407 
411  Fw::Time getTime();
412 
413  PRIVATE:
414 
415  // ----------------------------------------------------------------------
416  // Calls for messages received on typed input ports
417  // ----------------------------------------------------------------------
418 
420  static void m_p_portIn_in(
421  Fw::PassiveComponentBase* callComp,
422  FwIndexType portNum,
423  Fw::Buffer& fwBuffer
424  );
425 
426  PRIVATE:
427 
428  // ----------------------------------------------------------------------
429  // Typed input ports
430  // ----------------------------------------------------------------------
431 
434 
435  PRIVATE:
436 
437  // ----------------------------------------------------------------------
438  // Special output ports
439  // ----------------------------------------------------------------------
440 
442  Fw::OutputLogPort m_Log_OutputPort[NUM_LOG_OUTPUT_PORTS];
443 
444 #if FW_ENABLE_TEXT_LOGGING == 1
445 
447  Fw::OutputLogTextPort m_LogText_OutputPort[NUM_LOGTEXT_OUTPUT_PORTS];
448 
449 #endif
450 
452  Fw::OutputTimePort m_Time_OutputPort[NUM_TIME_OUTPUT_PORTS];
453 
454  PRIVATE:
455 
456  // ----------------------------------------------------------------------
457  // Typed output ports
458  // ----------------------------------------------------------------------
459 
461  Fw::OutputBufferGetPort m_allocate_OutputPort[NUM_ALLOCATE_OUTPUT_PORTS];
462 
464  Fw::OutputBufferSendPort m_deallocate_OutputPort[NUM_DEALLOCATE_OUTPUT_PORTS];
465 
468 
469  };
470 
471 }
472 
473 #endif
I32 FwEnumStoreType
Definition: FpConfig.h:64
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
C++-compatible configuration header for fprime configuration.
void init()
Object initializer.
Definition: ObjBase.cpp:27
Definition: Time.hpp:9
Auto-generated base for BufferRepeater component.
void log_WARNING_HI_AllocationSoftFailure(I32 port, U32 size)
@ EVENTID_ALLOCATIONHARDFAILURE
Hard failure in allocation.
@ EVENTID_ALLOCATIONSOFTFAILURE
Soft failure in allocation.
bool isConnected_deallocate_OutputPort(FwIndexType portNum)
virtual ~BufferRepeaterComponentBase()
Destroy BufferRepeaterComponentBase object.
void set_deallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to deallocate[portNum].
bool isConnected_allocate_OutputPort(FwIndexType portNum)
BufferRepeaterComponentBase(const char *compName="")
Construct BufferRepeaterComponentBase object.
Fw::Buffer allocate_out(FwIndexType portNum, U32 size)
Invoke output port allocate.
bool isConnected_portOut_OutputPort(FwIndexType portNum)
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
void set_allocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to allocate[portNum].
Fw::InputBufferSendPort * get_portIn_InputPort(FwIndexType portNum)
void log_FATAL_AllocationHardFailure(I32 port, U32 size)
virtual void portIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port portIn.
bool isConnected_Log_OutputPort(FwIndexType portNum)
void deallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port deallocate.
void portOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port portOut.
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
void portIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port portIn.
bool isConnected_Time_OutputPort(FwIndexType portNum)
void set_portOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to portOut[portNum].
friend class BufferRepeaterComponentBaseFriend
Friend class for white-box testing.