F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
SendFileRequestPortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title SendFileRequestPortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for SendFileRequest port
5 // ======================================================================
6 
7 #ifndef Svc_SendFileRequestPortAc_HPP
8 #define Svc_SendFileRequestPortAc_HPP
9 
10 #include <cstdio>
11 #include <cstring>
12 
13 #include "FpConfig.hpp"
17 #include "Fw/Types/StringType.hpp"
19 
20 namespace Svc {
21 
22  namespace SendFileRequestPortStrings {
23 
24  // ----------------------------------------------------------------------
25  // StringSize100 class
26  // ----------------------------------------------------------------------
27 
28  class StringSize100 :
29  public Fw::StringBase
30  {
31 
32  public:
33 
34  enum {
36  SERIALIZED_SIZE = sizeof(FwBuffSizeType) + 100
37  };
38 
40  StringSize100();
41 
43  StringSize100(const char* src);
44 
46  StringSize100(const Fw::StringBase& src);
47 
49  StringSize100(const StringSize100& src);
50 
53 
55  StringSize100& operator=(const StringSize100& other);
56 
58  StringSize100& operator=(const Fw::StringBase& other);
59 
61  StringSize100& operator=(const char* other);
62 
64  const char* toChar() const;
65 
67 
68  private:
69 
70  char m_buf[100];
71 
72  };
73 
74  }
75 
76  // ----------------------------------------------------------------------
77  // String types for backwards compatibility
78  // ----------------------------------------------------------------------
79 
82 
86  public Fw::InputPortBase
87  {
88 
89  public:
90 
91  // ----------------------------------------------------------------------
92  // Constants
93  // ----------------------------------------------------------------------
94 
95  enum {
100  sizeof(U32) +
101  sizeof(U32)
102  };
103 
104  public:
105 
106  // ----------------------------------------------------------------------
107  // Types
108  // ----------------------------------------------------------------------
109 
112  Fw::PassiveComponentBase* callComp,
113  NATIVE_INT_TYPE portNum,
114  const SendFileRequestPortStrings::StringSize100& sourceFileName,
115  const SendFileRequestPortStrings::StringSize100& destFileName,
116  U32 offset,
117  U32 length
118  );
119 
120  public:
121 
122  // ----------------------------------------------------------------------
123  // Input Port Member functions
124  // ----------------------------------------------------------------------
125 
128 
130  void init();
131 
133  void addCallComp(
134  Fw::PassiveComponentBase* callComp,
135  CompFuncPtr funcPtr
136  );
137 
140  const SendFileRequestPortStrings::StringSize100& sourceFileName,
141  const SendFileRequestPortStrings::StringSize100& destFileName,
142  U32 offset,
143  U32 length
144  );
145 
146  private:
147 
148 #if FW_PORT_SERIALIZATION == 1
149 
151  Fw::SerializeStatus invokeSerial(Fw::SerializeBufferBase& _buffer);
152 
153 #endif
154 
155  private:
156 
157  // ----------------------------------------------------------------------
158  // Member variables
159  // ----------------------------------------------------------------------
160 
162  CompFuncPtr m_func;
163 
164  };
165 
169  public Fw::OutputPortBase
170  {
171 
172  public:
173 
174  // ----------------------------------------------------------------------
175  // Output Port Member functions
176  // ----------------------------------------------------------------------
177 
180 
182  void init();
183 
185  void addCallPort(
186  InputSendFileRequestPort* callPort
187  );
188 
191  const SendFileRequestPortStrings::StringSize100& sourceFileName,
192  const SendFileRequestPortStrings::StringSize100& destFileName,
193  U32 offset,
194  U32 length
195  );
196 
197  private:
198 
199  // ----------------------------------------------------------------------
200  // Member variables
201  // ----------------------------------------------------------------------
202 
204  InputSendFileRequestPort* m_port;
205 
206  };
207 
208 }
209 
210 #endif
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:51
PlatformUIntType NATIVE_UINT_TYPE
Definition: BasicTypes.h:52
U16 FwBuffSizeType
Definition: FpConfig.h:30
C++-compatible configuration header for fprime configuration.
Declares ISF string base class.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
@ SERIALIZED_SIZE
The size of the serial representations of the port arguments.
Svc::SendFileResponse invoke(const SendFileRequestPortStrings::StringSize100 &sourceFileName, const SendFileRequestPortStrings::StringSize100 &destFileName, U32 offset, U32 length)
Invoke a port interface.
Svc::SendFileResponse(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, NATIVE_INT_TYPE portNum, const SendFileRequestPortStrings::StringSize100 &sourceFileName, const SendFileRequestPortStrings::StringSize100 &destFileName, U32 offset, U32 length)
The port callback function type.
void init()
Initialization function.
Svc::SendFileResponse invoke(const SendFileRequestPortStrings::StringSize100 &sourceFileName, const SendFileRequestPortStrings::StringSize100 &destFileName, U32 offset, U32 length)
Invoke a port interface.
void init()
Initialization function.
void addCallPort(InputSendFileRequestPort *callPort)
Register an input port.
@ SERIALIZED_SIZE
The size of the string length plus the size of the string buffer.
const char * toChar() const
Retrieves char buffer of string.
StringSize100 & operator=(const StringSize100 &other)
Copy assignment operator.
NATIVE_UINT_TYPE getCapacity() const
return size of buffer
SerializeStatus
forward declaration for string
SendFileRequestPortStrings::StringSize100 sourceFileNameString
SendFileRequestPortStrings::StringSize100 destFileNameString