ObjectManagerIF improvements #73

Merged
gaisser merged 13 commits from KSat/fsfw:mueller_objectManagerIF into master 2020-06-08 12:08:26 +02:00
2 changed files with 5 additions and 6 deletions
Showing only changes of commit 365f9f8434 - Show all commits

View File

@ -23,8 +23,8 @@ ReturnValue_t ObjectManager::insert( object_id_t id, SystemObjectIF* object) {
} else {
sif::error << "ObjectManager::insert: Object id " << std::hex
<< (int)id << std::dec << " is already in use!" << std::endl;
exit(0); //This is very severe and difficult to handle in other places.
return this->INSERTION_FAILED;
//This is very severe and difficult to handle in other places.
std::exit(INSERTION_FAILED);
}
}
@ -67,9 +67,9 @@ void ObjectManager::initialize() {
return_value = it->second->initialize();
if ( return_value != RETURN_OK ) {
object_id_t var = it->first;
sif::error << "Object " << std::hex << (int) var
<< " failed to initialize with code 0x" << return_value
<< std::dec << std::endl;
sif::error << "Object 0x" << std::hex << std::setw(8) <<
std::setfill('0')<< var << " failed to initialize " <<
"with code 0x" << return_value << std::dec << std::endl;
error_count++;
Review

std::setfill is not reset.

std::setfill is not reset.
Review

should std::setw be reset as well? how to reset std::setfill?

should std::setw be reset as well? how to reset std::setfill?
Review

okay, i put std::setfill('') at the end

okay, i put std::setfill('') at the end
}
}

View File

@ -87,7 +87,6 @@ T* ObjectManagerIF::get( object_id_t id ) {
if(objectManager == nullptr) {
sif::error << "ObjectManagerIF: Global object manager has not "
"been initialized yet!" << std::endl;
std::exit(1);
}
SystemObjectIF* temp = this->getSystemObject(id);
return dynamic_cast<T*>(temp);