F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
SdlsSaRouterComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title SdlsSaRouterComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for SdlsSaRouter component base class
5 // ======================================================================
6 
7 #ifndef Svc_Ccsds_SdlsSaRouterComponentAc_HPP
8 #define Svc_Ccsds_SdlsSaRouterComponentAc_HPP
9 
10 #include <atomic>
11 
13 #include "Fw/FPrimeBasicTypes.hpp"
14 #include "Fw/Log/LogPortAc.hpp"
15 #include "Fw/Log/LogString.hpp"
16 #include "Fw/Log/LogTextPortAc.hpp"
17 #if !FW_DIRECT_PORT_CALLS
19 #endif
20 #if !FW_DIRECT_PORT_CALLS
22 #endif
23 #include "Fw/Time/TimePortAc.hpp"
24 #include "Os/Mutex.hpp"
28 
29 namespace Svc {
30 
31  namespace Ccsds {
32 
42  {
43 
44  // ----------------------------------------------------------------------
45  // Friend classes
46  // ----------------------------------------------------------------------
47 
49  friend class SdlsSaRouterTesterBase;
51  friend class SdlsSaRouterTester;
52 
53  protected:
54 
55  // ----------------------------------------------------------------------
56  // Constants
57  // ----------------------------------------------------------------------
58 
60  enum {
65  };
66 
68  enum {
72  };
73 
75  enum {
80  };
81 
83  enum {
86  };
87 
88  public:
89 
90  // ----------------------------------------------------------------------
91  // Component initialization
92  // ----------------------------------------------------------------------
93 
95  void init(
96  FwEnumStoreType instance = 0
97  );
98 
99 #if !FW_DIRECT_PORT_CALLS
100 
101  public:
102 
103  // ----------------------------------------------------------------------
104  // Getters for typed input ports
105  // ----------------------------------------------------------------------
106 
111  FwIndexType portNum
112  );
113 
118  FwIndexType portNum
119  );
120 
125  FwIndexType portNum
126  );
127 
132  FwIndexType portNum
133  );
134 
135 #endif
136 
137 #if !FW_DIRECT_PORT_CALLS
138 
139  public:
140 
141  // ----------------------------------------------------------------------
142  // Connect input ports to special output ports
143  // ----------------------------------------------------------------------
144 
147  FwIndexType portNum,
148  Fw::InputLogPort* port
149  );
150 
151 #if FW_ENABLE_TEXT_LOGGING == 1
152 
154  void set_logTextOut_OutputPort(
155  FwIndexType portNum,
156  Fw::InputLogTextPort* port
157  );
158 
159 #endif
160 
163  FwIndexType portNum,
164  Fw::InputTimePort* port
165  );
166 
167 #endif
168 
169 #if !FW_DIRECT_PORT_CALLS
170 
171  public:
172 
173  // ----------------------------------------------------------------------
174  // Connect typed input ports to typed output ports
175  // ----------------------------------------------------------------------
176 
179  FwIndexType portNum,
181  );
182 
185  FwIndexType portNum,
187  );
188 
191  FwIndexType portNum,
193  );
194 
197  FwIndexType portNum,
199  );
200 
201 #endif
202 
203 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
204 
205  public:
206 
207  // ----------------------------------------------------------------------
208  // Connect serial input ports to special output ports
209  // ----------------------------------------------------------------------
210 
213  FwIndexType portNum,
214  Fw::InputSerializePort* port
215  );
216 
217 #if FW_ENABLE_TEXT_LOGGING == 1
218 
220  void set_logTextOut_OutputPort(
221  FwIndexType portNum,
222  Fw::InputSerializePort* port
223  );
224 
225 #endif
226 
229  FwIndexType portNum,
230  Fw::InputSerializePort* port
231  );
232 
233 #endif
234 
235 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
236 
237  public:
238 
239  // ----------------------------------------------------------------------
240  // Connect serial input ports to typed output ports
241  // ----------------------------------------------------------------------
242 
245  FwIndexType portNum,
246  Fw::InputSerializePort* port
247  );
248 
251  FwIndexType portNum,
252  Fw::InputSerializePort* port
253  );
254 
257  FwIndexType portNum,
258  Fw::InputSerializePort* port
259  );
260 
263  FwIndexType portNum,
264  Fw::InputSerializePort* port
265  );
266 
267 #endif
268 
269  protected:
270 
271  // ----------------------------------------------------------------------
272  // Component construction and destruction
273  // ----------------------------------------------------------------------
274 
277  const char* compName = ""
278  );
279 
281  virtual ~SdlsSaRouterComponentBase();
282 
283  protected:
284 
285  // ----------------------------------------------------------------------
286  // Getters for numbers of typed input ports
287  // ----------------------------------------------------------------------
288 
293  return NUM_DATAIN_INPUT_PORTS;
294  }
295 
301  }
302 
308  }
309 
315  }
316 
317  protected:
318 
319  // ----------------------------------------------------------------------
320  // Getters for numbers of special output ports
321  // ----------------------------------------------------------------------
322 
328  }
329 
330 #if FW_ENABLE_TEXT_LOGGING == 1
331 
335  static constexpr FwIndexType getNum_logTextOut_OutputPorts() {
337  }
338 
339 #endif
340 
346  }
347 
348  protected:
349 
350  // ----------------------------------------------------------------------
351  // Getters for numbers of typed output ports
352  // ----------------------------------------------------------------------
353 
359  }
360 
366  }
367 
373  }
374 
380  }
381 
382  protected:
383 
384  // ----------------------------------------------------------------------
385  // Connection status queries for special output ports
386  // ----------------------------------------------------------------------
387 
392  FwIndexType portNum
393  ) const;
394 
395 #if FW_ENABLE_TEXT_LOGGING == 1
396 
400  bool isConnected_logTextOut_OutputPort(
401  FwIndexType portNum
402  ) const;
403 
404 #endif
405 
410  FwIndexType portNum
411  ) const;
412 
413  protected:
414 
415  // ----------------------------------------------------------------------
416  // Connection status queries for typed output ports
417  // ----------------------------------------------------------------------
418 
423  FwIndexType portNum
424  ) const;
425 
430  FwIndexType portNum
431  ) const;
432 
437  FwIndexType portNum
438  ) const;
439 
444  FwIndexType portNum
445  ) const;
446 
447  protected:
448 
449  // ----------------------------------------------------------------------
450  // Handlers to implement for typed input ports
451  // ----------------------------------------------------------------------
452 
454  virtual void dataIn_handler(
455  FwIndexType portNum,
456  U16 securityAssociationIndex,
457  Fw::Buffer& data,
458  const ComCfg::FrameContext& context
459  ) = 0;
460 
462  virtual void dataReturnIn_handler(
463  FwIndexType portNum,
464  Fw::Buffer& data,
465  const ComCfg::FrameContext& context
466  ) = 0;
467 
469  virtual void saBufferReturnIn_handler(
470  FwIndexType portNum,
471  Fw::Buffer& data,
472  const ComCfg::FrameContext& context
473  ) = 0;
474 
476  virtual void saDataIn_handler(
477  FwIndexType portNum,
478  const Svc::Ccsds::SdlsStatus& status,
479  Fw::Buffer& data,
480  const ComCfg::FrameContext& context
481  ) = 0;
482 
483 #if FW_DIRECT_PORT_CALLS
484  public:
485 #else
486  protected:
487 #endif
488 
489  // ----------------------------------------------------------------------
490  // Port handler base-class functions for typed input ports
491  //
492  // Call these functions directly to bypass the corresponding ports
493  // ----------------------------------------------------------------------
494 
496  void dataIn_handlerBase(
497  FwIndexType portNum,
498  U16 securityAssociationIndex,
499  Fw::Buffer& data,
500  const ComCfg::FrameContext& context
501  );
502 
505  FwIndexType portNum,
506  Fw::Buffer& data,
507  const ComCfg::FrameContext& context
508  );
509 
512  FwIndexType portNum,
513  Fw::Buffer& data,
514  const ComCfg::FrameContext& context
515  );
516 
519  FwIndexType portNum,
520  const Svc::Ccsds::SdlsStatus& status,
521  Fw::Buffer& data,
522  const ComCfg::FrameContext& context
523  );
524 
525  protected:
526 
527  // ----------------------------------------------------------------------
528  // Invocation functions for typed output ports
529  // ----------------------------------------------------------------------
530 
532  void bufferReturnOut_out(
533  FwIndexType portNum,
534  Fw::Buffer& data,
535  const ComCfg::FrameContext& context
536  ) const;
537 
539  void dataOut_out(
540  FwIndexType portNum,
541  const Svc::Ccsds::SdlsStatus& status,
542  Fw::Buffer& data,
543  const ComCfg::FrameContext& context
544  ) const;
545 
547  void saDataOut_out(
548  FwIndexType portNum,
549  U16 securityAssociationIndex,
550  Fw::Buffer& data,
551  const ComCfg::FrameContext& context
552  ) const;
553 
555  void saDataReturnOut_out(
556  FwIndexType portNum,
557  Fw::Buffer& data,
558  const ComCfg::FrameContext& context
559  ) const;
560 
561  protected:
562 
563  // ----------------------------------------------------------------------
564  // Event logging functions
565  // ----------------------------------------------------------------------
566 
571 
576 
577  protected:
578 
579  // ----------------------------------------------------------------------
580  // Time
581  // ----------------------------------------------------------------------
582 
586  Fw::Time getTime() const;
587 
588  protected:
589 
590  // ----------------------------------------------------------------------
591  // Mutex operations for guarded ports
592  //
593  // You can override these operations to provide more sophisticated
594  // synchronization
595  // ----------------------------------------------------------------------
596 
598  virtual void lock();
599 
601  virtual void unLock();
602 
603  private:
604 
605  // ----------------------------------------------------------------------
606  // Calls for messages received on typed input ports
607  // ----------------------------------------------------------------------
608 
610  static void m_p_dataIn_in(
611  Fw::PassiveComponentBase* callComp,
612  FwIndexType portNum,
613  U16 securityAssociationIndex,
614  Fw::Buffer& data,
615  const ComCfg::FrameContext& context
616  );
617 
619  static void m_p_dataReturnIn_in(
620  Fw::PassiveComponentBase* callComp,
621  FwIndexType portNum,
622  Fw::Buffer& data,
623  const ComCfg::FrameContext& context
624  );
625 
627  static void m_p_saBufferReturnIn_in(
628  Fw::PassiveComponentBase* callComp,
629  FwIndexType portNum,
630  Fw::Buffer& data,
631  const ComCfg::FrameContext& context
632  );
633 
635  static void m_p_saDataIn_in(
636  Fw::PassiveComponentBase* callComp,
637  FwIndexType portNum,
638  const Svc::Ccsds::SdlsStatus& status,
639  Fw::Buffer& data,
640  const ComCfg::FrameContext& context
641  );
642 
643  private:
644 
645  // ----------------------------------------------------------------------
646  // Invocation functions for special output ports
647  // ----------------------------------------------------------------------
648 
650  void logOut_out(
651  FwIndexType portNum,
652  FwEventIdType id,
653  Fw::Time& timeTag,
654  const Fw::LogSeverity& severity,
655  Fw::LogBuffer& args
656  ) const;
657 
658 #if FW_ENABLE_TEXT_LOGGING
659 
661  void logTextOut_out(
662  FwIndexType portNum,
663  FwEventIdType id,
664  Fw::Time& timeTag,
665  const Fw::LogSeverity& severity,
666  Fw::TextLogString& text
667  ) const;
668 
669 #endif
670 
672  void timeCaller_out(
673  FwIndexType portNum,
674  Fw::Time& time
675  ) const;
676 
677 #if !FW_DIRECT_PORT_CALLS
678 
679  private:
680 
681  // ----------------------------------------------------------------------
682  // Typed input ports
683  // ----------------------------------------------------------------------
684 
687 
690 
693 
696 
697 #endif
698 
699 #if !FW_DIRECT_PORT_CALLS
700 
701  private:
702 
703  // ----------------------------------------------------------------------
704  // Special output ports
705  // ----------------------------------------------------------------------
706 
708  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
709 
710 #if FW_ENABLE_TEXT_LOGGING == 1
711 
713  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
714 
715 #endif
716 
718  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
719 
720 #endif
721 
722 #if !FW_DIRECT_PORT_CALLS
723 
724  private:
725 
726  // ----------------------------------------------------------------------
727  // Typed output ports
728  // ----------------------------------------------------------------------
729 
732 
735 
738 
741 
742 #endif
743 
744  private:
745 
746  // ----------------------------------------------------------------------
747  // Mutexes
748  // ----------------------------------------------------------------------
749 
751  Os::Mutex m_guardedPortMutex;
752 
753  };
754 
755  }
756 
757 }
758 
759 #endif
Svc::InputComDataWithContextPort * get_saBufferReturnIn_InputPort(FwIndexType portNum)
void set_saDataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to saDataReturnOut[portNum].
bool isConnected_dataOut_OutputPort(FwIndexType portNum) const
void dataReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataReturnIn.
static constexpr FwIndexType getNum_dataReturnIn_InputPorts()
friend class SdlsSaRouterTesterBase
Friend class tester to support autocoded test harness.
I32 FwEnumStoreType
SdlsSaRouterComponentBase(const char *compName="")
Construct SdlsSaRouterComponentBase object.
Link-time delegating Mutex implementation.
void bufferReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port bufferReturnOut.
bool isConnected_logOut_OutputPort(FwIndexType portNum) const
bool isConnected_saDataOut_OutputPort(FwIndexType portNum) const
bool isConnected_saDataReturnOut_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_saBufferReturnIn_InputPorts()
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
void init()
Object initializer.
Definition: ObjBase.cpp:24
Status of an SDLS (Space Data Link Security) encryption/decryption request.
virtual void lock()
Lock the guarded mutex.
void saDataOut_out(FwIndexType portNum, U16 securityAssociationIndex, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port saDataOut.
FwIdType FwEventIdType
The type of an event identifier.
virtual void dataReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataReturnIn.
A returned buffer was not found in the tracking table; it was returned upstream.
void dataOut_out(FwIndexType portNum, const Svc::Ccsds::SdlsStatus &status, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataOut.
void set_dataOut_OutputPort(FwIndexType portNum, Svc::Ccsds::InputCcsdsSdlsDataPort *port)
Connect port to dataOut[portNum].
virtual void dataIn_handler(FwIndexType portNum, U16 securityAssociationIndex, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
virtual void unLock()
Unlock the guarded mutex.
void saDataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port saDataReturnOut.
virtual void saBufferReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port saBufferReturnIn.
Enum representing event severity.
Svc::Ccsds::InputCcsdsSdlsEncryptionPort * get_dataIn_InputPort(FwIndexType portNum)
The outstanding-buffer tracking table is full; the data was dropped and its buffer returned...
bool isConnected_bufferReturnOut_OutputPort(FwIndexType portNum) const
PlatformIndexType FwIndexType
static constexpr FwIndexType getNum_dataIn_InputPorts()
static constexpr FwIndexType getNum_bufferReturnOut_OutputPorts()
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
void dataIn_handlerBase(FwIndexType portNum, U16 securityAssociationIndex, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataIn.
virtual void saDataIn_handler(FwIndexType portNum, const Svc::Ccsds::SdlsStatus &status, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port saDataIn.
Type used to pass context info between components during framing/deframing.
void saDataIn_handlerBase(FwIndexType portNum, const Svc::Ccsds::SdlsStatus &status, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port saDataIn.
RateGroupDivider component implementation.
static constexpr FwIndexType getNum_saDataReturnOut_OutputPorts()
Auto-generated base for SdlsSaRouter component.
static constexpr FwIndexType getNum_dataOut_OutputPorts()
friend class SdlsSaRouterTester
Friend class tester implementation to support white-box testing.
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
void set_bufferReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to bufferReturnOut[portNum].
static constexpr FwIndexType getNum_saDataOut_OutputPorts()
Svc::Ccsds::InputCcsdsSdlsDataPort * get_saDataIn_InputPort(FwIndexType portNum)
void saBufferReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port saBufferReturnIn.
virtual ~SdlsSaRouterComponentBase()
Destroy SdlsSaRouterComponentBase object.
static constexpr FwIndexType getNum_saDataIn_InputPorts()
void set_saDataOut_OutputPort(FwIndexType portNum, Svc::Ccsds::InputCcsdsSdlsEncryptionPort *port)
Connect port to saDataOut[portNum].
static constexpr FwIndexType getNum_logOut_OutputPorts()
bool isConnected_timeCaller_OutputPort(FwIndexType portNum) const