F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
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
15namespace Svc {
16
18 private:
19 // ----------------------------------------------------------------------
20 // Static assertions against the assumptions about the model
21 // ----------------------------------------------------------------------
22
23 static_assert(
25 "Number of product get in ports must equal DpManagerNumPorts"
26 );
27 static_assert(
29 "Number of product request in ports must equal DpManagerNumPorts"
30 );
31 static_assert(
33 "Number of product response out ports must equal DpManagerNumPorts"
34 );
35 static_assert(
37 "Number of buffer get out ports must equal DpManagerNumPorts"
38 );
39 static_assert(
41 "Number of product send in ports must equal DpManagerNumPorts"
42 );
43 static_assert(
45 "Number of product send out ports must equal DpManagerNumPorts"
46 );
47
48 public:
49 // ----------------------------------------------------------------------
50 // Construction, initialization, and destruction
51 // ----------------------------------------------------------------------
52
54 explicit DpManager(const char* const compName
55 );
56
58 ~DpManager();
59
60 PRIVATE:
61 // ----------------------------------------------------------------------
62 // Handler implementations for user-defined typed input ports
63 // ----------------------------------------------------------------------
64
66 Fw::Success productGetIn_handler(const NATIVE_INT_TYPE portNum,
67 FwDpIdType id,
68 FwSizeType size,
69 Fw::Buffer& buffer
70 ) final;
71
73 void productRequestIn_handler(const NATIVE_INT_TYPE portNum,
74 FwDpIdType id,
75 FwSizeType size
76 ) final;
77
79 void productSendIn_handler(const NATIVE_INT_TYPE portNum,
80 FwDpIdType id,
81 const Fw::Buffer& buffer
82 ) final;
83
85 void schedIn_handler(const NATIVE_INT_TYPE portNum,
86 U32 context
87 ) final;
88
89 PRIVATE:
90 // ----------------------------------------------------------------------
91 // Handler implementations for commands
92 // ----------------------------------------------------------------------
93
97 void CLEAR_EVENT_THROTTLE_cmdHandler(FwOpcodeType opCode,
98 U32 cmdSeq
99 ) override;
100
101 PRIVATE:
102 // ----------------------------------------------------------------------
103 // Private helper functions
104 // ----------------------------------------------------------------------
105
108 Fw::Success getBuffer(FwIndexType portNum,
109 FwDpIdType id,
110 FwSizeType size,
111 Fw::Buffer& buffer
112 );
113
114 PRIVATE:
115 // ----------------------------------------------------------------------
116 // Private member variables
117 // ----------------------------------------------------------------------
118
120 std::atomic<U32> numSuccessfulAllocations;
121
123 std::atomic<U32> numFailedAllocations;
124
126 U32 numDataProducts;
127
129 U64 numBytes;
130};
131
132} // end namespace Svc
133
134#endif
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:55
U32 FwDpIdType
Definition FpConfig.h:115
U32 FwOpcodeType
Definition FpConfig.h:91
PlatformSizeType FwSizeType
Definition FpConfig.h:35
PlatformIndexType FwIndexType
Definition FpConfig.h:25
@ DpManagerNumPorts
Success/Failure.
Auto-generated base for DpManager component.
~DpManager()
Destroy the DpManager.
Definition DpManager.cpp:23
#define U64(C)
Definition sha.h:176