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 "Os/Mutex.hpp"
12 
13 namespace Svc {
14 
16  friend class ComAggregatorTester; // Allow unit test access to private members
17  public:
18  // ----------------------------------------------------------------------
19  // Component construction and destruction
20  // ----------------------------------------------------------------------
21 
23  ComAggregator(const char* const compName
24  );
25 
28 
29  void preamble() override;
30 
31  private:
32  // ----------------------------------------------------------------------
33  // Handler implementations for typed input ports
34  // ----------------------------------------------------------------------
35 
40  void comStatusIn_handler(FwIndexType portNum,
41  Fw::Success& condition
42  ) override;
43 
47  void dataIn_handler(FwIndexType portNum,
48  Fw::Buffer& data,
49  const ComCfg::FrameContext& context) override;
50 
54  void dataReturnIn_handler(FwIndexType portNum,
55  Fw::Buffer& data,
56  const ComCfg::FrameContext& context) override;
57 
59  void timeout_handler(FwIndexType portNum,
60  U32 context
61  ) override;
62 
63  private:
64  // ----------------------------------------------------------------------
65  // Implementations for internal state machine actions
66  // ----------------------------------------------------------------------
67 
71  void Svc_AggregationMachine_action_doClear(SmId smId,
73  ) override;
74 
78  void Svc_AggregationMachine_action_doFill(SmId smId,
80  const Svc::ComDataContextPair& value
81  ) override;
82 
86  void Svc_AggregationMachine_action_doSend(SmId smId,
88  ) override;
89 
93  void Svc_AggregationMachine_action_doHold(SmId smId,
95  const Svc::ComDataContextPair& value
96  ) override;
97 
101  void Svc_AggregationMachine_action_assertNoStatus(SmId smId,
103  ) override;
104 
105  private:
106  // ----------------------------------------------------------------------
107  // Implementations for internal state machine guards
108  // ----------------------------------------------------------------------
109 
113  bool Svc_AggregationMachine_guard_isFull(SmId smId,
115  const Svc::ComDataContextPair& value
116  ) const override;
117 
121  bool Svc_AggregationMachine_guard_isNotEmpty(SmId smId,
123  ) const override;
124 
128  bool Svc_AggregationMachine_guard_isGood(SmId smId,
130  const Fw::Success& value
131  ) const override;
132 
133  private:
134  U8 m_frameBufferStore[ComCfg::AggregationSize];
135  Fw::Buffer::OwnershipState m_bufferState =
137  Fw::Buffer m_frameBuffer;
139  ComCfg::FrameContext m_lastContext;
140 
141  Svc::ComDataContextPair m_held;
142 };
143 
144 } // namespace Svc
145 
146 #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.