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"
16 #include "Os/Mutex.hpp"
17 
18 namespace Svc {
19 
26  {
27 
28  // ----------------------------------------------------------------------
29  // Friend classes
30  // ----------------------------------------------------------------------
31 
33  friend class StaticMemoryTesterBase;
35  friend class StaticMemoryTester;
36 
37  protected:
38 
39  // ----------------------------------------------------------------------
40  // Constants
41  // ----------------------------------------------------------------------
42 
44  enum {
47  };
48 
49  public:
50 
51  // ----------------------------------------------------------------------
52  // Component initialization
53  // ----------------------------------------------------------------------
54 
56  void init(
57  FwEnumStoreType instance = 0
58  );
59 
60  public:
61 
62  // ----------------------------------------------------------------------
63  // Getters for typed input ports
64  // ----------------------------------------------------------------------
65 
70  FwIndexType portNum
71  );
72 
77  FwIndexType portNum
78  );
79 
80  protected:
81 
82  // ----------------------------------------------------------------------
83  // Component construction and destruction
84  // ----------------------------------------------------------------------
85 
88  const char* compName = ""
89  );
90 
93 
94  protected:
95 
96  // ----------------------------------------------------------------------
97  // Getters for numbers of typed input ports
98  // ----------------------------------------------------------------------
99 
105  }
106 
112  }
113 
114  protected:
115 
116  // ----------------------------------------------------------------------
117  // Handlers to implement for typed input ports
118  // ----------------------------------------------------------------------
119 
122  FwIndexType portNum,
123  FwSizeType size
124  ) = 0;
125 
127  virtual void bufferDeallocate_handler(
128  FwIndexType portNum,
129  Fw::Buffer& fwBuffer
130  ) = 0;
131 
132  protected:
133 
134  // ----------------------------------------------------------------------
135  // Port handler base-class functions for typed input ports
136  //
137  // Call these functions directly to bypass the corresponding ports
138  // ----------------------------------------------------------------------
139 
142  FwIndexType portNum,
143  FwSizeType size
144  );
145 
148  FwIndexType portNum,
149  Fw::Buffer& fwBuffer
150  );
151 
152  protected:
153 
154  // ----------------------------------------------------------------------
155  // Mutex operations for guarded ports
156  //
157  // You can override these operations to provide more sophisticated
158  // synchronization
159  // ----------------------------------------------------------------------
160 
162  virtual void lock();
163 
165  virtual void unLock();
166 
167  private:
168 
169  // ----------------------------------------------------------------------
170  // Calls for messages received on typed input ports
171  // ----------------------------------------------------------------------
172 
174  static Fw::Buffer m_p_bufferAllocate_in(
175  Fw::PassiveComponentBase* callComp,
176  FwIndexType portNum,
177  FwSizeType size
178  );
179 
181  static void m_p_bufferDeallocate_in(
182  Fw::PassiveComponentBase* callComp,
183  FwIndexType portNum,
184  Fw::Buffer& fwBuffer
185  );
186 
187  private:
188 
189  // ----------------------------------------------------------------------
190  // Typed input ports
191  // ----------------------------------------------------------------------
192 
194  Fw::InputBufferGetPort m_bufferAllocate_InputPort[NUM_BUFFERALLOCATE_INPUT_PORTS];
195 
197  Fw::InputBufferSendPort m_bufferDeallocate_InputPort[NUM_BUFFERDEALLOCATE_INPUT_PORTS];
198 
199  private:
200 
201  // ----------------------------------------------------------------------
202  // Mutexes
203  // ----------------------------------------------------------------------
204 
206  Os::Mutex m_guardedPortMutex;
207 
208  };
209 
210 }
211 
212 #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.