F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
DpRequestPortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title DpRequestPortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for DpRequest port
5 // ======================================================================
6 
7 #ifndef Fw_DpRequestPortAc_HPP
8 #define Fw_DpRequestPortAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
14 #if !FW_DIRECT_PORT_CALLS
18 #endif
19 
20 namespace Fw {
21 
29  {
30 
31  public:
32 
33  // ----------------------------------------------------------------------
34  // Public constants for DpRequestPortBuffer
35  // ----------------------------------------------------------------------
36 
39  static constexpr FwSizeType CAPACITY =
40  sizeof(FwDpIdType) +
41  sizeof(FwSizeType);
42 
43  public:
44 
45  // ----------------------------------------------------------------------
46  // Public member functions for DpRequestPortBuffer
47  // ----------------------------------------------------------------------
48 
52  return CAPACITY;
53  }
54 
57  U8* getBuffAddr() override {
58  return m_buff;
59  }
60 
63  const U8* getBuffAddr() const override {
64  return m_buff;
65  }
66 
67  private:
68 
69  // ----------------------------------------------------------------------
70  // Private member variables
71  // ----------------------------------------------------------------------
72 
73  U8 m_buff[CAPACITY];
74 
75  };
76 
83 
84  public:
85 
86  // ----------------------------------------------------------------------
87  // Public constructors for DpRequestPortSerializer
88  // ----------------------------------------------------------------------
89 
92 
93  public:
94 
95  // ----------------------------------------------------------------------
96  // Public member functions for DpRequestPortSerializer
97  // ----------------------------------------------------------------------
98 
101  Fw::SerialBufferBase& _buffer
102  );
103 
104  public:
105 
106  // ----------------------------------------------------------------------
107  // Public static functions for DpRequestPortSerializer
108  // ----------------------------------------------------------------------
109 
112  FwDpIdType id,
113  FwSizeType dataSize,
114  Fw::SerialBufferBase& _buffer
115  );
116 
117  public:
118 
119  // ----------------------------------------------------------------------
120  // Public member variables for DpRequestPortSerializer
121  // ----------------------------------------------------------------------
122 
125 
126  };
127 
128 #if !FW_DIRECT_PORT_CALLS
129 
136  public Fw::InputPortBase
137  {
138 
139  public:
140 
141  // ----------------------------------------------------------------------
142  // Public types for InputDpRequestPort
143  // ----------------------------------------------------------------------
144 
146  typedef void (*CompFuncPtr)(
147  Fw::PassiveComponentBase* callComp,
148  FwIndexType portNum,
149  FwDpIdType id,
150  FwSizeType dataSize
151  );
152 
153  public:
154 
155  // ----------------------------------------------------------------------
156  // Public constructors for InputDpRequestPort
157  // ----------------------------------------------------------------------
158 
161 
162  public:
163 
164  // ----------------------------------------------------------------------
165  // Public member functions for InputDpRequestPort
166  // ----------------------------------------------------------------------
167 
169  void init();
170 
172  void addCallComp(
173  Fw::PassiveComponentBase* callComp,
174  CompFuncPtr funcPtr
175  );
176 
178  void invoke(
179  FwDpIdType id,
180  FwSizeType dataSize
181  );
182 
183  private:
184 
185  // ----------------------------------------------------------------------
186  // Private member functions for InputDpRequestPort
187  // ----------------------------------------------------------------------
188 
189 #if FW_PORT_SERIALIZATION == 1
190 
193  Fw::SerializeStatus invokeSerial(
194  Fw::LinearBufferBase& _buffer
195  );
196 
197 #endif
198 
199  private:
200 
201  // ----------------------------------------------------------------------
202  // Private member variables for InputDpRequestPort
203  // ----------------------------------------------------------------------
204 
206  CompFuncPtr m_func;
207 
208  };
209 
216  public Fw::OutputPortBase
217  {
218 
219  public:
220 
221  // ----------------------------------------------------------------------
222  // Public constructors for OutputDpRequestPort
223  // ----------------------------------------------------------------------
224 
227 
228  public:
229 
230  // ----------------------------------------------------------------------
231  // Public member functions for OutputDpRequestPort
232  // ----------------------------------------------------------------------
233 
235  void init();
236 
238  void addCallPort(
239  InputDpRequestPort* callPort
240  );
241 
243  void invoke(
244  FwDpIdType id,
245  FwSizeType dataSize
246  ) const;
247 
248  private:
249 
250  // ----------------------------------------------------------------------
251  // Private member variables for OutputDpRequestPort
252  // ----------------------------------------------------------------------
253 
255  InputDpRequestPort* m_port;
256 
257  };
258 
259 #endif
260 
261 }
262 
263 #endif
void invoke(FwDpIdType id, FwSizeType dataSize)
Invoke a port interface.
PlatformSizeType FwSizeType
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void init()
Initialization function.
void addCallPort(InputDpRequestPort *callPort)
Register an input port.
Fw::SerializeStatus deserializePortArgs(Fw::SerialBufferBase &_buffer)
Deserialze port arguments into members.
SerializeStatus
forward declaration for string
OutputDpRequestPort()
Constructor.
static Fw::SerializeStatus serializePortArgs(FwDpIdType id, FwSizeType dataSize, Fw::SerialBufferBase &_buffer)
Serialize port arguments into a buffer.
FwSizeType SizeType
InputDpRequestPort()
Constructor.
const U8 * getBuffAddr() const override
void invoke(FwDpIdType id, FwSizeType dataSize) const
Invoke a port connection.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
void init()
Initialization function.
FwIdType FwDpIdType
The type of a data product identifier.
DpRequestPortSerializer()
Constructor.
PlatformIndexType FwIndexType
Fw::Serializable::SizeType getCapacity() const override
Implementation of malloc based allocator.
static constexpr FwSizeType CAPACITY
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, FwDpIdType id, FwSizeType dataSize)
The port callback function type.
U8 * getBuffAddr() override