F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FrameAccumulator.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FrameAccumulator.hpp
3 // \author mstarch
4 // \brief hpp file for FrameAccumulator component implementation class
5 // ======================================================================
6 
7 #ifndef Svc_FrameAccumulator_HPP
8 #define Svc_FrameAccumulator_HPP
9 
14 
15 namespace Svc {
16 
18  friend class FrameAccumulatorTester;
19 
20  public:
21  // ----------------------------------------------------------------------
22  // Component construction and destruction
23  // ----------------------------------------------------------------------
24 
26  FrameAccumulator(const char* const compName
27  );
28 
31 
36  void configure(const FrameDetector& detector,
37  FwEnumStoreType allocationId,
38  Fw::MemAllocator& allocator,
39  FwSizeType store_size
40  );
41 
43  void cleanup();
44 
45  private:
46  // ----------------------------------------------------------------------
47  // Handler implementations for user-defined typed input ports
48  // ----------------------------------------------------------------------
49 
53  void dataIn_handler(FwIndexType portNum,
54  Fw::Buffer& recvBuffer,
55  const ComCfg::FrameContext& context) override;
56 
60  void dataReturnIn_handler(FwIndexType portNum,
61  Fw::Buffer& fwBuffer,
62  const ComCfg::FrameContext& context
63  ) override;
64 
65  private:
68  void processBuffer(Fw::Buffer& buffer);
69 
71  void processRing();
72 
74  Types::CircularBuffer m_inRing;
75 
77  FrameDetector const* m_detector;
78 
80  Fw::MemAllocator* m_memoryAllocator;
81 
83  U8* m_memory;
84 
86  FwEnumStoreType m_allocatorId;
87 };
88 
89 } // namespace Svc
90 
91 #endif
PlatformSizeType FwSizeType
I32 FwEnumStoreType
FrameAccumulator(const char *const compName)
Construct FrameAccumulator object.
~FrameAccumulator()
Destroy FrameAccumulator object.
friend class FrameAccumulatorTester
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
void cleanup()
Deallocate internal resources (set up by configure() call)
PlatformIndexType FwIndexType
void configure(const FrameDetector &detector, FwEnumStoreType allocationId, Fw::MemAllocator &allocator, FwSizeType store_size)
configure memory allocation for the circular buffer
Type used to pass context info between components during framing/deframing.
Auto-generated base for FrameAccumulator component.
RateGroupDivider component implementation.
Defines a base class for a memory allocator for classes.
interface class used to codify what must be supported to allow frame detection