small improvements for object manager.cpp
exit removed for get function
This commit is contained in:
parent
93ef4eb56b
commit
365f9f8434
@ -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++;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user