F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
ByteStreamRecvPortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title ByteStreamRecvPortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for ByteStreamRecv port
5 // ======================================================================
6 
7 #ifndef Drv_ByteStreamRecvPortAc_HPP
8 #define Drv_ByteStreamRecvPortAc_HPP
9 
10 #include <cstdio>
11 #include <cstring>
12 
14 #include "FpConfig.hpp"
15 #include "Fw/Buffer/Buffer.hpp"
20 #include "Fw/Types/StringType.hpp"
21 
22 namespace Drv {
23 
27  public Fw::InputPortBase
28  {
29 
30  public:
31 
32  // ----------------------------------------------------------------------
33  // Constants
34  // ----------------------------------------------------------------------
35 
36  enum {
41  };
42 
43  public:
44 
45  // ----------------------------------------------------------------------
46  // Types
47  // ----------------------------------------------------------------------
48 
50  typedef void (*CompFuncPtr)(
51  Fw::PassiveComponentBase* callComp,
52  NATIVE_INT_TYPE portNum,
53  Fw::Buffer& recvBuffer,
54  const Drv::RecvStatus& recvStatus
55  );
56 
57  public:
58 
59  // ----------------------------------------------------------------------
60  // Input Port Member functions
61  // ----------------------------------------------------------------------
62 
65 
67  void init();
68 
70  void addCallComp(
71  Fw::PassiveComponentBase* callComp,
72  CompFuncPtr funcPtr
73  );
74 
76  void invoke(
77  Fw::Buffer& recvBuffer,
78  const Drv::RecvStatus& recvStatus
79  );
80 
81  private:
82 
83 #if FW_PORT_SERIALIZATION == 1
84 
86  Fw::SerializeStatus invokeSerial(Fw::SerializeBufferBase& _buffer);
87 
88 #endif
89 
90  private:
91 
92  // ----------------------------------------------------------------------
93  // Member variables
94  // ----------------------------------------------------------------------
95 
97  CompFuncPtr m_func;
98 
99  };
100 
104  public Fw::OutputPortBase
105  {
106 
107  public:
108 
109  // ----------------------------------------------------------------------
110  // Output Port Member functions
111  // ----------------------------------------------------------------------
112 
115 
117  void init();
118 
120  void addCallPort(
121  InputByteStreamRecvPort* callPort
122  );
123 
125  void invoke(
126  Fw::Buffer& recvBuffer,
127  const Drv::RecvStatus& recvStatus
128  );
129 
130  private:
131 
132  // ----------------------------------------------------------------------
133  // Member variables
134  // ----------------------------------------------------------------------
135 
137  InputByteStreamRecvPort* m_port;
138 
139  };
140 
141 }
142 
143 #endif
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:51
C++-compatible configuration header for fprime configuration.
Declares ISF string base class.
void invoke(Fw::Buffer &recvBuffer, const Drv::RecvStatus &recvStatus)
Invoke a port interface.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, NATIVE_INT_TYPE portNum, Fw::Buffer &recvBuffer, const Drv::RecvStatus &recvStatus)
The port callback function type.
void init()
Initialization function.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
void init()
Initialization function.
void addCallPort(InputByteStreamRecvPort *callPort)
Register an input port.
void invoke(Fw::Buffer &recvBuffer, const Drv::RecvStatus &recvStatus)
Invoke a port interface.
Status associated with the received data.
@ SERIALIZED_SIZE
The size of the serial representation.
@ SERIALIZED_SIZE
Size of Fw::Buffer when serialized.
Definition: Buffer.hpp:48
SerializeStatus
forward declaration for string