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"
14 #include "Os/Mutex.hpp"
16 
17 namespace Svc {
18 
25  {
26 
27  // ----------------------------------------------------------------------
28  // Friend classes
29  // ----------------------------------------------------------------------
30 
32  friend class PolyDbTesterBase;
34  friend class PolyDbTester;
35 
36  protected:
37 
38  // ----------------------------------------------------------------------
39  // Constants
40  // ----------------------------------------------------------------------
41 
43  enum {
46  };
47 
48  public:
49 
50  // ----------------------------------------------------------------------
51  // Component initialization
52  // ----------------------------------------------------------------------
53 
55  void init(
56  FwEnumStoreType instance = 0
57  );
58 
59  public:
60 
61  // ----------------------------------------------------------------------
62  // Getters for typed input ports
63  // ----------------------------------------------------------------------
64 
69  FwIndexType portNum
70  );
71 
76  FwIndexType portNum
77  );
78 
79  protected:
80 
81  // ----------------------------------------------------------------------
82  // Component construction and destruction
83  // ----------------------------------------------------------------------
84 
87  const char* compName = ""
88  );
89 
91  virtual ~PolyDbComponentBase();
92 
93  protected:
94 
95  // ----------------------------------------------------------------------
96  // Getters for numbers of typed input ports
97  // ----------------------------------------------------------------------
98 
104  }
105 
111  }
112 
113  protected:
114 
115  // ----------------------------------------------------------------------
116  // Handlers to implement for typed input ports
117  // ----------------------------------------------------------------------
118 
120  virtual void getValue_handler(
121  FwIndexType portNum,
122  const Svc::PolyDbCfg::PolyDbEntry& entry,
123  Svc::MeasurementStatus& status,
124  Fw::Time& time,
125  Fw::PolyType& val
126  ) = 0;
127 
129  virtual void setValue_handler(
130  FwIndexType portNum,
131  const Svc::PolyDbCfg::PolyDbEntry& entry,
132  Svc::MeasurementStatus& status,
133  Fw::Time& time,
134  Fw::PolyType& val
135  ) = 0;
136 
137  protected:
138 
139  // ----------------------------------------------------------------------
140  // Port handler base-class functions for typed input ports
141  //
142  // Call these functions directly to bypass the corresponding ports
143  // ----------------------------------------------------------------------
144 
147  FwIndexType portNum,
148  const Svc::PolyDbCfg::PolyDbEntry& entry,
149  Svc::MeasurementStatus& status,
150  Fw::Time& time,
151  Fw::PolyType& val
152  );
153 
156  FwIndexType portNum,
157  const Svc::PolyDbCfg::PolyDbEntry& entry,
158  Svc::MeasurementStatus& status,
159  Fw::Time& time,
160  Fw::PolyType& val
161  );
162 
163  protected:
164 
165  // ----------------------------------------------------------------------
166  // Mutex operations for guarded ports
167  //
168  // You can override these operations to provide more sophisticated
169  // synchronization
170  // ----------------------------------------------------------------------
171 
173  virtual void lock();
174 
176  virtual void unLock();
177 
178  private:
179 
180  // ----------------------------------------------------------------------
181  // Calls for messages received on typed input ports
182  // ----------------------------------------------------------------------
183 
185  static void m_p_getValue_in(
186  Fw::PassiveComponentBase* callComp,
187  FwIndexType portNum,
188  const Svc::PolyDbCfg::PolyDbEntry& entry,
189  Svc::MeasurementStatus& status,
190  Fw::Time& time,
191  Fw::PolyType& val
192  );
193 
195  static void m_p_setValue_in(
196  Fw::PassiveComponentBase* callComp,
197  FwIndexType portNum,
198  const Svc::PolyDbCfg::PolyDbEntry& entry,
199  Svc::MeasurementStatus& status,
200  Fw::Time& time,
201  Fw::PolyType& val
202  );
203 
204  private:
205 
206  // ----------------------------------------------------------------------
207  // Typed input ports
208  // ----------------------------------------------------------------------
209 
211  Svc::InputPolyPort m_getValue_InputPort[NUM_GETVALUE_INPUT_PORTS];
212 
214  Svc::InputPolyPort m_setValue_InputPort[NUM_SETVALUE_INPUT_PORTS];
215 
216  private:
217 
218  // ----------------------------------------------------------------------
219  // Mutexes
220  // ----------------------------------------------------------------------
221 
223  Os::Mutex m_guardedPortMutex;
224 
225  };
226 
227 }
228 
229 #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.