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 
51 
52  }
53 
54  private:
55 
56  // ----------------------------------------------------------------------
57  // Private member variables
58  // ----------------------------------------------------------------------
59 
60  U8 m_buff[CAPACITY];
61 
62  };
63 
66 
67  public:
68 
69  // ----------------------------------------------------------------------
70  // Public constructors for FileWritePortSerializer
71  // ----------------------------------------------------------------------
72 
75 
76  public:
77 
78  // ----------------------------------------------------------------------
79  // Public member functions for FileWritePortSerializer
80  // ----------------------------------------------------------------------
81 
84  Fw::SerialBufferBase& _buffer
85  );
86 
87  public:
88 
89  // ----------------------------------------------------------------------
90  // Public static functions for FileWritePortSerializer
91  // ----------------------------------------------------------------------
92 
95  const Fw::StringBase& path,
96  Fw::Buffer& buffer,
97  FwSizeType offsetBytes,
98  bool append,
99  Fw::SerialBufferBase& _buffer
100  );
101 
102  private:
103 
104  // ----------------------------------------------------------------------
105  // Private member variables for FileWritePortSerializer
106  // ----------------------------------------------------------------------
107 
108  char m___fprime_ac_path_buffer[Fw::StringBase::BUFFER_SIZE(240)];
109 
110  public:
111 
112  // ----------------------------------------------------------------------
113  // Public member variables for FileWritePortSerializer
114  // ----------------------------------------------------------------------
115 
119  bool m_append;
120 
121  };
122 
123 #if !FW_DIRECT_PORT_CALLS
124 
127  public Fw::InputPortBase
128  {
129 
130  public:
131 
132  // ----------------------------------------------------------------------
133  // Public types for InputFileWritePort
134  // ----------------------------------------------------------------------
135 
137  typedef void (*CompFuncPtr)(
138  Fw::PassiveComponentBase* callComp,
139  FwIndexType portNum,
140  const Fw::StringBase& path,
141  Fw::Buffer& buffer,
142  FwSizeType offsetBytes,
143  bool append
144  );
145 
146  public:
147 
148  // ----------------------------------------------------------------------
149  // Public constructors for InputFileWritePort
150  // ----------------------------------------------------------------------
151 
154 
155  public:
156 
157  // ----------------------------------------------------------------------
158  // Public member functions for InputFileWritePort
159  // ----------------------------------------------------------------------
160 
162  void init();
163 
165  void addCallComp(
166  Fw::PassiveComponentBase* callComp,
167  CompFuncPtr funcPtr
168  );
169 
171  void invoke(
172  const Fw::StringBase& path,
173  Fw::Buffer& buffer,
174  FwSizeType offsetBytes,
175  bool append
176  );
177 
178  private:
179 
180  // ----------------------------------------------------------------------
181  // Private member functions for InputFileWritePort
182  // ----------------------------------------------------------------------
183 
184 #if FW_PORT_SERIALIZATION == 1
185 
188  Fw::SerializeStatus invokeSerial(
189  Fw::LinearBufferBase& _buffer
190  );
191 
192 #endif
193 
194  private:
195 
196  // ----------------------------------------------------------------------
197  // Private member variables for InputFileWritePort
198  // ----------------------------------------------------------------------
199 
201  CompFuncPtr m_func;
202 
203  };
204 
207  public Fw::OutputPortBase
208  {
209 
210  public:
211 
212  // ----------------------------------------------------------------------
213  // Public constructors for OutputFileWritePort
214  // ----------------------------------------------------------------------
215 
218 
219  public:
220 
221  // ----------------------------------------------------------------------
222  // Public member functions for OutputFileWritePort
223  // ----------------------------------------------------------------------
224 
226  void init();
227 
229  void addCallPort(
230  InputFileWritePort* callPort
231  );
232 
234  void invoke(
235  const Fw::StringBase& path,
236  Fw::Buffer& buffer,
237  FwSizeType offsetBytes,
238  bool append
239  ) const;
240 
241  private:
242 
243  // ----------------------------------------------------------------------
244  // Private member variables for OutputFileWritePort
245  // ----------------------------------------------------------------------
246 
248  InputFileWritePort* m_port;
249 
250  };
251 
252 #endif
253 
254 }
255 
256 #endif
OutputFileWritePort()
Constructor.
PlatformSizeType FwSizeType
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.
FileWritePortBuffer()
Constructor.
Input FileWrite port.
A string backed by an external buffer.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, const Fw::StringBase &path, Fw::Buffer &buffer, FwSizeType offsetBytes, bool append)
The port callback function type.
FileWritePortSerializer()
Constructor.
static constexpr FwSizeType CAPACITY
PlatformIndexType FwIndexType
RateGroupDivider component implementation.
Output FileWrite port.
static constexpr SizeType STATIC_SERIALIZED_SIZE(SizeType maxLength)
Implementation of malloc based allocator.
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:70
void init()
Initialization function.