| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * PolyDbImpl.cpp | ||
| 3 | * | ||
| 4 | * Created on: May 13, 2014 | ||
| 5 | * Author: Timothy Canham | ||
| 6 | */ | ||
| 7 | |||
| 8 | #include <Fw/FPrimeBasicTypes.hpp> | ||
| 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 | |||
| 42 | ✗ | PolyDb::~PolyDb() {} | |
| 43 | |||
| 44 | } // namespace Svc | ||
| 45 |