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
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
Fw::Time
Definition:
Time.hpp:11
Fw::PolyType
Definition:
PolyType.hpp:11
FPrimeBasicTypes.hpp
Svc::PolyDbCfg::PolyDbEntry::isValid
bool isValid() const
Check raw enum value for validity.
Definition:
PolyDbEntryEnumAc.cpp:51
Svc::MeasurementStatus
An enumeration for measurement status.
Definition:
MeasurementStatusEnumAc.hpp:17
Svc::PolyDbComponentBase
Auto-generated base for PolyDb component.
Definition:
PolyDbComponentAc.hpp:23
Assert.hpp
Svc::PolyDbCfg::PolyDbEntry
Definition:
PolyDbEntryEnumAc.hpp:20
Svc::PolyDbCfg::PolyDbEntry::NUM_CONSTANTS
The number of enumerated constants.
Definition:
PolyDbEntryEnumAc.hpp:68
Svc::MeasurementStatus::STALE
Measurement is stale.
Definition:
MeasurementStatusEnumAc.hpp:37
FwIndexType
PlatformIndexType FwIndexType
Definition:
FwIndexTypeAliasAc.h:15
Svc
RateGroupDivider component implementation.
Definition:
ActiveRateGroupCfg.hpp:18
Svc::PolyDb::PolyDb
PolyDb(const char *const name)
PolyDbImpl constructor.
Definition:
PolyDb.cpp:13
PolyDb.hpp
PolyDb is a database for storing telemetry for internal software use.
FW_ASSERT
#define FW_ASSERT(...)
Definition:
Assert.hpp:14
Svc::PolyDb::~PolyDb
virtual ~PolyDb()
PolyDbImpl destructor.
Definition:
PolyDb.cpp:42
Svc::PolyDbCfg::PolyDbEntry::e
T e
The raw enum value.
Definition:
PolyDbEntryEnumAc.hpp:178
Svc
PolyDb
PolyDb.cpp
Generated by
1.8.14