F´ Flight Software - C/C++ Documentation
devel
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 <
Svc/PolyDb/PolyDb.hpp
>
9
#include <
Fw/Types/Assert.hpp
>
10
#include <
FpConfig.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 ::
21
getValue_handler(
22
NATIVE_INT_TYPE
portNum,
23
const
Svc::PolyDbCfg::PolyDbEntry
& entry,
24
Svc::MeasurementStatus
& status,
25
Fw::Time
& time,
26
Fw::PolyType
& val)
27
{
28
FW_ASSERT
(entry.
isValid
(),entry.
e
);
29
status = this->m_db[entry.
e
].status;
30
time = this->m_db[entry.
e
].time;
31
val = this->m_db[entry.
e
].val;
32
}
33
34
void
PolyDb ::
35
setValue_handler(
36
NATIVE_INT_TYPE
portNum,
37
const
Svc::PolyDbCfg::PolyDbEntry
& entry,
38
Svc::MeasurementStatus
& status,
39
Fw::Time
& time,
40
Fw::PolyType
& val)
41
{
42
FW_ASSERT
(entry.
isValid
(),entry.
e
);
43
this->m_db[entry.
e
].status = status;
44
this->m_db[entry.
e
].time = time;
45
this->m_db[entry.
e
].val = val;
46
}
47
48
PolyDb::~PolyDb
() {
49
}
50
51
}
Assert.hpp
FW_ASSERT
#define FW_ASSERT(...)
Definition:
Assert.hpp:14
NATIVE_INT_TYPE
PlatformIntType NATIVE_INT_TYPE
Definition:
BasicTypes.h:55
FwIndexType
PlatformIndexType FwIndexType
Definition:
FpConfig.h:25
FpConfig.hpp
C++-compatible configuration header for fprime configuration.
PolyDb.hpp
PolyDb is a database for storing telemetry for internal software use.
Fw::PolyType
Definition:
PolyType.hpp:11
Fw::Time
Definition:
Time.hpp:9
Svc::MeasurementStatus
An enumeration for measurement status.
Definition:
MeasurementStatusEnumAc.hpp:19
Svc::MeasurementStatus::STALE
@ STALE
Measurement is stale.
Definition:
MeasurementStatusEnumAc.hpp:37
Svc::PolyDbCfg::PolyDbEntry
Definition:
PolyDbEntryEnumAc.hpp:22
Svc::PolyDbCfg::PolyDbEntry::isValid
bool isValid() const
Check raw enum value for validity.
Definition:
PolyDbEntryEnumAc.cpp:51
Svc::PolyDbCfg::PolyDbEntry::NUM_CONSTANTS
@ NUM_CONSTANTS
The number of enumerated constants.
Definition:
PolyDbEntryEnumAc.hpp:68
Svc::PolyDbCfg::PolyDbEntry::e
T e
The raw enum value.
Definition:
PolyDbEntryEnumAc.hpp:178
Svc::PolyDbComponentBase
Auto-generated base for PolyDb component.
Definition:
PolyDbComponentAc.hpp:25
Svc::PolyDb::~PolyDb
virtual ~PolyDb()
PolyDbImpl destructor.
Definition:
PolyDb.cpp:48
Svc::PolyDb::PolyDb
PolyDb(const char *const name)
PolyDbImpl constructor.
Definition:
PolyDb.cpp:13
Svc
Definition:
ActiveRateGroupCfg.hpp:18
Svc
PolyDb
PolyDb.cpp
Generated by
1.9.1