F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
TimePortAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title TimePortAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for Time port
5 // ======================================================================
6 
7 #ifndef Fw_TimePortAc_HPP
8 #define Fw_TimePortAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
11 #include "Fw/Time/Time.hpp"
13 #if !FW_DIRECT_PORT_CALLS
17 #endif
18 
19 namespace Fw {
20 
25  {
26 
27  public:
28 
29  // ----------------------------------------------------------------------
30  // Public constants for TimePortBuffer
31  // ----------------------------------------------------------------------
32 
35  static constexpr FwSizeType CAPACITY =
37 
38  public:
39 
40  // ----------------------------------------------------------------------
41  // Public member functions for TimePortBuffer
42  // ----------------------------------------------------------------------
43 
47  return CAPACITY;
48  }
49 
52  U8* getBuffAddr() override {
53  return m_buff;
54  }
55 
58  const U8* getBuffAddr() const override {
59  return m_buff;
60  }
61 
62  private:
63 
64  // ----------------------------------------------------------------------
65  // Private member variables
66  // ----------------------------------------------------------------------
67 
68  U8 m_buff[CAPACITY];
69 
70  };
71 
75 
76  public:
77 
78  // ----------------------------------------------------------------------
79  // Public constructors for TimePortSerializer
80  // ----------------------------------------------------------------------
81 
84 
85  public:
86 
87  // ----------------------------------------------------------------------
88  // Public member functions for TimePortSerializer
89  // ----------------------------------------------------------------------
90 
93  Fw::SerialBufferBase& _buffer
94  );
95 
96  public:
97 
98  // ----------------------------------------------------------------------
99  // Public static functions for TimePortSerializer
100  // ----------------------------------------------------------------------
101 
104  Fw::Time& time,
105  Fw::SerialBufferBase& _buffer
106  );
107 
108  public:
109 
110  // ----------------------------------------------------------------------
111  // Public member variables for TimePortSerializer
112  // ----------------------------------------------------------------------
113 
115 
116  };
117 
118 #if !FW_DIRECT_PORT_CALLS
119 
123  public Fw::InputPortBase
124  {
125 
126  public:
127 
128  // ----------------------------------------------------------------------
129  // Public types for InputTimePort
130  // ----------------------------------------------------------------------
131 
133  typedef void (*CompFuncPtr)(
134  Fw::PassiveComponentBase* callComp,
135  FwIndexType portNum,
136  Fw::Time& time
137  );
138 
139  public:
140 
141  // ----------------------------------------------------------------------
142  // Public constructors for InputTimePort
143  // ----------------------------------------------------------------------
144 
146  InputTimePort();
147 
148  public:
149 
150  // ----------------------------------------------------------------------
151  // Public member functions for InputTimePort
152  // ----------------------------------------------------------------------
153 
155  void init();
156 
158  void addCallComp(
159  Fw::PassiveComponentBase* callComp,
160  CompFuncPtr funcPtr
161  );
162 
164  void invoke(
165  Fw::Time& time
166  );
167 
168  private:
169 
170  // ----------------------------------------------------------------------
171  // Private member functions for InputTimePort
172  // ----------------------------------------------------------------------
173 
174 #if FW_PORT_SERIALIZATION == 1
175 
178  Fw::SerializeStatus invokeSerial(
179  Fw::LinearBufferBase& _buffer
180  );
181 
182 #endif
183 
184  private:
185 
186  // ----------------------------------------------------------------------
187  // Private member variables for InputTimePort
188  // ----------------------------------------------------------------------
189 
191  CompFuncPtr m_func;
192 
193  };
194 
198  public Fw::OutputPortBase
199  {
200 
201  public:
202 
203  // ----------------------------------------------------------------------
204  // Public constructors for OutputTimePort
205  // ----------------------------------------------------------------------
206 
208  OutputTimePort();
209 
210  public:
211 
212  // ----------------------------------------------------------------------
213  // Public member functions for OutputTimePort
214  // ----------------------------------------------------------------------
215 
217  void init();
218 
220  void addCallPort(
221  InputTimePort* callPort
222  );
223 
225  void invoke(
226  Fw::Time& time
227  ) const;
228 
229  private:
230 
231  // ----------------------------------------------------------------------
232  // Private member variables for OutputTimePort
233  // ----------------------------------------------------------------------
234 
236  InputTimePort* m_port;
237 
238  };
239 
240 #endif
241 
242 }
243 
244 #endif
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:157
PlatformSizeType FwSizeType
void invoke(Fw::Time &time)
Invoke a port interface.
Definition: TimePortAc.cpp:93
void init()
Initialization function.
Definition: TimePortAc.cpp:73
Fw::Serializable::SizeType getCapacity() const override
Definition: TimePortAc.hpp:46
Fw::SerializeStatus deserializePortArgs(Fw::SerialBufferBase &_buffer)
Deserialze port arguments into members.
Definition: TimePortAc.cpp:28
static constexpr FwSizeType CAPACITY
Definition: TimePortAc.hpp:35
InputTimePort()
Constructor.
Definition: TimePortAc.cpp:61
SerializeStatus
forward declaration for string
U8 * getBuffAddr() override
Definition: TimePortAc.hpp:52
void init()
Initialization function.
Definition: TimePortAc.cpp:151
void invoke(Fw::Time &time) const
Invoke a port connection.
Definition: TimePortAc.cpp:170
FwSizeType SizeType
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
void(* CompFuncPtr)(Fw::PassiveComponentBase *callComp, FwIndexType portNum, Fw::Time &time)
The port callback function type.
Definition: TimePortAc.hpp:133
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: TimePortAc.cpp:79
const U8 * getBuffAddr() const override
Definition: TimePortAc.hpp:58
PlatformIndexType FwIndexType
static Fw::SerializeStatus serializePortArgs(Fw::Time &time, Fw::SerialBufferBase &_buffer)
Serialize port arguments into a buffer.
Definition: TimePortAc.cpp:42
Implementation of malloc based allocator.
OutputTimePort()
Constructor.
Definition: TimePortAc.cpp:139
TimePortSerializer()
Constructor.
Definition: TimePortAc.cpp:17