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 
187  }
188 
194  }
195 
196  protected:
197 
198  // ----------------------------------------------------------------------
199  // Getters for numbers of special output ports
200  // ----------------------------------------------------------------------
201 
207  }
208 
209 #if FW_ENABLE_TEXT_LOGGING == 1
210 
214  static constexpr FwIndexType getNum_logTextOut_OutputPorts() {
216  }
217 
218 #endif
219 
225  }
226 
227  protected:
228 
229  // ----------------------------------------------------------------------
230  // Connection status queries for special output ports
231  // ----------------------------------------------------------------------
232 
237  FwIndexType portNum
238  );
239 
240 #if FW_ENABLE_TEXT_LOGGING == 1
241 
245  bool isConnected_logTextOut_OutputPort(
246  FwIndexType portNum
247  );
248 
249 #endif
250 
255  FwIndexType portNum
256  );
257 
258  protected:
259 
260  // ----------------------------------------------------------------------
261  // Handlers to implement for typed input ports
262  // ----------------------------------------------------------------------
263 
265  virtual U16 getApidSeqCountIn_handler(
266  FwIndexType portNum,
267  const ComCfg::Apid& apid,
268  U16 sequenceCount
269  ) = 0;
270 
272  virtual U16 validateApidSeqCountIn_handler(
273  FwIndexType portNum,
274  const ComCfg::Apid& apid,
275  U16 sequenceCount
276  ) = 0;
277 
278  protected:
279 
280  // ----------------------------------------------------------------------
281  // Port handler base-class functions for typed input ports
282  //
283  // Call these functions directly to bypass the corresponding ports
284  // ----------------------------------------------------------------------
285 
288  FwIndexType portNum,
289  const ComCfg::Apid& apid,
290  U16 sequenceCount
291  );
292 
295  FwIndexType portNum,
296  const ComCfg::Apid& apid,
297  U16 sequenceCount
298  );
299 
300  protected:
301 
302  // ----------------------------------------------------------------------
303  // Event logging functions
304  // ----------------------------------------------------------------------
305 
310  U16 transmitted,
311  U16 expected
312  ) const;
313 
317  void log_WARNING_HI_ApidTableFull(U16 invalidApidValue) const;
318 
319  protected:
320 
321  // ----------------------------------------------------------------------
322  // Time
323  // ----------------------------------------------------------------------
324 
328  Fw::Time getTime() const;
329 
330  protected:
331 
332  // ----------------------------------------------------------------------
333  // Mutex operations for guarded ports
334  //
335  // You can override these operations to provide more sophisticated
336  // synchronization
337  // ----------------------------------------------------------------------
338 
340  virtual void lock();
341 
343  virtual void unLock();
344 
345  private:
346 
347  // ----------------------------------------------------------------------
348  // Calls for messages received on typed input ports
349  // ----------------------------------------------------------------------
350 
352  static U16 m_p_getApidSeqCountIn_in(
353  Fw::PassiveComponentBase* callComp,
354  FwIndexType portNum,
355  const ComCfg::Apid& apid,
356  U16 sequenceCount
357  );
358 
360  static U16 m_p_validateApidSeqCountIn_in(
361  Fw::PassiveComponentBase* callComp,
362  FwIndexType portNum,
363  const ComCfg::Apid& apid,
364  U16 sequenceCount
365  );
366 
367  private:
368 
369  // ----------------------------------------------------------------------
370  // Typed input ports
371  // ----------------------------------------------------------------------
372 
375 
378 
379  private:
380 
381  // ----------------------------------------------------------------------
382  // Special output ports
383  // ----------------------------------------------------------------------
384 
386  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
387 
388 #if FW_ENABLE_TEXT_LOGGING == 1
389 
391  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
392 
393 #endif
394 
396  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
397 
398  private:
399 
400  // ----------------------------------------------------------------------
401  // Mutexes
402  // ----------------------------------------------------------------------
403 
405  Os::Mutex m_guardedPortMutex;
406 
407  };
408 
409  }
410 
411 }
412 
413 #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.
static constexpr FwIndexType getNum_getApidSeqCountIn_InputPorts()
void init()
Object initializer.
Definition: ObjBase.cpp:24
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
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.
static constexpr FwIndexType getNum_logOut_OutputPorts()
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.
static constexpr FwIndexType getNum_validateApidSeqCountIn_InputPorts()
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)