F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
ComPortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title ComPortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for Com port
5 // ======================================================================
6 
7 #ifndef Fw_ComPortAc_HPP
8 #define Fw_ComPortAc_HPP
9 
10 #include <cstdio>
11 #include <cstring>
12 
13 #include "FpConfig.hpp"
14 #include "Fw/Com/ComBuffer.hpp"
19 #include "Fw/Types/StringType.hpp"
20 
21 namespace Fw {
22 
25  class InputComPort :
26  public Fw::InputPortBase
27  {
28 
29  public:
30 
31  // ----------------------------------------------------------------------
32  // Constants
33  // ----------------------------------------------------------------------
34 
35  enum {
39  sizeof(U32)
40  };
41 
42  public:
43 
44  // ----------------------------------------------------------------------
45  // Types
46  // ----------------------------------------------------------------------
47 
49  typedef void (*CompFuncPtr)(
50  Fw::PassiveComponentBase* callComp,
51  FwIndexType portNum,
52  Fw::ComBuffer& data,
53  U32 context
54  );
55 
56  public:
57 
58  // ----------------------------------------------------------------------
59  // Input Port Member functions
60  // ----------------------------------------------------------------------
61 
63  InputComPort();
64 
66  void init();
67 
69  void addCallComp(
70  Fw::PassiveComponentBase* callComp,
71  CompFuncPtr funcPtr
72  );
73 
75  void invoke(
76  Fw::ComBuffer& data,
77  U32 context
78  );
79 
80  private:
81 
82 #if FW_PORT_SERIALIZATION == 1
83 
85  Fw::SerializeStatus invokeSerial(Fw::SerializeBufferBase& _buffer);
86 
87 #endif
88 
89  private:
90 
91  // ----------------------------------------------------------------------
92  // Member variables
93  // ----------------------------------------------------------------------
94 
96  CompFuncPtr m_func;
97 
98  };
99 
103  public Fw::OutputPortBase
104  {
105 
106  public:
107 
108  // ----------------------------------------------------------------------
109  // Output Port Member functions
110  // ----------------------------------------------------------------------
111 
113  OutputComPort();
114 
116  void init();
117 
119  void addCallPort(
120  InputComPort* callPort
121  );
122 
124  void invoke(
125  Fw::ComBuffer& data,
126  U32 context
127  );
128 
129  private:
130 
131  // ----------------------------------------------------------------------
132  // Member variables
133  // ----------------------------------------------------------------------
134 
136  InputComPort* m_port;
137 
138  };
139 
140 }
141 
142 #endif
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
C++-compatible configuration header for fprime configuration.
void invoke(Fw::ComBuffer &data, U32 context)
Invoke a port interface.
Definition: ComPortAc.cpp:76
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, Fw::ComBuffer &data, U32 context)
The port callback function type.
Definition: ComPortAc.hpp:49
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
Definition: ComPortAc.hpp:37
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: ComPortAc.cpp:62
InputComPort()
Constructor.
Definition: ComPortAc.cpp:48
void init()
Initialization function.
Definition: ComPortAc.cpp:56
void addCallPort(InputComPort *callPort)
Register an input port.
Definition: ComPortAc.cpp:143
OutputComPort()
Constructor.
Definition: ComPortAc.cpp:129
void init()
Initialization function.
Definition: ComPortAc.cpp:137
void invoke(Fw::ComBuffer &data, U32 context)
Invoke a port interface.
Definition: ComPortAc.cpp:156
SerializeStatus
forward declaration for string