F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
DpManager.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title DpManager.hpp
3 // \author bocchino
4 // \brief hpp file for DpManager component implementation class
5 // ======================================================================
6 
7 #ifndef Svc_DpManager_HPP
8 #define Svc_DpManager_HPP
9 
10 #include <atomic>
11 
14 
15 namespace Svc {
16 
17 class DpManager final : public DpManagerComponentBase {
18  private:
19  // ----------------------------------------------------------------------
20  // Static assertions against the assumptions about the model
21  // ----------------------------------------------------------------------
22 
23  static_assert(DpManager::NUM_PRODUCTGETIN_INPUT_PORTS == static_cast<FwSizeType>(DpManagerNumPorts),
24  "Number of product get in ports must equal DpManagerNumPorts");
25  static_assert(DpManager::NUM_PRODUCTREQUESTIN_INPUT_PORTS == static_cast<FwSizeType>(DpManagerNumPorts),
26  "Number of product request in ports must equal DpManagerNumPorts");
27  static_assert(DpManager::NUM_PRODUCTRESPONSEOUT_OUTPUT_PORTS == static_cast<FwSizeType>(DpManagerNumPorts),
28  "Number of product response out ports must equal DpManagerNumPorts");
29  static_assert(DpManager::NUM_BUFFERGETOUT_OUTPUT_PORTS == static_cast<FwSizeType>(DpManagerNumPorts),
30  "Number of buffer get out ports must equal DpManagerNumPorts");
31  static_assert(DpManager::NUM_PRODUCTSENDIN_INPUT_PORTS == static_cast<FwSizeType>(DpManagerNumPorts),
32  "Number of product send in ports must equal DpManagerNumPorts");
33  static_assert(DpManager::NUM_PRODUCTSENDOUT_OUTPUT_PORTS == static_cast<FwSizeType>(DpManagerNumPorts),
34  "Number of product send out ports must equal DpManagerNumPorts");
35 
36  public:
37  // ----------------------------------------------------------------------
38  // Construction, initialization, and destruction
39  // ----------------------------------------------------------------------
40 
42  explicit DpManager(const char* const compName
43  );
44 
46  ~DpManager();
47 
48  private:
49  // ----------------------------------------------------------------------
50  // Handler implementations for user-defined typed input ports
51  // ----------------------------------------------------------------------
52 
54  Fw::Success productGetIn_handler(const FwIndexType portNum,
55  FwDpIdType id,
56  FwSizeType size,
57  Fw::Buffer& buffer
58  ) final;
59 
61  void productRequestIn_handler(const FwIndexType portNum,
62  FwDpIdType id,
63  FwSizeType size
64  ) final;
65 
67  void productSendIn_handler(const FwIndexType portNum,
68  FwDpIdType id,
69  const Fw::Buffer& buffer
70  ) final;
71 
73  void schedIn_handler(const FwIndexType portNum,
74  U32 context
75  ) final;
76 
77  private:
78  // ----------------------------------------------------------------------
79  // Handler implementations for commands
80  // ----------------------------------------------------------------------
81 
85  void CLEAR_EVENT_THROTTLE_cmdHandler(FwOpcodeType opCode,
86  U32 cmdSeq
87  ) override;
88 
89  private:
90  // ----------------------------------------------------------------------
91  // Private helper functions
92  // ----------------------------------------------------------------------
93 
96  Fw::Success getBuffer(FwIndexType portNum,
97  FwDpIdType id,
98  FwSizeType size,
99  Fw::Buffer& buffer
100  );
101 
102  private:
103  // ----------------------------------------------------------------------
104  // Private member variables
105  // ----------------------------------------------------------------------
106 
108  std::atomic<U32> numSuccessfulAllocations;
109 
111  std::atomic<U32> numFailedAllocations;
112 
114  U32 numDataProducts;
115 
117  U64 numBytes;
118 };
119 
120 } // end namespace Svc
121 
122 #endif
FwIdType FwOpcodeType
The type of a command opcode.
PlatformSizeType FwSizeType
~DpManager()
Destroy the DpManager.
Definition: DpManager.cpp:23
Auto-generated base for DpManager component.
FwIdType FwDpIdType
The type of a data product identifier.
PlatformIndexType FwIndexType
RateGroupDivider component implementation.
DpManager(const char *const compName)
Construct a DpManager.
Definition: DpManager.cpp:16
Success/Failure.
#define U64(C)
Definition: sha.h:181