F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
FramerComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FramerComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for Framer component base class
5 // ======================================================================
6 
7 #ifndef Svc_FramerComponentAc_HPP
8 #define Svc_FramerComponentAc_HPP
9 
11 #include "FpConfig.hpp"
14 #include "Fw/Com/ComPortAc.hpp"
19 #include "Os/Mutex.hpp"
20 
21 namespace Svc {
22 
29  {
30 
31  // ----------------------------------------------------------------------
32  // Friend classes
33  // ----------------------------------------------------------------------
34 
37 
38  PROTECTED:
39 
40  // ----------------------------------------------------------------------
41  // Constants
42  // ----------------------------------------------------------------------
43 
45  enum {
49  };
50 
52  enum {
57  };
58 
59  public:
60 
61  // ----------------------------------------------------------------------
62  // Component initialization
63  // ----------------------------------------------------------------------
64 
66  void init(
67  FwEnumStoreType instance = 0
68  );
69 
70  public:
71 
72  // ----------------------------------------------------------------------
73  // Getters for typed input ports
74  // ----------------------------------------------------------------------
75 
80  FwIndexType portNum
81  );
82 
87  FwIndexType portNum
88  );
89 
94  FwIndexType portNum
95  );
96 
97  public:
98 
99  // ----------------------------------------------------------------------
100  // Connect typed input ports to typed output ports
101  // ----------------------------------------------------------------------
102 
105  FwIndexType portNum,
107  );
108 
111  FwIndexType portNum,
113  );
114 
117  FwIndexType portNum,
119  );
120 
123  FwIndexType portNum,
125  );
126 
127 #if FW_PORT_SERIALIZATION
128 
129  public:
130 
131  // ----------------------------------------------------------------------
132  // Connect serial input ports to typed output ports
133  // ----------------------------------------------------------------------
134 
137  FwIndexType portNum,
138  Fw::InputSerializePort* port
139  );
140 
143  FwIndexType portNum,
144  Fw::InputSerializePort* port
145  );
146 
147 #endif
148 
149  PROTECTED:
150 
151  // ----------------------------------------------------------------------
152  // Component construction and destruction
153  // ----------------------------------------------------------------------
154 
157  const char* compName = ""
158  );
159 
161  virtual ~FramerComponentBase();
162 
163  PROTECTED:
164 
165  // ----------------------------------------------------------------------
166  // Getters for numbers of typed input ports
167  // ----------------------------------------------------------------------
168 
173 
178 
183 
184  PROTECTED:
185 
186  // ----------------------------------------------------------------------
187  // Getters for numbers of typed output ports
188  // ----------------------------------------------------------------------
189 
194 
199 
204 
209 
210  PROTECTED:
211 
212  // ----------------------------------------------------------------------
213  // Connection status queries for typed output ports
214  // ----------------------------------------------------------------------
215 
220  FwIndexType portNum
221  );
222 
227  FwIndexType portNum
228  );
229 
234  FwIndexType portNum
235  );
236 
241  FwIndexType portNum
242  );
243 
244  PROTECTED:
245 
246  // ----------------------------------------------------------------------
247  // Handlers to implement for typed input ports
248  // ----------------------------------------------------------------------
249 
251  virtual void bufferIn_handler(
252  FwIndexType portNum,
253  Fw::Buffer& fwBuffer
254  ) = 0;
255 
257  virtual void comIn_handler(
258  FwIndexType portNum,
259  Fw::ComBuffer& data,
260  U32 context
261  ) = 0;
262 
264  virtual void comStatusIn_handler(
265  FwIndexType portNum,
266  Fw::Success& condition
267  ) = 0;
268 
269  PROTECTED:
270 
271  // ----------------------------------------------------------------------
272  // Port handler base-class functions for typed input ports
273  //
274  // Call these functions directly to bypass the corresponding ports
275  // ----------------------------------------------------------------------
276 
279  FwIndexType portNum,
280  Fw::Buffer& fwBuffer
281  );
282 
284  void comIn_handlerBase(
285  FwIndexType portNum,
286  Fw::ComBuffer& data,
287  U32 context
288  );
289 
292  FwIndexType portNum,
293  Fw::Success& condition
294  );
295 
296  PROTECTED:
297 
298  // ----------------------------------------------------------------------
299  // Invocation functions for typed output ports
300  // ----------------------------------------------------------------------
301 
304  FwIndexType portNum,
305  Fw::Buffer& fwBuffer
306  );
307 
309  void comStatusOut_out(
310  FwIndexType portNum,
311  Fw::Success& condition
312  );
313 
316  FwIndexType portNum,
317  U32 size
318  );
319 
322  FwIndexType portNum,
323  Fw::Buffer& sendBuffer
324  );
325 
326  PROTECTED:
327 
328  // ----------------------------------------------------------------------
329  // Mutex operations for guarded ports
330  //
331  // You can override these operations to provide more sophisticated
332  // synchronization
333  // ----------------------------------------------------------------------
334 
336  virtual void lock();
337 
339  virtual void unLock();
340 
341  PRIVATE:
342 
343  // ----------------------------------------------------------------------
344  // Calls for messages received on typed input ports
345  // ----------------------------------------------------------------------
346 
348  static void m_p_bufferIn_in(
349  Fw::PassiveComponentBase* callComp,
350  FwIndexType portNum,
351  Fw::Buffer& fwBuffer
352  );
353 
355  static void m_p_comIn_in(
356  Fw::PassiveComponentBase* callComp,
357  FwIndexType portNum,
358  Fw::ComBuffer& data,
359  U32 context
360  );
361 
363  static void m_p_comStatusIn_in(
364  Fw::PassiveComponentBase* callComp,
365  FwIndexType portNum,
366  Fw::Success& condition
367  );
368 
369  PRIVATE:
370 
371  // ----------------------------------------------------------------------
372  // Typed input ports
373  // ----------------------------------------------------------------------
374 
377 
379  Fw::InputComPort m_comIn_InputPort[NUM_COMIN_INPUT_PORTS];
380 
383 
384  PRIVATE:
385 
386  // ----------------------------------------------------------------------
387  // Typed output ports
388  // ----------------------------------------------------------------------
389 
391  Fw::OutputBufferSendPort m_bufferDeallocate_OutputPort[NUM_BUFFERDEALLOCATE_OUTPUT_PORTS];
392 
395 
397  Fw::OutputBufferGetPort m_framedAllocate_OutputPort[NUM_FRAMEDALLOCATE_OUTPUT_PORTS];
398 
401 
402  PRIVATE:
403 
404  // ----------------------------------------------------------------------
405  // Mutexes
406  // ----------------------------------------------------------------------
407 
409  Os::Mutex m_guardedPortMutex;
410 
411  };
412 
413 }
414 
415 #endif
I32 FwEnumStoreType
Definition: FpConfig.h:64
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
C++-compatible configuration header for fprime configuration.
Status returned by the send call.
void init()
Object initializer.
Definition: ObjBase.cpp:27
Success/Failure.
Auto-generated base for Framer component.
bool isConnected_bufferDeallocate_OutputPort(FwIndexType portNum)
Fw::InputBufferSendPort * get_bufferIn_InputPort(FwIndexType portNum)
virtual void comStatusIn_handler(FwIndexType portNum, Fw::Success &condition)=0
Handler for input port comStatusIn.
void bufferIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port bufferIn.
virtual void unLock()
Unlock the guarded mutex.
FwIndexType getNum_framedOut_OutputPorts() const
virtual void comIn_handler(FwIndexType portNum, Fw::ComBuffer &data, U32 context)=0
Handler for input port comIn.
virtual ~FramerComponentBase()
Destroy FramerComponentBase object.
void comIn_handlerBase(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Handler base-class function for input port comIn.
void set_framedOut_OutputPort(FwIndexType portNum, Drv::InputByteStreamSendPort *port)
Connect port to framedOut[portNum].
void bufferDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port bufferDeallocate.
FwIndexType getNum_framedAllocate_OutputPorts() const
FwIndexType getNum_comStatusOut_OutputPorts() const
void comStatusOut_out(FwIndexType portNum, Fw::Success &condition)
Invoke output port comStatusOut.
Fw::InputSuccessConditionPort * get_comStatusIn_InputPort(FwIndexType portNum)
bool isConnected_framedOut_OutputPort(FwIndexType portNum)
Fw::InputComPort * get_comIn_InputPort(FwIndexType portNum)
void comStatusIn_handlerBase(FwIndexType portNum, Fw::Success &condition)
Handler base-class function for input port comStatusIn.
FwIndexType getNum_comStatusIn_InputPorts() const
FramerComponentBase(const char *compName="")
Construct FramerComponentBase object.
FwIndexType getNum_bufferIn_InputPorts() const
Drv::SendStatus framedOut_out(FwIndexType portNum, Fw::Buffer &sendBuffer)
Invoke output port framedOut.
FwIndexType getNum_comIn_InputPorts() const
void set_framedAllocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to framedAllocate[portNum].
Fw::Buffer framedAllocate_out(FwIndexType portNum, U32 size)
Invoke output port framedAllocate.
FwIndexType getNum_bufferDeallocate_OutputPorts() const
void set_bufferDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to bufferDeallocate[portNum].
friend class FramerComponentBaseFriend
Friend class for white-box testing.
virtual void bufferIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port bufferIn.
bool isConnected_comStatusOut_OutputPort(FwIndexType portNum)
bool isConnected_framedAllocate_OutputPort(FwIndexType portNum)
void set_comStatusOut_OutputPort(FwIndexType portNum, Fw::InputSuccessConditionPort *port)
Connect port to comStatusOut[portNum].
virtual void lock()
Lock the guarded mutex.