ObjectManagerIF: remove config include + nullptr check for get call #67

Closed
opened 2020-05-07 12:34:36 +02:00 by muellerr · 0 comments
Owner

The object manager IF includes the system object list from the configuration folder. It does not really need to include that folder from what I have seen. The problem is when there are multiple configuration folders.

For example, I use a separate linux build folder which includes its own config folder.
The build system usually includes the root path
so includes like <framework/...>
and <config/...> work.

If I want to use the linux configuration I have to take special care of using <linux/config/..>, but that's okay given I use multiple configurations. But now the object manager IF includes <config/...> (not the right header file) and I got weird errors and wondered for 20 minutes why the compiler complained about multiple inclusions.

I suggest removing the header file. I had to include <config/objects/systemObjectList.h> at 4-5 other spots in the mission code after I did that but other than that everything still works as before. This is not really an API change but removing that header might lead to code not compiling because new includes are required.

Also a nullptr check for the get function might be a good idea to check whether the global object manager actually was created.. otherwise the software just crashes.

UPDATE: I added back the include, but in the following form
#include "systemObjectList.h"

That means the file has to be included by the build system (config.mk file) but allows multiple systemObjectList.h files for different build configurations.

The object manager IF includes the system object list from the configuration folder. It does not really need to include that folder from what I have seen. The problem is when there are multiple configuration folders. For example, I use a separate linux build folder which includes its own config folder. The build system usually includes the root path so includes like <framework/...> and <config/...> work. If I want to use the linux configuration I have to take special care of using <linux/config/..>, but that's okay given I use multiple configurations. But now the object manager IF includes <config/...> (not the right header file) and I got weird errors and wondered for 20 minutes why the compiler complained about multiple inclusions. I suggest removing the header file. I had to include <config/objects/systemObjectList.h> at 4-5 other spots in the mission code after I did that but other than that everything still works as before. This is not really an API change but removing that header might lead to code not compiling because new includes are required. Also a nullptr check for the get function might be a good idea to check whether the global object manager actually was created.. otherwise the software just crashes. UPDATE: I added back the include, but in the following form `#include "systemObjectList.h"` That means the file has to be included by the build system (config.mk file) but allows multiple systemObjectList.h files for different build configurations.
muellerr added the
question
API Change
labels 2020-05-07 12:34:36 +02:00
muellerr changed title from Object Manager: remove config include to `ObjectManagerIF`: remove config include 2020-05-07 12:35:22 +02:00
muellerr changed title from `ObjectManagerIF`: remove config include to ObjectManagerIF: remove config include 2020-05-07 12:35:33 +02:00
muellerr changed title from ObjectManagerIF: remove config include to ObjectManagerIF: remove config include + nullptr check for get call 2020-05-07 12:46:55 +02:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: fsfw/fsfw#67
No description provided.