F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
ComAggregator.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title ComAggregator.hpp
3 // \author lestarch
4 // \brief hpp file for ComAggregator component implementation class
5 // ======================================================================
6 
7 #ifndef Svc_ComAggregator_HPP
8 #define Svc_ComAggregator_HPP
9 
10 #include <atomic>
11 #include "Os/Mutex.hpp"
13 
14 namespace Svc {
15 
17  friend class ComAggregatorTester; // Allow unit test access to private members
18  public:
19  // ----------------------------------------------------------------------
20  // Component construction and destruction
21  // ----------------------------------------------------------------------
22 
24  ComAggregator(const char* const compName
25  );
26 
29 
30  void preamble() override;
31 
32  private:
33  // ----------------------------------------------------------------------
34  // Handler implementations for typed input ports
35  // ----------------------------------------------------------------------
36 
41  void comStatusIn_handler(FwIndexType portNum,
42  Fw::Success& condition
43  ) override;
44 
48  void dataIn_handler(FwIndexType portNum,
49  Fw::Buffer& data,
50  const ComCfg::FrameContext& context) override;
51 
55  void dataReturnIn_handler(FwIndexType portNum,
56  Fw::Buffer& data,
57  const ComCfg::FrameContext& context) override;
58 
60  void timeout_handler(FwIndexType portNum,
61  U32 context
62  ) override;
63 
64  private:
65  // ----------------------------------------------------------------------
66  // Implementations for internal state machine actions
67  // ----------------------------------------------------------------------
68 
72  void Svc_AggregationMachine_action_doClear(SmId smId,
74  ) override;
75 
79  void Svc_AggregationMachine_action_doFill(SmId smId,
81  const Svc::ComDataContextPair& value
82  ) override;
83 
87  void Svc_AggregationMachine_action_doSend(SmId smId,
89  ) override;
90 
94  void Svc_AggregationMachine_action_doHold(SmId smId,
96  const Svc::ComDataContextPair& value
97  ) override;
98 
102  void Svc_AggregationMachine_action_assertNoStatus(SmId smId,
104  ) override;
105 
106  private:
107  // ----------------------------------------------------------------------
108  // Implementations for internal state machine guards
109  // ----------------------------------------------------------------------
110 
114  bool Svc_AggregationMachine_guard_isFull(SmId smId,
116  const Svc::ComDataContextPair& value
117  ) const override;
118 
122  bool Svc_AggregationMachine_guard_willFill(SmId smId,
124  const Svc::ComDataContextPair& value
125  ) const override;
126 
130  bool Svc_AggregationMachine_guard_isNotEmpty(SmId smId,
132  ) const override;
133 
137  bool Svc_AggregationMachine_guard_isGood(SmId smId,
139  const Fw::Success& value
140  ) const override;
141 
142  private:
143  U8 m_frameBufferStore[ComCfg::AggregationSize];
144  Fw::Buffer::OwnershipState m_bufferState =
146  Fw::Buffer m_frameBuffer;
148  ComCfg::FrameContext m_lastContext;
149 
150  Svc::ComDataContextPair m_held;
151  std::atomic<bool> m_allow_timeout;
152 };
153 
154 } // namespace Svc
155 
156 #endif
friend class ComAggregatorTester
~ComAggregator()
Destroy ComAggregator object.
void preamble() override
A function that will be called before the event loop is entered.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
Auto-generated base for ComAggregator component.
ComAggregator(const char *const compName)
Construct ComAggregator object.
PlatformIndexType FwIndexType
OwnershipState
Definition: Buffer.hpp:54
Type used to pass context info between components during framing/deframing.
External serialize buffer with member copy semantics.
RateGroupDivider component implementation.
The buffer is currently owned.
Success/Failure.