F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
PolyDb.cpp
Go to the documentation of this file.
1 /*
2  * PolyDbImpl.cpp
3  *
4  * Created on: May 13, 2014
5  * Author: Timothy Canham
6  */
7 
9 #include <Fw/Types/Assert.hpp>
10 #include <Svc/PolyDb/PolyDb.hpp>
11 
12 namespace Svc {
13 PolyDb::PolyDb(const char* const name) : PolyDbComponentBase(name) {
14  // initialize all entries to stale
15  for (FwIndexType entry = 0; entry < Svc::PolyDbCfg::PolyDbEntry::NUM_CONSTANTS; entry++) {
16  this->m_db[entry].status = MeasurementStatus::STALE;
17  }
18 }
19 
20 void PolyDb ::getValue_handler(FwIndexType portNum,
21  const Svc::PolyDbCfg::PolyDbEntry& entry,
22  Svc::MeasurementStatus& status,
23  Fw::Time& time,
24  Fw::PolyType& val) {
25  FW_ASSERT(entry.isValid(), entry.e);
26  status = this->m_db[entry.e].status;
27  time = this->m_db[entry.e].time;
28  val = this->m_db[entry.e].val;
29 }
30 
31 void PolyDb ::setValue_handler(FwIndexType portNum,
32  const Svc::PolyDbCfg::PolyDbEntry& entry,
33  Svc::MeasurementStatus& status,
34  Fw::Time& time,
35  Fw::PolyType& val) {
36  FW_ASSERT(entry.isValid(), entry.e);
37  this->m_db[entry.e].status = status;
38  this->m_db[entry.e].time = time;
39  this->m_db[entry.e].val = val;
40 }
41 
43 
44 } // namespace Svc
The number of enumerated constants.
bool isValid() const
Check raw enum value for validity.
An enumeration for measurement status.
Auto-generated base for PolyDb component.
PlatformIndexType FwIndexType
RateGroupDivider component implementation.
PolyDb(const char *const name)
PolyDbImpl constructor.
Definition: PolyDb.cpp:13
PolyDb is a database for storing telemetry for internal software use.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
virtual ~PolyDb()
PolyDbImpl destructor.
Definition: PolyDb.cpp:42
T e
The raw enum value.