From 6f562e5f3ed6ff971cad6e95f3f689f0a9c6e953 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 4 Oct 2022 10:25:58 +0200 Subject: [PATCH 1/4] missing retval conv --- src/fsfw_tests/integration/devices/TestDeviceHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fsfw_tests/integration/devices/TestDeviceHandler.cpp b/src/fsfw_tests/integration/devices/TestDeviceHandler.cpp index 01f0494b8..fdf02a707 100644 --- a/src/fsfw_tests/integration/devices/TestDeviceHandler.cpp +++ b/src/fsfw_tests/integration/devices/TestDeviceHandler.cpp @@ -646,7 +646,7 @@ ReturnValue_t TestDevice::initializeLocalDataPool(localpool::DataPool& localData /* Subscribe for periodic HK packets but do not enable reporting for now. Non-diangostic with a period of one second */ poolManager.subscribeForRegularPeriodicPacket({sid, false, 1.0}); - return HasReturnvaluesIF::RETURN_OK; + return returnvalue::OK; } ReturnValue_t TestDevice::getParameter(uint8_t domainId, uint8_t uniqueId, -- 2.34.1 From cdbf20bae7344cf80bc618357b7c7453360d1ad8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 4 Oct 2022 10:47:27 +0200 Subject: [PATCH 2/4] remove weird prod callback --- src/fsfw/objectmanager/ObjectManager.cpp | 6 ------ src/fsfw/objectmanager/ObjectManager.h | 5 ----- 2 files changed, 11 deletions(-) diff --git a/src/fsfw/objectmanager/ObjectManager.cpp b/src/fsfw/objectmanager/ObjectManager.cpp index ddf5ab802..18c85b463 100644 --- a/src/fsfw/objectmanager/ObjectManager.cpp +++ b/src/fsfw/objectmanager/ObjectManager.cpp @@ -16,11 +16,6 @@ ObjectManager* ObjectManager::instance() { return objManagerInstance; } -void ObjectManager::setObjectFactoryFunction(produce_function_t objFactoryFunc, void* factoryArgs) { - this->objectFactoryFunction = objFactoryFunc; - this->factoryArgs = factoryArgs; -} - ObjectManager::ObjectManager() = default; ObjectManager::~ObjectManager() { @@ -89,7 +84,6 @@ void ObjectManager::initialize() { #endif return; } - objectFactoryFunction(factoryArgs); ReturnValue_t result = returnvalue::FAILED; uint32_t errorCount = 0; for (auto const& it : objectList) { diff --git a/src/fsfw/objectmanager/ObjectManager.h b/src/fsfw/objectmanager/ObjectManager.h index e0e747924..0ef9cae1e 100644 --- a/src/fsfw/objectmanager/ObjectManager.h +++ b/src/fsfw/objectmanager/ObjectManager.h @@ -21,7 +21,6 @@ */ class ObjectManager : public ObjectManagerIF { public: - using produce_function_t = void (*)(void* args); /** * Returns the single instance of TaskFactory. @@ -30,8 +29,6 @@ class ObjectManager : public ObjectManagerIF { */ static ObjectManager* instance(); - void setObjectFactoryFunction(produce_function_t prodFunc, void* args); - template T* get(object_id_t id); @@ -54,8 +51,6 @@ class ObjectManager : public ObjectManagerIF { * @param The id of the object to be created. * @return Returns a pointer to the newly created object or NULL. */ - produce_function_t objectFactoryFunction = nullptr; - void* factoryArgs = nullptr; private: ObjectManager(); -- 2.34.1 From 5a9d37f5d80ce2e0ec6d4be1a1f4f550ef7e5358 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 4 Oct 2022 10:51:22 +0200 Subject: [PATCH 3/4] remove check --- src/fsfw/objectmanager/ObjectManager.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/fsfw/objectmanager/ObjectManager.cpp b/src/fsfw/objectmanager/ObjectManager.cpp index 18c85b463..4afab2968 100644 --- a/src/fsfw/objectmanager/ObjectManager.cpp +++ b/src/fsfw/objectmanager/ObjectManager.cpp @@ -74,16 +74,6 @@ SystemObjectIF* ObjectManager::getSystemObject(object_id_t id) { } void ObjectManager::initialize() { - if (objectFactoryFunction == nullptr) { -#if FSFW_CPP_OSTREAM_ENABLED == 1 - sif::error << "ObjectManager::initialize: Passed produceObjects " - "functions is nullptr!" - << std::endl; -#else - sif::printError("ObjectManager::initialize: Passed produceObjects functions is nullptr!\n"); -#endif - return; - } ReturnValue_t result = returnvalue::FAILED; uint32_t errorCount = 0; for (auto const& it : objectList) { -- 2.34.1 From 7382d0b38a4ab92d5c578259d1365a9dc45c0bb3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 4 Oct 2022 13:24:41 +0200 Subject: [PATCH 4/4] that should do the job --- unittests/CatchSetup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittests/CatchSetup.cpp b/unittests/CatchSetup.cpp index 9206c2e18..aa4cdcbab 100644 --- a/unittests/CatchSetup.cpp +++ b/unittests/CatchSetup.cpp @@ -25,7 +25,7 @@ ServiceInterfaceStream warning("WARNING"); int customSetup() { // global setup ObjectManager* objMan = ObjectManager::instance(); - objMan->setObjectFactoryFunction(Factory::produceFrameworkObjects, nullptr); + Factory::produceFrameworkObjects(nullptr); objMan->initialize(); return 0; } -- 2.34.1