F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
ComSplitterComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title ComSplitterComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for ComSplitter component base class
5 // ======================================================================
6 
7 #ifndef Svc_ComSplitterComponentAc_HPP
8 #define Svc_ComSplitterComponentAc_HPP
9 
10 #include "Fw/Com/ComPortAc.hpp"
12 #include "Fw/FPrimeBasicTypes.hpp"
13 #if !FW_DIRECT_PORT_CALLS
15 #endif
16 #if !FW_DIRECT_PORT_CALLS
18 #endif
19 
20 namespace Svc {
21 
28  {
29 
30  // ----------------------------------------------------------------------
31  // Friend classes
32  // ----------------------------------------------------------------------
33 
35  friend class ComSplitterTesterBase;
37  friend class ComSplitterTester;
38 
39  protected:
40 
41  // ----------------------------------------------------------------------
42  // Constants
43  // ----------------------------------------------------------------------
44 
46  enum {
48  };
49 
51  enum {
53  };
54 
55  public:
56 
57  // ----------------------------------------------------------------------
58  // Component initialization
59  // ----------------------------------------------------------------------
60 
62  void init(
63  FwEnumStoreType instance = 0
64  );
65 
66 #if !FW_DIRECT_PORT_CALLS
67 
68  public:
69 
70  // ----------------------------------------------------------------------
71  // Getters for typed input ports
72  // ----------------------------------------------------------------------
73 
78  FwIndexType portNum
79  );
80 
81 #endif
82 
83 #if !FW_DIRECT_PORT_CALLS
84 
85  public:
86 
87  // ----------------------------------------------------------------------
88  // Connect typed input ports to typed output ports
89  // ----------------------------------------------------------------------
90 
93  FwIndexType portNum,
94  Fw::InputComPort* port
95  );
96 
97 #endif
98 
99 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
100 
101  public:
102 
103  // ----------------------------------------------------------------------
104  // Connect serial input ports to typed output ports
105  // ----------------------------------------------------------------------
106 
109  FwIndexType portNum,
110  Fw::InputSerializePort* port
111  );
112 
113 #endif
114 
115  protected:
116 
117  // ----------------------------------------------------------------------
118  // Component construction and destruction
119  // ----------------------------------------------------------------------
120 
123  const char* compName = ""
124  );
125 
127  virtual ~ComSplitterComponentBase();
128 
129  protected:
130 
131  // ----------------------------------------------------------------------
132  // Getters for numbers of typed input ports
133  // ----------------------------------------------------------------------
134 
139  return NUM_COMIN_INPUT_PORTS;
140  }
141 
142  protected:
143 
144  // ----------------------------------------------------------------------
145  // Getters for numbers of typed output ports
146  // ----------------------------------------------------------------------
147 
153  }
154 
155  protected:
156 
157  // ----------------------------------------------------------------------
158  // Connection status queries for typed output ports
159  // ----------------------------------------------------------------------
160 
165  FwIndexType portNum
166  ) const;
167 
168  protected:
169 
170  // ----------------------------------------------------------------------
171  // Handlers to implement for typed input ports
172  // ----------------------------------------------------------------------
173 
175  virtual void comIn_handler(
176  FwIndexType portNum,
177  Fw::ComBuffer& data,
178  U32 context
179  ) = 0;
180 
181 #if FW_DIRECT_PORT_CALLS
182  public:
183 #else
184  protected:
185 #endif
186 
187  // ----------------------------------------------------------------------
188  // Port handler base-class functions for typed input ports
189  //
190  // Call these functions directly to bypass the corresponding ports
191  // ----------------------------------------------------------------------
192 
194  void comIn_handlerBase(
195  FwIndexType portNum,
196  Fw::ComBuffer& data,
197  U32 context
198  );
199 
200  protected:
201 
202  // ----------------------------------------------------------------------
203  // Invocation functions for typed output ports
204  // ----------------------------------------------------------------------
205 
207  void comOut_out(
208  FwIndexType portNum,
209  Fw::ComBuffer& data,
210  U32 context
211  ) const;
212 
213  private:
214 
215  // ----------------------------------------------------------------------
216  // Calls for messages received on typed input ports
217  // ----------------------------------------------------------------------
218 
220  static void m_p_comIn_in(
221  Fw::PassiveComponentBase* callComp,
222  FwIndexType portNum,
223  Fw::ComBuffer& data,
224  U32 context
225  );
226 
227 #if !FW_DIRECT_PORT_CALLS
228 
229  private:
230 
231  // ----------------------------------------------------------------------
232  // Typed input ports
233  // ----------------------------------------------------------------------
234 
236  Fw::InputComPort m_comIn_InputPort[NUM_COMIN_INPUT_PORTS];
237 
238 #endif
239 
240 #if !FW_DIRECT_PORT_CALLS
241 
242  private:
243 
244  // ----------------------------------------------------------------------
245  // Typed output ports
246  // ----------------------------------------------------------------------
247 
249  Fw::OutputComPort m_comOut_OutputPort[NUM_COMOUT_OUTPUT_PORTS];
250 
251 #endif
252 
253  };
254 
255 }
256 
257 #endif
void comOut_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context) const
Invoke output port comOut.
Fw::InputComPort * get_comIn_InputPort(FwIndexType portNum)
I32 FwEnumStoreType
virtual ~ComSplitterComponentBase()
Destroy ComSplitterComponentBase object.
void init()
Object initializer.
Definition: ObjBase.cpp:24
void comIn_handlerBase(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Handler base-class function for input port comIn.
bool isConnected_comOut_OutputPort(FwIndexType portNum) const
friend class ComSplitterTesterBase
Friend class tester to support autocoded test harness.
Auto-generated base for ComSplitter component.
PlatformIndexType FwIndexType
friend class ComSplitterTester
Friend class tester implementation to support white-box testing.
RateGroupDivider component implementation.
static constexpr FwIndexType getNum_comOut_OutputPorts()
static constexpr FwIndexType getNum_comIn_InputPorts()
void set_comOut_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to comOut[portNum].
virtual void comIn_handler(FwIndexType portNum, Fw::ComBuffer &data, U32 context)=0
Handler for input port comIn.
ComSplitterComponentBase(const char *compName="")
Construct ComSplitterComponentBase object.