F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
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 
13 #include "Fw/FPrimeBasicTypes.hpp"
14 #if !FW_DIRECT_PORT_CALLS
16 #endif
17 #if !FW_DIRECT_PORT_CALLS
19 #endif
20 #include "Os/Mutex.hpp"
21 
22 namespace Svc {
23 
30  {
31 
32  // ----------------------------------------------------------------------
33  // Friend classes
34  // ----------------------------------------------------------------------
35 
37  friend class StaticMemoryTesterBase;
39  friend class StaticMemoryTester;
40 
41  protected:
42 
43  // ----------------------------------------------------------------------
44  // Constants
45  // ----------------------------------------------------------------------
46 
48  enum {
51  };
52 
53  public:
54 
55  // ----------------------------------------------------------------------
56  // Component initialization
57  // ----------------------------------------------------------------------
58 
60  void init(
61  FwEnumStoreType instance = 0
62  );
63 
64 #if !FW_DIRECT_PORT_CALLS
65 
66  public:
67 
68  // ----------------------------------------------------------------------
69  // Getters for typed input ports
70  // ----------------------------------------------------------------------
71 
76  FwIndexType portNum
77  );
78 
83  FwIndexType portNum
84  );
85 
86 #endif
87 
88  protected:
89 
90  // ----------------------------------------------------------------------
91  // Component construction and destruction
92  // ----------------------------------------------------------------------
93 
96  const char* compName = ""
97  );
98 
100  virtual ~StaticMemoryComponentBase();
101 
102  protected:
103 
104  // ----------------------------------------------------------------------
105  // Getters for numbers of typed input ports
106  // ----------------------------------------------------------------------
107 
113  }
114 
120  }
121 
122  protected:
123 
124  // ----------------------------------------------------------------------
125  // Handlers to implement for typed input ports
126  // ----------------------------------------------------------------------
127 
130  FwIndexType portNum,
131  FwSizeType size
132  ) = 0;
133 
135  virtual void bufferDeallocate_handler(
136  FwIndexType portNum,
137  Fw::Buffer& fwBuffer
138  ) = 0;
139 
140 #if FW_DIRECT_PORT_CALLS
141  public:
142 #else
143  protected:
144 #endif
145 
146  // ----------------------------------------------------------------------
147  // Port handler base-class functions for typed input ports
148  //
149  // Call these functions directly to bypass the corresponding ports
150  // ----------------------------------------------------------------------
151 
154  FwIndexType portNum,
155  FwSizeType size
156  );
157 
160  FwIndexType portNum,
161  Fw::Buffer& fwBuffer
162  );
163 
164  protected:
165 
166  // ----------------------------------------------------------------------
167  // Mutex operations for guarded ports
168  //
169  // You can override these operations to provide more sophisticated
170  // synchronization
171  // ----------------------------------------------------------------------
172 
174  virtual void lock();
175 
177  virtual void unLock();
178 
179  private:
180 
181  // ----------------------------------------------------------------------
182  // Calls for messages received on typed input ports
183  // ----------------------------------------------------------------------
184 
186  static Fw::Buffer m_p_bufferAllocate_in(
187  Fw::PassiveComponentBase* callComp,
188  FwIndexType portNum,
189  FwSizeType size
190  );
191 
193  static void m_p_bufferDeallocate_in(
194  Fw::PassiveComponentBase* callComp,
195  FwIndexType portNum,
196  Fw::Buffer& fwBuffer
197  );
198 
199 #if !FW_DIRECT_PORT_CALLS
200 
201  private:
202 
203  // ----------------------------------------------------------------------
204  // Typed input ports
205  // ----------------------------------------------------------------------
206 
208  Fw::InputBufferGetPort m_bufferAllocate_InputPort[NUM_BUFFERALLOCATE_INPUT_PORTS];
209 
211  Fw::InputBufferSendPort m_bufferDeallocate_InputPort[NUM_BUFFERDEALLOCATE_INPUT_PORTS];
212 
213 #endif
214 
215  private:
216 
217  // ----------------------------------------------------------------------
218  // Mutexes
219  // ----------------------------------------------------------------------
220 
222  Os::Mutex m_guardedPortMutex;
223 
224  };
225 
226 }
227 
228 #endif
PlatformSizeType FwSizeType
Fw::InputBufferGetPort * get_bufferAllocate_InputPort(FwIndexType portNum)
I32 FwEnumStoreType
Fw::Buffer bufferAllocate_handlerBase(FwIndexType portNum, FwSizeType size)
Handler base-class function for input port bufferAllocate.
void init()
Object initializer.
Definition: ObjBase.cpp:24
static constexpr FwIndexType getNum_bufferAllocate_InputPorts()
virtual void bufferDeallocate_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port bufferDeallocate.
friend class StaticMemoryTesterBase
Friend class tester to support autocoded test harness.
virtual void unLock()
Unlock the guarded mutex.
virtual void lock()
Lock the guarded mutex.
Fw::InputBufferSendPort * get_bufferDeallocate_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_bufferDeallocate_InputPorts()
void bufferDeallocate_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port bufferDeallocate.
friend class StaticMemoryTester
Friend class tester implementation to support white-box testing.
virtual ~StaticMemoryComponentBase()
Destroy StaticMemoryComponentBase object.
StaticMemoryComponentBase(const char *compName="")
Construct StaticMemoryComponentBase object.
PlatformIndexType FwIndexType
RateGroupDivider component implementation.
Auto-generated base for StaticMemory component.
virtual Fw::Buffer bufferAllocate_handler(FwIndexType portNum, FwSizeType size)=0
Handler for input port bufferAllocate.