F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FileReadPortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FileReadPortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for FileRead port
5 // ======================================================================
6 
7 #ifndef Svc_FileReadPortAc_HPP
8 #define Svc_FileReadPortAc_HPP
9 
10 #include "Fw/Buffer/Buffer.hpp"
11 #include "Fw/FPrimeBasicTypes.hpp"
15 #if !FW_DIRECT_PORT_CALLS
19 #endif
20 
21 namespace Svc {
22 
26  {
27 
28  public:
29 
30  // ----------------------------------------------------------------------
31  // Public constants for FileReadPortBuffer
32  // ----------------------------------------------------------------------
33 
36  static constexpr FwSizeType CAPACITY =
39 
40  public:
41 
42  // ----------------------------------------------------------------------
43  // Public member functions for FileReadPortBuffer
44  // ----------------------------------------------------------------------
45 
49  return CAPACITY;
50  }
51 
54  U8* getBuffAddr() override {
55  return m_buff;
56  }
57 
60  const U8* getBuffAddr() const override {
61  return m_buff;
62  }
63 
64  private:
65 
66  // ----------------------------------------------------------------------
67  // Private member variables
68  // ----------------------------------------------------------------------
69 
70  U8 m_buff[CAPACITY];
71 
72  };
73 
76 
77  public:
78 
79  // ----------------------------------------------------------------------
80  // Public constructors for FileReadPortSerializer
81  // ----------------------------------------------------------------------
82 
85 
86  public:
87 
88  // ----------------------------------------------------------------------
89  // Public member functions for FileReadPortSerializer
90  // ----------------------------------------------------------------------
91 
94  Fw::SerialBufferBase& _buffer
95  );
96 
97  public:
98 
99  // ----------------------------------------------------------------------
100  // Public static functions for FileReadPortSerializer
101  // ----------------------------------------------------------------------
102 
105  const Fw::StringBase& path,
106  Fw::Buffer& buffer,
107  Fw::SerialBufferBase& _buffer
108  );
109 
110  private:
111 
112  // ----------------------------------------------------------------------
113  // Private member variables for FileReadPortSerializer
114  // ----------------------------------------------------------------------
115 
116  char m___fprime_ac_path_buffer[Fw::StringBase::BUFFER_SIZE(240)];
117 
118  public:
119 
120  // ----------------------------------------------------------------------
121  // Public member variables for FileReadPortSerializer
122  // ----------------------------------------------------------------------
123 
126 
127  };
128 
129 #if !FW_DIRECT_PORT_CALLS
130 
133  public Fw::InputPortBase
134  {
135 
136  public:
137 
138  // ----------------------------------------------------------------------
139  // Public types for InputFileReadPort
140  // ----------------------------------------------------------------------
141 
143  typedef void (*CompFuncPtr)(
144  Fw::PassiveComponentBase* callComp,
145  FwIndexType portNum,
146  const Fw::StringBase& path,
147  Fw::Buffer& buffer
148  );
149 
150  public:
151 
152  // ----------------------------------------------------------------------
153  // Public constructors for InputFileReadPort
154  // ----------------------------------------------------------------------
155 
158 
159  public:
160 
161  // ----------------------------------------------------------------------
162  // Public member functions for InputFileReadPort
163  // ----------------------------------------------------------------------
164 
166  void init();
167 
169  void addCallComp(
170  Fw::PassiveComponentBase* callComp,
171  CompFuncPtr funcPtr
172  );
173 
175  void invoke(
176  const Fw::StringBase& path,
177  Fw::Buffer& buffer
178  );
179 
180  private:
181 
182  // ----------------------------------------------------------------------
183  // Private member functions for InputFileReadPort
184  // ----------------------------------------------------------------------
185 
186 #if FW_PORT_SERIALIZATION == 1
187 
190  Fw::SerializeStatus invokeSerial(
191  Fw::LinearBufferBase& _buffer
192  );
193 
194 #endif
195 
196  private:
197 
198  // ----------------------------------------------------------------------
199  // Private member variables for InputFileReadPort
200  // ----------------------------------------------------------------------
201 
203  CompFuncPtr m_func;
204 
205  };
206 
209  public Fw::OutputPortBase
210  {
211 
212  public:
213 
214  // ----------------------------------------------------------------------
215  // Public constructors for OutputFileReadPort
216  // ----------------------------------------------------------------------
217 
220 
221  public:
222 
223  // ----------------------------------------------------------------------
224  // Public member functions for OutputFileReadPort
225  // ----------------------------------------------------------------------
226 
228  void init();
229 
231  void addCallPort(
232  InputFileReadPort* callPort
233  );
234 
236  void invoke(
237  const Fw::StringBase& path,
238  Fw::Buffer& buffer
239  ) const;
240 
241  private:
242 
243  // ----------------------------------------------------------------------
244  // Private member variables for OutputFileReadPort
245  // ----------------------------------------------------------------------
246 
248  InputFileReadPort* m_port;
249 
250  };
251 
252 #endif
253 
254 }
255 
256 #endif
static Fw::SerializeStatus serializePortArgs(const Fw::StringBase &path, Fw::Buffer &buffer, Fw::SerialBufferBase &_buffer)
Serialize port arguments into a buffer.
PlatformSizeType FwSizeType
InputFileReadPort()
Constructor.
SerializeStatus
forward declaration for string
Input FileRead port.
FwSizeType SizeType
Fw::Serializable::SizeType getCapacity() const override
void addCallPort(InputFileReadPort *callPort)
Register an input port.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
A string backed by an external buffer.
static constexpr FwSizeType CAPACITY
void invoke(const Fw::StringBase &path, Fw::Buffer &buffer)
Invoke a port interface.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
OutputFileReadPort()
Constructor.
FileReadPortSerializer()
Constructor.
const U8 * getBuffAddr() const override
Serializer for FileRead port.
Serialization buffer for FileRead port.
Fw::SerializeStatus deserializePortArgs(Fw::SerialBufferBase &_buffer)
Deserialze port arguments into members.
void invoke(const Fw::StringBase &path, Fw::Buffer &buffer) const
Invoke a port connection.
PlatformIndexType FwIndexType
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, const Fw::StringBase &path, Fw::Buffer &buffer)
The port callback function type.
RateGroupDivider component implementation.
Output FileRead 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.
U8 * getBuffAddr() override
Size of Fw::Buffer when serialized.
Definition: Buffer.hpp:64
void init()
Initialization function.
void init()
Initialization function.