1
0
forked from fsfw/fsfw

correct preprocessor define now used

This commit is contained in:
2021-01-03 14:16:52 +01:00
parent 4515c0d3cd
commit 2edf158312
100 changed files with 356 additions and 356 deletions

View File

@ -1,7 +1,7 @@
#include "ObjectManager.h"
#include "../serviceinterface/ServiceInterfaceStream.h"
#if CPP_OSTREAM_ENABLED == 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
#include <iomanip>
#endif
#include <cstdlib>
@ -21,13 +21,13 @@ ObjectManager::~ObjectManager() {
ReturnValue_t ObjectManager::insert( object_id_t id, SystemObjectIF* object) {
auto returnPair = objectList.emplace(id, object);
if (returnPair.second) {
#if CPP_OSTREAM_ENABLED == 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
// sif::debug << "ObjectManager::insert: Object " << std::hex
// << (int)id << std::dec << " inserted." << std::endl;
#endif
return this->RETURN_OK;
} else {
#if CPP_OSTREAM_ENABLED == 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "ObjectManager::insert: Object id " << std::hex
<< static_cast<uint32_t> id << std::dec
<< " is already in use!" << std::endl;
@ -41,13 +41,13 @@ ReturnValue_t ObjectManager::insert( object_id_t id, SystemObjectIF* object) {
ReturnValue_t ObjectManager::remove( object_id_t id ) {
if ( this->getSystemObject(id) != NULL ) {
this->objectList.erase( id );
#if CPP_OSTREAM_ENABLED == 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
//sif::debug << "ObjectManager::removeObject: Object " << std::hex
// << (int)id << std::dec << " removed." << std::endl;
#endif
return RETURN_OK;
} else {
#if CPP_OSTREAM_ENABLED == 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "ObjectManager::removeObject: Requested object "
<< std::hex << (int)id << std::dec << " not found." << std::endl;
#endif
@ -72,7 +72,7 @@ ObjectManager::ObjectManager() : produceObjects(nullptr) {
void ObjectManager::initialize() {
if(produceObjects == nullptr) {
#if CPP_OSTREAM_ENABLED == 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "ObjectManager::initialize: Passed produceObjects "
"functions is nullptr!" << std::endl;
#endif
@ -84,7 +84,7 @@ void ObjectManager::initialize() {
for (auto const& it : objectList) {
result = it.second->initialize();
if ( result != RETURN_OK ) {
#if CPP_OSTREAM_ENABLED == 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
object_id_t var = it.first;
sif::error << "ObjectManager::initialize: Object 0x" << std::hex <<
std::setw(8) << std::setfill('0')<< var << " failed to "
@ -95,7 +95,7 @@ void ObjectManager::initialize() {
}
}
if (errorCount > 0) {
#if CPP_OSTREAM_ENABLED == 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "ObjectManager::ObjectManager: Counted " << errorCount
<< " failed initializations." << std::endl;
#endif
@ -105,7 +105,7 @@ void ObjectManager::initialize() {
for (auto const& it : objectList) {
result = it.second->checkObjectConnections();
if ( result != RETURN_OK ) {
#if CPP_OSTREAM_ENABLED == 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "ObjectManager::ObjectManager: Object " << std::hex <<
(int) it.first << " connection check failed with code 0x"
<< result << std::dec << std::endl;
@ -114,7 +114,7 @@ void ObjectManager::initialize() {
}
}
if (errorCount > 0) {
#if CPP_OSTREAM_ENABLED == 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "ObjectManager::ObjectManager: Counted " << errorCount
<< " failed connection checks." << std::endl;
#endif
@ -122,7 +122,7 @@ void ObjectManager::initialize() {
}
void ObjectManager::printList() {
#if CPP_OSTREAM_ENABLED == 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::debug << "ObjectManager: Object List contains:" << std::endl;
for (auto const& it : objectList) {
sif::debug << std::hex << it.first << " | " << it.second << std::endl;