F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FileWritePortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FileWritePortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for FileWrite port
5 // ======================================================================
6 
7 #ifndef Svc_FileWritePortAc_HPP
8 #define Svc_FileWritePortAc_HPP
9 
10 #include "Fw/Buffer/Buffer.hpp"
11 #include "Fw/FPrimeBasicTypes.hpp"
16 #if !FW_DIRECT_PORT_CALLS
20 #endif
21 
22 namespace Svc {
23 
27  {
28 
29  public:
30 
31  // ----------------------------------------------------------------------
32  // Public constants for FileWritePortBuffer
33  // ----------------------------------------------------------------------
34 
37  static constexpr FwSizeType CAPACITY =
40  sizeof(FwSizeType) +
41  sizeof(U8);
42 
43  public:
44 
45  // ----------------------------------------------------------------------
46  // Public member functions for FileWritePortBuffer
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 
79 
80  public:
81 
82  // ----------------------------------------------------------------------
83  // Public constructors for FileWritePortSerializer
84  // ----------------------------------------------------------------------
85 
88 
89  public:
90 
91  // ----------------------------------------------------------------------
92  // Public member functions for FileWritePortSerializer
93  // ----------------------------------------------------------------------
94 
97  Fw::SerialBufferBase& _buffer
98  );
99 
100  public:
101 
102  // ----------------------------------------------------------------------
103  // Public static functions for FileWritePortSerializer
104  // ----------------------------------------------------------------------
105 
108  const Fw::StringBase& path,
109  Fw::Buffer& buffer,
110  FwSizeType offsetBytes,
111  bool append,
112  Fw::SerialBufferBase& _buffer
113  );
114 
115  private:
116 
117  // ----------------------------------------------------------------------
118  // Private member variables for FileWritePortSerializer
119  // ----------------------------------------------------------------------
120 
121  char m___fprime_ac_path_buffer[Fw::StringBase::BUFFER_SIZE(240)];
122 
123  public:
124 
125  // ----------------------------------------------------------------------
126  // Public member variables for FileWritePortSerializer
127  // ----------------------------------------------------------------------
128 
132  bool m_append;
133 
134  };
135 
136 #if !FW_DIRECT_PORT_CALLS
137 
140  public Fw::InputPortBase
141  {
142 
143  public:
144 
145  // ----------------------------------------------------------------------
146  // Public types for InputFileWritePort
147  // ----------------------------------------------------------------------
148 
150  typedef void (*CompFuncPtr)(
151  Fw::PassiveComponentBase* callComp,
152  FwIndexType portNum,
153  const Fw::StringBase& path,
154  Fw::Buffer& buffer,
155  FwSizeType offsetBytes,
156  bool append
157  );
158 
159  public:
160 
161  // ----------------------------------------------------------------------
162  // Public constructors for InputFileWritePort
163  // ----------------------------------------------------------------------
164 
167 
168  public:
169 
170  // ----------------------------------------------------------------------
171  // Public member functions for InputFileWritePort
172  // ----------------------------------------------------------------------
173 
175  void init();
176 
178  void addCallComp(
179  Fw::PassiveComponentBase* callComp,
180  CompFuncPtr funcPtr
181  );
182 
184  void invoke(
185  const Fw::StringBase& path,
186  Fw::Buffer& buffer,
187  FwSizeType offsetBytes,
188  bool append
189  );
190 
191  private:
192 
193  // ----------------------------------------------------------------------
194  // Private member functions for InputFileWritePort
195  // ----------------------------------------------------------------------
196 
197 #if FW_PORT_SERIALIZATION == 1
198 
201  Fw::SerializeStatus invokeSerial(
202  Fw::LinearBufferBase& _buffer
203  );
204 
205 #endif
206 
207  private:
208 
209  // ----------------------------------------------------------------------
210  // Private member variables for InputFileWritePort
211  // ----------------------------------------------------------------------
212 
214  CompFuncPtr m_func;
215 
216  };
217 
220  public Fw::OutputPortBase
221  {
222 
223  public:
224 
225  // ----------------------------------------------------------------------
226  // Public constructors for OutputFileWritePort
227  // ----------------------------------------------------------------------
228 
231 
232  public:
233 
234  // ----------------------------------------------------------------------
235  // Public member functions for OutputFileWritePort
236  // ----------------------------------------------------------------------
237 
239  void init();
240 
242  void addCallPort(
243  InputFileWritePort* callPort
244  );
245 
247  void invoke(
248  const Fw::StringBase& path,
249  Fw::Buffer& buffer,
250  FwSizeType offsetBytes,
251  bool append
252  ) const;
253 
254  private:
255 
256  // ----------------------------------------------------------------------
257  // Private member variables for OutputFileWritePort
258  // ----------------------------------------------------------------------
259 
261  InputFileWritePort* m_port;
262 
263  };
264 
265 #endif
266 
267 }
268 
269 #endif
OutputFileWritePort()
Constructor.
PlatformSizeType FwSizeType
const U8 * getBuffAddr() const override
void init()
Initialization function.
void invoke(const Fw::StringBase &path, Fw::Buffer &buffer, FwSizeType offsetBytes, bool append) const
Invoke a port connection.
static Fw::SerializeStatus serializePortArgs(const Fw::StringBase &path, Fw::Buffer &buffer, FwSizeType offsetBytes, bool append, Fw::SerialBufferBase &_buffer)
Serialize port arguments into a buffer.
Serializer for FileWrite port.
SerializeStatus
forward declaration for string
void addCallPort(InputFileWritePort *callPort)
Register an input port.
InputFileWritePort()
Constructor.
Serialization buffer for FileWrite port.
Fw::SerializeStatus deserializePortArgs(Fw::SerialBufferBase &_buffer)
Deserialze port arguments into members.
void invoke(const Fw::StringBase &path, Fw::Buffer &buffer, FwSizeType offsetBytes, bool append)
Invoke a port interface.
FwSizeType SizeType
Input FileWrite port.
A string backed by an external buffer.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, const Fw::StringBase &path, Fw::Buffer &buffer, FwSizeType offsetBytes, bool append)
The port callback function type.
Fw::Serializable::SizeType getCapacity() const override
FileWritePortSerializer()
Constructor.
static constexpr FwSizeType CAPACITY
PlatformIndexType FwIndexType
RateGroupDivider component implementation.
Output FileWrite port.
static constexpr SizeType STATIC_SERIALIZED_SIZE(SizeType maxLength)
static constexpr SizeType BUFFER_SIZE(SizeType maxLength)
Get the size of a null-terminated string buffer.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Size of Fw::Buffer when serialized.
Definition: Buffer.hpp:64
void init()
Initialization function.