F´ Flight Software - C/C++ Documentation  NASA-v2.0.1
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PolyDbImpl.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 <Fw/Types/BasicTypes.hpp>
11 
12 namespace Svc {
13  PolyDbImpl::PolyDbImpl(const char* name) : PolyDbComponentBase(name) {
14  // initialize all entries to stale
15  for (NATIVE_INT_TYPE entry = 0; entry < POLYDB_NUM_DB_ENTRIES; entry++) {
16  this->m_db[entry].status = MEASUREMENT_STALE;
17  }
18  }
19 
21  PolyDbComponentBase::init(instance);
22  }
23 
24  // If ports are no longer guarded, these accesses need to be protected from each other
25  // If there are a lot of accesses, perhaps an interrupt lock could be used instead of guarded ports
26 
27  void PolyDbImpl::getValue_handler(NATIVE_INT_TYPE portNum, U32 entry, MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val) {
28  FW_ASSERT(entry < POLYDB_NUM_DB_ENTRIES,entry);
29  status = this->m_db[entry].status;
30  time = this->m_db[entry].time;
31  val = this->m_db[entry].val;
32  }
33 
34  void PolyDbImpl::setValue_handler(NATIVE_INT_TYPE portNum, U32 entry, MeasurementStatus &status, Fw::Time &time, Fw::PolyType &val) {
35  FW_ASSERT(entry < POLYDB_NUM_DB_ENTRIES,entry);
36  this->m_db[entry].status = status;
37  this->m_db[entry].time = time;
38  this->m_db[entry].val = val;
39  }
40 
42  }
43 
44 }
Fw::Time
Definition: Time.hpp:10
Assert.hpp
PolyDbImpl.hpp
PolyDb is a database for storing telemetry for internal software use.
Svc::PolyDbImpl::PolyDbImpl
PolyDbImpl(const char *name)
PolyDbImpl constructor.
Definition: PolyDbImpl.cpp:13
FW_ASSERT
#define FW_ASSERT(...)
Definition: Assert.hpp:9
Fw::PolyType
Definition: PolyType.hpp:12
Svc
Definition: ActiveRateGroupImplCfg.hpp:18
Svc::PolyDbImpl::~PolyDbImpl
virtual ~PolyDbImpl()
PolyDbImpl destructor.
Definition: PolyDbImpl.cpp:41
BasicTypes.hpp
Declares ISF basic types.
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:29
Svc::PolyDbImpl::init
void init(NATIVE_INT_TYPE instance)
PolyDbImpl initialization.
Definition: PolyDbImpl.cpp:20