F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
ApidManagerComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title ApidManagerComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for ApidManager component base class
5 // ======================================================================
6 
7 #ifndef Svc_Ccsds_ApidManagerComponentAc_HPP
8 #define Svc_Ccsds_ApidManagerComponentAc_HPP
9 
10 #include <atomic>
11 
13 #include "Fw/FPrimeBasicTypes.hpp"
14 #include "Fw/Log/LogPortAc.hpp"
15 #include "Fw/Log/LogString.hpp"
16 #if FW_ENABLE_TEXT_LOGGING == 1
17 #include "Fw/Log/LogTextPortAc.hpp"
18 #endif
21 #include "Fw/Time/TimePortAc.hpp"
22 #include "Os/Mutex.hpp"
24 
25 namespace Svc {
26 
27  namespace Ccsds {
28 
35  {
36 
37  // ----------------------------------------------------------------------
38  // Friend classes
39  // ----------------------------------------------------------------------
40 
42  friend class ApidManagerTesterBase;
44  friend class ApidManagerTester;
45 
46  protected:
47 
48  // ----------------------------------------------------------------------
49  // Constants
50  // ----------------------------------------------------------------------
51 
53  enum {
56  };
57 
59  enum {
63  };
64 
66  enum {
69  };
70 
71  public:
72 
73  // ----------------------------------------------------------------------
74  // Component initialization
75  // ----------------------------------------------------------------------
76 
78  void init(
79  FwEnumStoreType instance = 0
80  );
81 
82  public:
83 
84  // ----------------------------------------------------------------------
85  // Getters for typed input ports
86  // ----------------------------------------------------------------------
87 
92  FwIndexType portNum
93  );
94 
99  FwIndexType portNum
100  );
101 
102  public:
103 
104  // ----------------------------------------------------------------------
105  // Connect input ports to special output ports
106  // ----------------------------------------------------------------------
107 
110  FwIndexType portNum,
111  Fw::InputLogPort* port
112  );
113 
114 #if FW_ENABLE_TEXT_LOGGING == 1
115 
117  void set_logTextOut_OutputPort(
118  FwIndexType portNum,
119  Fw::InputLogTextPort* port
120  );
121 
122 #endif
123 
126  FwIndexType portNum,
127  Fw::InputTimePort* port
128  );
129 
130 #if FW_PORT_SERIALIZATION
131 
132  public:
133 
134  // ----------------------------------------------------------------------
135  // Connect serial input ports to special output ports
136  // ----------------------------------------------------------------------
137 
140  FwIndexType portNum,
141  Fw::InputSerializePort* port
142  );
143 
144 #if FW_ENABLE_TEXT_LOGGING == 1
145 
147  void set_logTextOut_OutputPort(
148  FwIndexType portNum,
149  Fw::InputSerializePort* port
150  );
151 
152 #endif
153 
156  FwIndexType portNum,
157  Fw::InputSerializePort* port
158  );
159 
160 #endif
161 
162  protected:
163 
164  // ----------------------------------------------------------------------
165  // Component construction and destruction
166  // ----------------------------------------------------------------------
167 
170  const char* compName = ""
171  );
172 
174  virtual ~ApidManagerComponentBase();
175 
176  protected:
177 
178  // ----------------------------------------------------------------------
179  // Getters for numbers of typed input ports
180  // ----------------------------------------------------------------------
181 
186 
191 
192  protected:
193 
194  // ----------------------------------------------------------------------
195  // Getters for numbers of special output ports
196  // ----------------------------------------------------------------------
197 
202 
203 #if FW_ENABLE_TEXT_LOGGING == 1
204 
208  FwIndexType getNum_logTextOut_OutputPorts() const;
209 
210 #endif
211 
216 
217  protected:
218 
219  // ----------------------------------------------------------------------
220  // Connection status queries for special output ports
221  // ----------------------------------------------------------------------
222 
227  FwIndexType portNum
228  );
229 
230 #if FW_ENABLE_TEXT_LOGGING == 1
231 
235  bool isConnected_logTextOut_OutputPort(
236  FwIndexType portNum
237  );
238 
239 #endif
240 
245  FwIndexType portNum
246  );
247 
248  protected:
249 
250  // ----------------------------------------------------------------------
251  // Handlers to implement for typed input ports
252  // ----------------------------------------------------------------------
253 
255  virtual U16 getApidSeqCountIn_handler(
256  FwIndexType portNum,
257  const ComCfg::Apid& apid,
258  U16 sequenceCount
259  ) = 0;
260 
262  virtual U16 validateApidSeqCountIn_handler(
263  FwIndexType portNum,
264  const ComCfg::Apid& apid,
265  U16 sequenceCount
266  ) = 0;
267 
268  protected:
269 
270  // ----------------------------------------------------------------------
271  // Port handler base-class functions for typed input ports
272  //
273  // Call these functions directly to bypass the corresponding ports
274  // ----------------------------------------------------------------------
275 
278  FwIndexType portNum,
279  const ComCfg::Apid& apid,
280  U16 sequenceCount
281  );
282 
285  FwIndexType portNum,
286  const ComCfg::Apid& apid,
287  U16 sequenceCount
288  );
289 
290  protected:
291 
292  // ----------------------------------------------------------------------
293  // Event logging functions
294  // ----------------------------------------------------------------------
295 
300  U16 transmitted,
301  U16 expected
302  ) const;
303 
307  void log_WARNING_HI_ApidTableFull(U16 invalidApidValue) const;
308 
309  protected:
310 
311  // ----------------------------------------------------------------------
312  // Time
313  // ----------------------------------------------------------------------
314 
318  Fw::Time getTime() const;
319 
320  protected:
321 
322  // ----------------------------------------------------------------------
323  // Mutex operations for guarded ports
324  //
325  // You can override these operations to provide more sophisticated
326  // synchronization
327  // ----------------------------------------------------------------------
328 
330  virtual void lock();
331 
333  virtual void unLock();
334 
335  private:
336 
337  // ----------------------------------------------------------------------
338  // Calls for messages received on typed input ports
339  // ----------------------------------------------------------------------
340 
342  static U16 m_p_getApidSeqCountIn_in(
343  Fw::PassiveComponentBase* callComp,
344  FwIndexType portNum,
345  const ComCfg::Apid& apid,
346  U16 sequenceCount
347  );
348 
350  static U16 m_p_validateApidSeqCountIn_in(
351  Fw::PassiveComponentBase* callComp,
352  FwIndexType portNum,
353  const ComCfg::Apid& apid,
354  U16 sequenceCount
355  );
356 
357  private:
358 
359  // ----------------------------------------------------------------------
360  // Typed input ports
361  // ----------------------------------------------------------------------
362 
365 
368 
369  private:
370 
371  // ----------------------------------------------------------------------
372  // Special output ports
373  // ----------------------------------------------------------------------
374 
376  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
377 
378 #if FW_ENABLE_TEXT_LOGGING == 1
379 
381  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
382 
383 #endif
384 
386  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
387 
388  private:
389 
390  // ----------------------------------------------------------------------
391  // Mutexes
392  // ----------------------------------------------------------------------
393 
395  Os::Mutex m_guardedPortMutex;
396 
397  };
398 
399  }
400 
401 }
402 
403 #endif
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
virtual void unLock()
Unlock the guarded mutex.
I32 FwEnumStoreType
bool isConnected_logOut_OutputPort(FwIndexType portNum)
friend class ApidManagerTesterBase
Friend class tester to support autocoded test harness.
virtual ~ApidManagerComponentBase()
Destroy ApidManagerComponentBase object.
void init()
Object initializer.
Definition: ObjBase.cpp:24
Svc::Ccsds::InputApidSequenceCountPort * get_validateApidSeqCountIn_InputPort(FwIndexType portNum)
ApidManagerComponentBase(const char *compName="")
Construct ApidManagerComponentBase object.
friend class ApidManagerTester
Friend class tester implementation to support white-box testing.
virtual U16 validateApidSeqCountIn_handler(FwIndexType portNum, const ComCfg::Apid &apid, U16 sequenceCount)=0
Handler for input port validateApidSeqCountIn.
void log_WARNING_HI_ApidTableFull(U16 invalidApidValue) const
void log_WARNING_LO_UnexpectedSequenceCount(U16 transmitted, U16 expected) const
virtual void lock()
Lock the guarded mutex.
U16 getApidSeqCountIn_handlerBase(FwIndexType portNum, const ComCfg::Apid &apid, U16 sequenceCount)
Handler base-class function for input port getApidSeqCountIn.
PlatformIndexType FwIndexType
U16 validateApidSeqCountIn_handlerBase(FwIndexType portNum, const ComCfg::Apid &apid, U16 sequenceCount)
Handler base-class function for input port validateApidSeqCountIn.
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
RateGroupDivider component implementation.
Auto-generated base for ApidManager component.
FwIndexType getNum_validateApidSeqCountIn_InputPorts() const
Svc::Ccsds::InputApidSequenceCountPort * get_getApidSeqCountIn_InputPort(FwIndexType portNum)
APIDs are 11 bits in the Space Packet protocol, so we use U16. Max value 7FF.
Definition: ApidEnumAc.hpp:17
virtual U16 getApidSeqCountIn_handler(FwIndexType portNum, const ComCfg::Apid &apid, U16 sequenceCount)=0
Handler for input port getApidSeqCountIn.
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)