F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
StaticMemoryComponentAc.hpp
Go to the documentation of this file.
1// ======================================================================
2// \title StaticMemoryComponentAc.hpp
3// \author Generated by fpp-to-cpp
4// \brief hpp file for StaticMemory component base class
5// ======================================================================
6
7#ifndef Svc_StaticMemoryComponentAc_HPP
8#define Svc_StaticMemoryComponentAc_HPP
9
10#include "FpConfig.hpp"
16#include "Os/Mutex.hpp"
17
18namespace Svc {
19
26 {
27
28 // ----------------------------------------------------------------------
29 // Friend classes
30 // ----------------------------------------------------------------------
31
34
35 PROTECTED:
36
37 // ----------------------------------------------------------------------
38 // Constants
39 // ----------------------------------------------------------------------
40
42 enum {
45 };
46
47 public:
48
49 // ----------------------------------------------------------------------
50 // Component initialization
51 // ----------------------------------------------------------------------
52
54 void init(
55 FwEnumStoreType instance = 0
56 );
57
58 public:
59
60 // ----------------------------------------------------------------------
61 // Getters for typed input ports
62 // ----------------------------------------------------------------------
63
68 FwIndexType portNum
69 );
70
75 FwIndexType portNum
76 );
77
78 PROTECTED:
79
80 // ----------------------------------------------------------------------
81 // Component construction and destruction
82 // ----------------------------------------------------------------------
83
86 const char* compName = ""
87 );
88
91
92 PROTECTED:
93
94 // ----------------------------------------------------------------------
95 // Getters for numbers of typed input ports
96 // ----------------------------------------------------------------------
97
102
107
108 PROTECTED:
109
110 // ----------------------------------------------------------------------
111 // Handlers to implement for typed input ports
112 // ----------------------------------------------------------------------
113
116 FwIndexType portNum,
117 U32 size
118 ) = 0;
119
122 FwIndexType portNum,
123 Fw::Buffer& fwBuffer
124 ) = 0;
125
126 PROTECTED:
127
128 // ----------------------------------------------------------------------
129 // Port handler base-class functions for typed input ports
130 //
131 // Call these functions directly to bypass the corresponding ports
132 // ----------------------------------------------------------------------
133
136 FwIndexType portNum,
137 U32 size
138 );
139
142 FwIndexType portNum,
143 Fw::Buffer& fwBuffer
144 );
145
146 PROTECTED:
147
148 // ----------------------------------------------------------------------
149 // Mutex operations for guarded ports
150 //
151 // You can override these operations to provide more sophisticated
152 // synchronization
153 // ----------------------------------------------------------------------
154
156 virtual void lock();
157
159 virtual void unLock();
160
161 PRIVATE:
162
163 // ----------------------------------------------------------------------
164 // Calls for messages received on typed input ports
165 // ----------------------------------------------------------------------
166
168 static Fw::Buffer m_p_bufferAllocate_in(
169 Fw::PassiveComponentBase* callComp,
170 FwIndexType portNum,
171 U32 size
172 );
173
175 static void m_p_bufferDeallocate_in(
176 Fw::PassiveComponentBase* callComp,
177 FwIndexType portNum,
178 Fw::Buffer& fwBuffer
179 );
180
181 PRIVATE:
182
183 // ----------------------------------------------------------------------
184 // Typed input ports
185 // ----------------------------------------------------------------------
186
188 Fw::InputBufferGetPort m_bufferAllocate_InputPort[NUM_BUFFERALLOCATE_INPUT_PORTS];
189
191 Fw::InputBufferSendPort m_bufferDeallocate_InputPort[NUM_BUFFERDEALLOCATE_INPUT_PORTS];
192
193 PRIVATE:
194
195 // ----------------------------------------------------------------------
196 // Mutexes
197 // ----------------------------------------------------------------------
198
200 Os::Mutex m_guardedPortMutex;
201
202 };
203
204}
205
206#endif
I32 FwEnumStoreType
Definition FpConfig.h:64
PlatformIndexType FwIndexType
Definition FpConfig.h:25
C++-compatible configuration header for fprime configuration.
void init()
Object initializer.
Definition ObjBase.cpp:27
Auto-generated base for StaticMemory component.
Fw::InputBufferGetPort * get_bufferAllocate_InputPort(FwIndexType portNum)
virtual void bufferDeallocate_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port bufferDeallocate.
friend class StaticMemoryComponentBaseFriend
Friend class for white-box testing.
void bufferDeallocate_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port bufferDeallocate.
Fw::Buffer bufferAllocate_handlerBase(FwIndexType portNum, U32 size)
Handler base-class function for input port bufferAllocate.
virtual ~StaticMemoryComponentBase()
Destroy StaticMemoryComponentBase object.
virtual Fw::Buffer bufferAllocate_handler(FwIndexType portNum, U32 size)=0
Handler for input port bufferAllocate.
Fw::InputBufferSendPort * get_bufferDeallocate_InputPort(FwIndexType portNum)
virtual void lock()
Lock the guarded mutex.
virtual void unLock()
Unlock the guarded mutex.
FwIndexType getNum_bufferDeallocate_InputPorts() const