F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
PolyPortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title PolyPortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for Poly port
5 // ======================================================================
6 
7 #ifndef Svc_PolyPortAc_HPP
8 #define Svc_PolyPortAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
11 #include "Fw/Time/Time.hpp"
12 #include "Fw/Types/PolyType.hpp"
16 #if !FW_DIRECT_PORT_CALLS
20 #endif
21 
22 namespace Svc {
23 
28  {
29 
30  public:
31 
32  // ----------------------------------------------------------------------
33  // Public constants for PolyPortBuffer
34  // ----------------------------------------------------------------------
35 
38  static constexpr FwSizeType CAPACITY =
43 
44  public:
45 
46  // ----------------------------------------------------------------------
47  // Public member functions for PolyPortBuffer
48  // ----------------------------------------------------------------------
49 
53  return CAPACITY;
54  }
55 
58  U8* getBuffAddr() override {
59  return m_buff;
60  }
61 
64  const U8* getBuffAddr() const override {
65  return m_buff;
66  }
67 
68  private:
69 
70  // ----------------------------------------------------------------------
71  // Private member variables
72  // ----------------------------------------------------------------------
73 
74  U8 m_buff[CAPACITY];
75 
76  };
77 
81 
82  public:
83 
84  // ----------------------------------------------------------------------
85  // Public constructors for PolyPortSerializer
86  // ----------------------------------------------------------------------
87 
90 
91  public:
92 
93  // ----------------------------------------------------------------------
94  // Public member functions for PolyPortSerializer
95  // ----------------------------------------------------------------------
96 
99  Fw::SerialBufferBase& _buffer
100  );
101 
102  public:
103 
104  // ----------------------------------------------------------------------
105  // Public static functions for PolyPortSerializer
106  // ----------------------------------------------------------------------
107 
110  const Svc::PolyDbCfg::PolyDbEntry& entry,
111  Svc::MeasurementStatus& status,
112  Fw::Time& time,
113  Fw::PolyType& val,
114  Fw::SerialBufferBase& _buffer
115  );
116 
117  public:
118 
119  // ----------------------------------------------------------------------
120  // Public member variables for PolyPortSerializer
121  // ----------------------------------------------------------------------
122 
127 
128  };
129 
130 #if !FW_DIRECT_PORT_CALLS
131 
135  public Fw::InputPortBase
136  {
137 
138  public:
139 
140  // ----------------------------------------------------------------------
141  // Public types for InputPolyPort
142  // ----------------------------------------------------------------------
143 
145  typedef void (*CompFuncPtr)(
146  Fw::PassiveComponentBase* callComp,
147  FwIndexType portNum,
148  const Svc::PolyDbCfg::PolyDbEntry& entry,
149  Svc::MeasurementStatus& status,
150  Fw::Time& time,
151  Fw::PolyType& val
152  );
153 
154  public:
155 
156  // ----------------------------------------------------------------------
157  // Public constructors for InputPolyPort
158  // ----------------------------------------------------------------------
159 
161  InputPolyPort();
162 
163  public:
164 
165  // ----------------------------------------------------------------------
166  // Public member functions for InputPolyPort
167  // ----------------------------------------------------------------------
168 
170  void init();
171 
173  void addCallComp(
174  Fw::PassiveComponentBase* callComp,
175  CompFuncPtr funcPtr
176  );
177 
179  void invoke(
180  const Svc::PolyDbCfg::PolyDbEntry& entry,
181  Svc::MeasurementStatus& status,
182  Fw::Time& time,
183  Fw::PolyType& val
184  );
185 
186  private:
187 
188  // ----------------------------------------------------------------------
189  // Private member functions for InputPolyPort
190  // ----------------------------------------------------------------------
191 
192 #if FW_PORT_SERIALIZATION == 1
193 
196  Fw::SerializeStatus invokeSerial(
197  Fw::LinearBufferBase& _buffer
198  );
199 
200 #endif
201 
202  private:
203 
204  // ----------------------------------------------------------------------
205  // Private member variables for InputPolyPort
206  // ----------------------------------------------------------------------
207 
209  CompFuncPtr m_func;
210 
211  };
212 
216  public Fw::OutputPortBase
217  {
218 
219  public:
220 
221  // ----------------------------------------------------------------------
222  // Public constructors for OutputPolyPort
223  // ----------------------------------------------------------------------
224 
226  OutputPolyPort();
227 
228  public:
229 
230  // ----------------------------------------------------------------------
231  // Public member functions for OutputPolyPort
232  // ----------------------------------------------------------------------
233 
235  void init();
236 
238  void addCallPort(
239  InputPolyPort* callPort
240  );
241 
243  void invoke(
244  const Svc::PolyDbCfg::PolyDbEntry& entry,
245  Svc::MeasurementStatus& status,
246  Fw::Time& time,
247  Fw::PolyType& val
248  ) const;
249 
250  private:
251 
252  // ----------------------------------------------------------------------
253  // Private member variables for OutputPolyPort
254  // ----------------------------------------------------------------------
255 
257  InputPolyPort* m_port;
258 
259  };
260 
261 #endif
262 
263 }
264 
265 #endif
PolyPortSerializer()
Constructor.
Definition: PolyPortAc.cpp:17
const U8 * getBuffAddr() const override
Definition: PolyPortAc.hpp:64
PlatformSizeType FwSizeType
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, const Svc::PolyDbCfg::PolyDbEntry &entry, Svc::MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val)
The port callback function type.
Definition: PolyPortAc.hpp:145
stored serialized size
Definition: PolyType.hpp:160
InputPolyPort()
Constructor.
Definition: PolyPortAc.cpp:85
void addCallPort(InputPolyPort *callPort)
Register an input port.
Definition: PolyPortAc.cpp:186
void invoke(const Svc::PolyDbCfg::PolyDbEntry &entry, Svc::MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val) const
Invoke a port connection.
Definition: PolyPortAc.cpp:199
Fw::SerializeStatus deserializePortArgs(Fw::SerialBufferBase &_buffer)
Deserialze port arguments into members.
Definition: PolyPortAc.cpp:31
U8 * getBuffAddr() override
Definition: PolyPortAc.hpp:58
The size of the serial representation.
SerializeStatus
forward declaration for string
void invoke(const Svc::PolyDbCfg::PolyDbEntry &entry, Svc::MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val)
Invoke a port interface.
Definition: PolyPortAc.cpp:117
static constexpr FwSizeType CAPACITY
Definition: PolyPortAc.hpp:38
An enumeration for measurement status.
OutputPolyPort()
Constructor.
Definition: PolyPortAc.cpp:168
FwSizeType SizeType
static Fw::SerializeStatus serializePortArgs(const Svc::PolyDbCfg::PolyDbEntry &entry, Svc::MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val, Fw::SerialBufferBase &_buffer)
Serialize port arguments into a buffer.
Definition: PolyPortAc.cpp:54
Svc::PolyDbCfg::PolyDbEntry m_entry
Definition: PolyPortAc.hpp:123
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
void init()
Initialization function.
Definition: PolyPortAc.cpp:97
Fw::Serializable::SizeType getCapacity() const override
Definition: PolyPortAc.hpp:52
PlatformIndexType FwIndexType
The size of the serial representation.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PolyPortAc.cpp:103
void init()
Initialization function.
Definition: PolyPortAc.cpp:180
RateGroupDivider component implementation.
Svc::MeasurementStatus m_status
Definition: PolyPortAc.hpp:124