F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
PolyDbComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title PolyDbComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for PolyDb component base class
5 // ======================================================================
6 
7 #ifndef Svc_PolyDbComponentAc_HPP
8 #define Svc_PolyDbComponentAc_HPP
9 
11 #include "Fw/FPrimeBasicTypes.hpp"
12 #if !FW_DIRECT_PORT_CALLS
14 #endif
15 #if !FW_DIRECT_PORT_CALLS
17 #endif
18 #include "Os/Mutex.hpp"
20 
21 namespace Svc {
22 
29  {
30 
31  // ----------------------------------------------------------------------
32  // Friend classes
33  // ----------------------------------------------------------------------
34 
36  friend class PolyDbTesterBase;
38  friend class PolyDbTester;
39 
40  protected:
41 
42  // ----------------------------------------------------------------------
43  // Constants
44  // ----------------------------------------------------------------------
45 
47  enum {
50  };
51 
52  public:
53 
54  // ----------------------------------------------------------------------
55  // Component initialization
56  // ----------------------------------------------------------------------
57 
59  void init(
60  FwEnumStoreType instance = 0
61  );
62 
63 #if !FW_DIRECT_PORT_CALLS
64 
65  public:
66 
67  // ----------------------------------------------------------------------
68  // Getters for typed input ports
69  // ----------------------------------------------------------------------
70 
75  FwIndexType portNum
76  );
77 
82  FwIndexType portNum
83  );
84 
85 #endif
86 
87  protected:
88 
89  // ----------------------------------------------------------------------
90  // Component construction and destruction
91  // ----------------------------------------------------------------------
92 
95  const char* compName = ""
96  );
97 
99  virtual ~PolyDbComponentBase();
100 
101  protected:
102 
103  // ----------------------------------------------------------------------
104  // Getters for numbers of typed input ports
105  // ----------------------------------------------------------------------
106 
112  }
113 
119  }
120 
121  protected:
122 
123  // ----------------------------------------------------------------------
124  // Handlers to implement for typed input ports
125  // ----------------------------------------------------------------------
126 
128  virtual void getValue_handler(
129  FwIndexType portNum,
130  const Svc::PolyDbCfg::PolyDbEntry& entry,
131  Svc::MeasurementStatus& status,
132  Fw::Time& time,
133  Fw::PolyType& val
134  ) = 0;
135 
137  virtual void setValue_handler(
138  FwIndexType portNum,
139  const Svc::PolyDbCfg::PolyDbEntry& entry,
140  Svc::MeasurementStatus& status,
141  Fw::Time& time,
142  Fw::PolyType& val
143  ) = 0;
144 
145 #if FW_DIRECT_PORT_CALLS
146  public:
147 #else
148  protected:
149 #endif
150 
151  // ----------------------------------------------------------------------
152  // Port handler base-class functions for typed input ports
153  //
154  // Call these functions directly to bypass the corresponding ports
155  // ----------------------------------------------------------------------
156 
159  FwIndexType portNum,
160  const Svc::PolyDbCfg::PolyDbEntry& entry,
161  Svc::MeasurementStatus& status,
162  Fw::Time& time,
163  Fw::PolyType& val
164  );
165 
168  FwIndexType portNum,
169  const Svc::PolyDbCfg::PolyDbEntry& entry,
170  Svc::MeasurementStatus& status,
171  Fw::Time& time,
172  Fw::PolyType& val
173  );
174 
175  protected:
176 
177  // ----------------------------------------------------------------------
178  // Mutex operations for guarded ports
179  //
180  // You can override these operations to provide more sophisticated
181  // synchronization
182  // ----------------------------------------------------------------------
183 
185  virtual void lock();
186 
188  virtual void unLock();
189 
190  private:
191 
192  // ----------------------------------------------------------------------
193  // Calls for messages received on typed input ports
194  // ----------------------------------------------------------------------
195 
197  static void m_p_getValue_in(
198  Fw::PassiveComponentBase* callComp,
199  FwIndexType portNum,
200  const Svc::PolyDbCfg::PolyDbEntry& entry,
201  Svc::MeasurementStatus& status,
202  Fw::Time& time,
203  Fw::PolyType& val
204  );
205 
207  static void m_p_setValue_in(
208  Fw::PassiveComponentBase* callComp,
209  FwIndexType portNum,
210  const Svc::PolyDbCfg::PolyDbEntry& entry,
211  Svc::MeasurementStatus& status,
212  Fw::Time& time,
213  Fw::PolyType& val
214  );
215 
216 #if !FW_DIRECT_PORT_CALLS
217 
218  private:
219 
220  // ----------------------------------------------------------------------
221  // Typed input ports
222  // ----------------------------------------------------------------------
223 
225  Svc::InputPolyPort m_getValue_InputPort[NUM_GETVALUE_INPUT_PORTS];
226 
228  Svc::InputPolyPort m_setValue_InputPort[NUM_SETVALUE_INPUT_PORTS];
229 
230 #endif
231 
232  private:
233 
234  // ----------------------------------------------------------------------
235  // Mutexes
236  // ----------------------------------------------------------------------
237 
239  Os::Mutex m_guardedPortMutex;
240 
241  };
242 
243 }
244 
245 #endif
static constexpr FwIndexType getNum_getValue_InputPorts()
friend class PolyDbTesterBase
Friend class tester to support autocoded test harness.
I32 FwEnumStoreType
void setValue_handlerBase(FwIndexType portNum, const Svc::PolyDbCfg::PolyDbEntry &entry, Svc::MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val)
Handler base-class function for input port setValue.
static constexpr FwIndexType getNum_setValue_InputPorts()
virtual ~PolyDbComponentBase()
Destroy PolyDbComponentBase object.
Svc::InputPolyPort * get_setValue_InputPort(FwIndexType portNum)
void init()
Object initializer.
Definition: ObjBase.cpp:24
PolyDbComponentBase(const char *compName="")
Construct PolyDbComponentBase object.
virtual void getValue_handler(FwIndexType portNum, const Svc::PolyDbCfg::PolyDbEntry &entry, Svc::MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val)=0
Handler for input port getValue.
virtual void unLock()
Unlock the guarded mutex.
An enumeration for measurement status.
Auto-generated base for PolyDb component.
virtual void lock()
Lock the guarded mutex.
PlatformIndexType FwIndexType
Svc::InputPolyPort * get_getValue_InputPort(FwIndexType portNum)
void getValue_handlerBase(FwIndexType portNum, const Svc::PolyDbCfg::PolyDbEntry &entry, Svc::MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val)
Handler base-class function for input port getValue.
friend class PolyDbTester
Friend class tester implementation to support white-box testing.
virtual void setValue_handler(FwIndexType portNum, const Svc::PolyDbCfg::PolyDbEntry &entry, Svc::MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val)=0
Handler for input port setValue.
RateGroupDivider component implementation.