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 <cstdio>
11 #include <cstring>
12 
13 #include "Fw/Buffer/Buffer.hpp"
15 #include "Fw/FPrimeBasicTypes.hpp"
19 #include "Fw/Types/String.hpp"
22 
23 namespace Svc {
24 
27  public Fw::InputPortBase
28  {
29 
30  public:
31 
32  // ----------------------------------------------------------------------
33  // Constants
34  // ----------------------------------------------------------------------
35 
36  enum {
41  sizeof(FwSizeType) +
42  sizeof(U8)
43  };
44 
45  public:
46 
47  // ----------------------------------------------------------------------
48  // Types
49  // ----------------------------------------------------------------------
50 
52  typedef void (*CompFuncPtr)(
53  Fw::PassiveComponentBase* callComp,
54  FwIndexType portNum,
55  const Fw::StringBase& path,
56  Fw::Buffer& buffer,
57  FwSizeType offsetBytes,
58  bool append
59  );
60 
61  public:
62 
63  // ----------------------------------------------------------------------
64  // Input Port Member functions
65  // ----------------------------------------------------------------------
66 
69 
71  void init();
72 
74  void addCallComp(
75  Fw::PassiveComponentBase* callComp,
76  CompFuncPtr funcPtr
77  );
78 
80  void invoke(
81  const Fw::StringBase& path,
82  Fw::Buffer& buffer,
83  FwSizeType offsetBytes,
84  bool append
85  );
86 
87  private:
88 
89 #if FW_PORT_SERIALIZATION == 1
90 
92  Fw::SerializeStatus invokeSerial(Fw::LinearBufferBase& _buffer);
93 
94 #endif
95 
96  private:
97 
98  // ----------------------------------------------------------------------
99  // Member variables
100  // ----------------------------------------------------------------------
101 
103  CompFuncPtr m_func;
104 
105  };
106 
109  public Fw::OutputPortBase
110  {
111 
112  public:
113 
114  // ----------------------------------------------------------------------
115  // Output Port Member functions
116  // ----------------------------------------------------------------------
117 
120 
122  void init();
123 
125  void addCallPort(
126  InputFileWritePort* callPort
127  );
128 
130  void invoke(
131  const Fw::StringBase& path,
132  Fw::Buffer& buffer,
133  FwSizeType offsetBytes,
134  bool append
135  ) const;
136 
137  private:
138 
139  // ----------------------------------------------------------------------
140  // Member variables
141  // ----------------------------------------------------------------------
142 
144  InputFileWritePort* m_port;
145 
146  };
147 
148 }
149 
150 #endif
OutputFileWritePort()
Constructor.
The size of the serial representations of the port arguments.
PlatformSizeType FwSizeType
void init()
Initialization function.
void invoke(const Fw::StringBase &path, Fw::Buffer &buffer, FwSizeType offsetBytes, bool append) const
Invoke a port interface.
SerializeStatus
forward declaration for string
void addCallPort(InputFileWritePort *callPort)
Register an input port.
InputFileWritePort()
Constructor.
void invoke(const Fw::StringBase &path, Fw::Buffer &buffer, FwSizeType offsetBytes, bool append)
Invoke a port interface.
Size of Fw::Buffer when serialized.
Definition: Buffer.hpp:64
Input FileWrite port.
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.
PlatformIndexType FwIndexType
RateGroupDivider component implementation.
Output FileWrite port.
static constexpr SizeType STATIC_SERIALIZED_SIZE(SizeType maxLength)
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void init()
Initialization function.