object manager is now a singleton
This commit is contained in:
@ -1,13 +1,8 @@
|
||||
/**
|
||||
* @file LimitViolationReporter.cpp
|
||||
* @brief This file defines the LimitViolationReporter class.
|
||||
* @date 17.07.2014
|
||||
* @author baetz
|
||||
*/
|
||||
#include "LimitViolationReporter.h"
|
||||
#include "MonitoringIF.h"
|
||||
#include "ReceivesMonitoringReportsIF.h"
|
||||
#include "../objectmanager/ObjectManagerIF.h"
|
||||
|
||||
#include "../objectmanager/ObjectManager.h"
|
||||
#include "../serialize/SerializeAdapter.h"
|
||||
|
||||
ReturnValue_t LimitViolationReporter::sendLimitViolationReport(const SerializeIF* data) {
|
||||
@ -16,7 +11,7 @@ ReturnValue_t LimitViolationReporter::sendLimitViolationReport(const SerializeIF
|
||||
return result;
|
||||
}
|
||||
store_address_t storeId;
|
||||
uint8_t* dataTarget = NULL;
|
||||
uint8_t* dataTarget = nullptr;
|
||||
size_t maxSize = data->getSerializedSize();
|
||||
if (maxSize > MonitoringIF::VIOLATION_REPORT_MAX_SIZE) {
|
||||
return MonitoringIF::INVALID_SIZE;
|
||||
@ -38,16 +33,16 @@ ReturnValue_t LimitViolationReporter::sendLimitViolationReport(const SerializeIF
|
||||
|
||||
ReturnValue_t LimitViolationReporter::checkClassLoaded() {
|
||||
if (reportQueue == 0) {
|
||||
ReceivesMonitoringReportsIF* receiver = objectManager->get<
|
||||
ReceivesMonitoringReportsIF* receiver = ObjectManager::instance()->get<
|
||||
ReceivesMonitoringReportsIF>(reportingTarget);
|
||||
if (receiver == NULL) {
|
||||
if (receiver == nullptr) {
|
||||
return ObjectManagerIF::NOT_FOUND;
|
||||
}
|
||||
reportQueue = receiver->getCommandQueue();
|
||||
}
|
||||
if (ipcStore == NULL) {
|
||||
ipcStore = objectManager->get<StorageManagerIF>(objects::IPC_STORE);
|
||||
if (ipcStore == NULL) {
|
||||
if (ipcStore == nullptr) {
|
||||
ipcStore = ObjectManager::instance()->get<StorageManagerIF>(objects::IPC_STORE);
|
||||
if (ipcStore == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
}
|
||||
@ -56,5 +51,5 @@ ReturnValue_t LimitViolationReporter::checkClassLoaded() {
|
||||
|
||||
//Lazy initialization.
|
||||
MessageQueueId_t LimitViolationReporter::reportQueue = 0;
|
||||
StorageManagerIF* LimitViolationReporter::ipcStore = NULL;
|
||||
StorageManagerIF* LimitViolationReporter::ipcStore = nullptr;
|
||||
object_id_t LimitViolationReporter::reportingTarget = 0;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "MonitoringMessage.h"
|
||||
#include "../objectmanager/ObjectManagerIF.h"
|
||||
#include "../objectmanager/ObjectManager.h"
|
||||
|
||||
MonitoringMessage::~MonitoringMessage() {
|
||||
}
|
||||
@ -25,7 +25,7 @@ void MonitoringMessage::clear(CommandMessage* message) {
|
||||
message->setCommand(CommandMessage::CMD_NONE);
|
||||
switch (message->getCommand()) {
|
||||
case MonitoringMessage::LIMIT_VIOLATION_REPORT: {
|
||||
StorageManagerIF *ipcStore = objectManager->get<StorageManagerIF>(
|
||||
StorageManagerIF *ipcStore = ObjectManager::instance()->get<StorageManagerIF>(
|
||||
objects::IPC_STORE);
|
||||
if (ipcStore != NULL) {
|
||||
ipcStore->deleteData(getStoreId(message));
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "MonitoringIF.h"
|
||||
|
||||
#include "../datapoollocal/localPoolDefinitions.h"
|
||||
#include "../objectmanager/ObjectManagerIF.h"
|
||||
#include "../objectmanager/ObjectManager.h"
|
||||
#include "../serialize/SerialBufferAdapter.h"
|
||||
#include "../serialize/SerialFixedArrayListAdapter.h"
|
||||
#include "../serialize/SerializeElement.h"
|
||||
@ -71,7 +71,7 @@ private:
|
||||
}
|
||||
bool checkAndSetStamper() {
|
||||
if (timeStamper == nullptr) {
|
||||
timeStamper = objectManager->get<TimeStamperIF>( timeStamperId );
|
||||
timeStamper = ObjectManager::instance()->get<TimeStamperIF>( timeStamperId );
|
||||
if ( timeStamper == nullptr ) {
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "MonitoringReportContent::checkAndSetStamper: "
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "../datapool/PIDReaderList.h"
|
||||
#include "../health/HealthTableIF.h"
|
||||
#include "../parameters/HasParametersIF.h"
|
||||
#include "../objectmanager/ObjectManagerIF.h"
|
||||
#include "../objectmanager/ObjectManager.h"
|
||||
|
||||
|
||||
//SHOULDDO: This is by far not perfect. Could be merged with new Monitor classes. But still, it's over-engineering.
|
||||
@ -64,7 +64,7 @@ public:
|
||||
return result;
|
||||
}
|
||||
ReturnValue_t initialize() {
|
||||
healthTable = objectManager->get<HealthTableIF>(objects::HEALTH_TABLE);
|
||||
healthTable = ObjectManager::instance()->get<HealthTableIF>(objects::HEALTH_TABLE);
|
||||
if (healthTable == NULL) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
|
Reference in New Issue
Block a user