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 
35  friend class StaticMemoryTesterBase;
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 
104 
109 
110  PROTECTED:
111 
112  // ----------------------------------------------------------------------
113  // Handlers to implement for typed input ports
114  // ----------------------------------------------------------------------
115 
118  FwIndexType portNum,
119  U32 size
120  ) = 0;
121 
123  virtual void bufferDeallocate_handler(
124  FwIndexType portNum,
125  Fw::Buffer& fwBuffer
126  ) = 0;
127 
128  PROTECTED:
129 
130  // ----------------------------------------------------------------------
131  // Port handler base-class functions for typed input ports
132  //
133  // Call these functions directly to bypass the corresponding ports
134  // ----------------------------------------------------------------------
135 
138  FwIndexType portNum,
139  U32 size
140  );
141 
144  FwIndexType portNum,
145  Fw::Buffer& fwBuffer
146  );
147 
148  PROTECTED:
149 
150  // ----------------------------------------------------------------------
151  // Mutex operations for guarded ports
152  //
153  // You can override these operations to provide more sophisticated
154  // synchronization
155  // ----------------------------------------------------------------------
156 
158  virtual void lock();
159 
161  virtual void unLock();
162 
163  PRIVATE:
164 
165  // ----------------------------------------------------------------------
166  // Calls for messages received on typed input ports
167  // ----------------------------------------------------------------------
168 
170  static Fw::Buffer m_p_bufferAllocate_in(
171  Fw::PassiveComponentBase* callComp,
172  FwIndexType portNum,
173  U32 size
174  );
175 
177  static void m_p_bufferDeallocate_in(
178  Fw::PassiveComponentBase* callComp,
179  FwIndexType portNum,
180  Fw::Buffer& fwBuffer
181  );
182 
183  PRIVATE:
184 
185  // ----------------------------------------------------------------------
186  // Typed input ports
187  // ----------------------------------------------------------------------
188 
190  Fw::InputBufferGetPort m_bufferAllocate_InputPort[NUM_BUFFERALLOCATE_INPUT_PORTS];
191 
193  Fw::InputBufferSendPort m_bufferDeallocate_InputPort[NUM_BUFFERDEALLOCATE_INPUT_PORTS];
194 
195  PRIVATE:
196 
197  // ----------------------------------------------------------------------
198  // Mutexes
199  // ----------------------------------------------------------------------
200 
202  Os::Mutex m_guardedPortMutex;
203 
204  };
205 
206 }
207 
208 #endif
Fw::InputBufferGetPort * get_bufferAllocate_InputPort(FwIndexType portNum)
I32 FwEnumStoreType
void init()
Object initializer.
Definition: ObjBase.cpp:26
friend class StaticMemoryComponentBaseFriend
Friend class for white-box testing.
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 Fw::Buffer bufferAllocate_handler(FwIndexType portNum, U32 size)=0
Handler for input port bufferAllocate.
virtual void unLock()
Unlock the guarded mutex.
virtual void lock()
Lock the guarded mutex.
Fw::InputBufferSendPort * get_bufferDeallocate_InputPort(FwIndexType portNum)
void bufferDeallocate_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port bufferDeallocate.
virtual ~StaticMemoryComponentBase()
Destroy StaticMemoryComponentBase object.
StaticMemoryComponentBase(const char *compName="")
Construct StaticMemoryComponentBase object.
PlatformIndexType FwIndexType
Fw::Buffer bufferAllocate_handlerBase(FwIndexType portNum, U32 size)
Handler base-class function for input port bufferAllocate.
FwIndexType getNum_bufferAllocate_InputPorts() const
RateGroupDivider component implementation.
Auto-generated base for StaticMemory component.
FwIndexType getNum_bufferDeallocate_InputPorts() const