diff --git a/bsp_hosted/core/InitMission.cpp b/bsp_hosted/core/InitMission.cpp index 0bd858e..c983861 100644 --- a/bsp_hosted/core/InitMission.cpp +++ b/bsp_hosted/core/InitMission.cpp @@ -283,7 +283,7 @@ void InitMission::createTasks() { #endif #if OBSW_ADD_DEVICE_HANDLER_DEMO - HasModesIF* assembly = objectManager->get(objects::TEST_ASSEMBLY); + HasModesIF* assembly = ObjectManager::instance()->get(objects::TEST_ASSEMBLY); if (assembly == nullptr){ return; } diff --git a/bsp_hosted/core/ObjectFactory.cpp b/bsp_hosted/core/ObjectFactory.cpp index bf5839e..b61fda1 100644 --- a/bsp_hosted/core/ObjectFactory.cpp +++ b/bsp_hosted/core/ObjectFactory.cpp @@ -1,8 +1,6 @@ -#include - -#include +#include "ObjectFactory.h" +#include "OBSWConfig.h" #include -#include #include #include @@ -21,7 +19,7 @@ #include #include -void ObjectFactory::produce(){ +void ObjectFactory::produce(void* args) { Factory::setStaticFrameworkObjectIds(); #if OBSW_ADD_CORE_COMPONENTS == 1 diff --git a/bsp_hosted/core/ObjectFactory.h b/bsp_hosted/core/ObjectFactory.h index 75d77a5..4b2d84c 100644 --- a/bsp_hosted/core/ObjectFactory.h +++ b/bsp_hosted/core/ObjectFactory.h @@ -4,7 +4,7 @@ namespace ObjectFactory { void setStatics(); -void produce(); +void produce(void* args); }; diff --git a/bsp_hosted/fsfwconfig/pollingsequence/pollingSequenceFactory.h b/bsp_hosted/fsfwconfig/pollingsequence/pollingSequenceFactory.h index 87dd281..b696b78 100644 --- a/bsp_hosted/fsfwconfig/pollingsequence/pollingSequenceFactory.h +++ b/bsp_hosted/fsfwconfig/pollingsequence/pollingSequenceFactory.h @@ -1,7 +1,7 @@ #ifndef POLLINGSEQUENCE_POLLINGSEQUENCFACTORY_H_ #define POLLINGSEQUENCE_POLLINGSEQUENCFACTORY_H_ -#include +#include "OBSWConfig.h" #include class FixedTimeslotTaskIF; diff --git a/bsp_hosted/main.cpp b/bsp_hosted/main.cpp index 839fbab..26b4414 100644 --- a/bsp_hosted/main.cpp +++ b/bsp_hosted/main.cpp @@ -26,8 +26,6 @@ ServiceInterfaceStream sif::warning("WARNING", false); ServiceInterfaceStream sif::error("ERROR", false, true, true); #endif -ObjectManagerIF *objectManager = nullptr; - int main() { utility::commonInitPrint("Hosted", COMPILE_PRINTOUT); @@ -38,7 +36,8 @@ int main() { sif::printInfo("Producing system objects..\n"); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ - objectManager = new ObjectManager(ObjectFactory::produce); + ObjectManager* objManager = ObjectManager::instance(); + objManager->setObjectFactoryFunction(ObjectFactory::produce, nullptr); #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::info << "Objects created successfully.." << std::endl; @@ -47,7 +46,7 @@ int main() { sif::printInfo("Objects created successfully..\n"); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ - objectManager->initialize(); + objManager->initialize(); #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::info << "Creating tasks.." << std::endl; diff --git a/bsp_linux/core/InitMission.cpp b/bsp_linux/core/InitMission.cpp index 81ca23a..d74ba45 100644 --- a/bsp_linux/core/InitMission.cpp +++ b/bsp_linux/core/InitMission.cpp @@ -1,5 +1,5 @@ #include "InitMission.h" -#include +#include "OBSWConfig.h" #include #include @@ -216,7 +216,7 @@ void InitMission::createTasks() { #if OBSW_ADD_DEVICE_HANDLER_DEMO - HasModesIF* assembly = objectManager->get(objects::TEST_ASSEMBLY); + HasModesIF* assembly = ObjectManager::instance()->get(objects::TEST_ASSEMBLY); if (assembly == nullptr){ return; } diff --git a/bsp_linux/core/ObjectFactory.cpp b/bsp_linux/core/ObjectFactory.cpp index 0866c28..6a1fe59 100644 --- a/bsp_linux/core/ObjectFactory.cpp +++ b/bsp_linux/core/ObjectFactory.cpp @@ -20,7 +20,7 @@ #include -void ObjectFactory::produce() { +void ObjectFactory::produce(void* args) { /* Located inside the GenericFactory source file */ Factory::setStaticFrameworkObjectIds(); diff --git a/bsp_linux/core/ObjectFactory.h b/bsp_linux/core/ObjectFactory.h index 0d78319..1151a9e 100644 --- a/bsp_linux/core/ObjectFactory.h +++ b/bsp_linux/core/ObjectFactory.h @@ -4,7 +4,7 @@ namespace ObjectFactory { void setStatics(); - void produce(); + void produce(void* args); }; #endif /* MISSION_CORE_OBJECTFACTORY_H_ */ diff --git a/bsp_linux/main.cpp b/bsp_linux/main.cpp index 4437290..4696be2 100644 --- a/bsp_linux/main.cpp +++ b/bsp_linux/main.cpp @@ -39,7 +39,8 @@ int main() { sif::printInfo("Producing system objects..\n"); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ - objectManager = new ObjectManager(ObjectFactory::produce); + ObjectManager* objManager = ObjectManager::instance(); + objManager->setObjectFactoryFunction(ObjectFactory::produce, nullptr); #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::info << "Objects created successfully.." << std::endl; @@ -48,7 +49,7 @@ int main() { sif::printInfo("Objects created successfully..\n"); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ - objectManager->initialize(); + objManager->initialize(); #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::info << "Creating tasks.." << std::endl; diff --git a/bsp_stm32_freertos/core/InitMission.cpp b/bsp_stm32_freertos/core/InitMission.cpp index 1b9cdcd..e4fa9da 100644 --- a/bsp_stm32_freertos/core/InitMission.cpp +++ b/bsp_stm32_freertos/core/InitMission.cpp @@ -1,6 +1,5 @@ #include "InitMission.h" #include "OBSWConfig.h" - #include "objects/systemObjectList.h" #include "pollingsequence/pollingSequenceFactory.h" @@ -8,7 +7,7 @@ #include "mission/assemblies/TestAssembly.h" #include "fsfw/returnvalues/HasReturnvaluesIF.h" -#include "fsfw/serviceinterface/ServiceInterfaceStream.h" +#include "fsfw/serviceinterface/ServiceInterface.h" #include "fsfw/tasks/FixedTimeslotTaskIF.h" #include "fsfw/tasks/PeriodicTaskIF.h" #include "fsfw/tasks/TaskFactory.h" @@ -195,7 +194,7 @@ void InitMission::createTasks() { #endif #if OBSW_ADD_DEVICE_HANDLER_DEMO - HasModesIF* assembly = objectManager->get(objects::TEST_ASSEMBLY); + HasModesIF* assembly = ObjectManager::instance()->get(objects::TEST_ASSEMBLY); if (assembly == nullptr){ return; } diff --git a/bsp_stm32_freertos/core/ObjectFactory.cpp b/bsp_stm32_freertos/core/ObjectFactory.cpp index 3935aa6..3c13e22 100644 --- a/bsp_stm32_freertos/core/ObjectFactory.cpp +++ b/bsp_stm32_freertos/core/ObjectFactory.cpp @@ -17,7 +17,7 @@ #include #include -void ObjectFactory::produce() { +void ObjectFactory::produce(void* args) { /* Located inside GenericFactory source file */ Factory::setStaticFrameworkObjectIds(); diff --git a/bsp_stm32_freertos/core/ObjectFactory.h b/bsp_stm32_freertos/core/ObjectFactory.h index 0d78319..1151a9e 100644 --- a/bsp_stm32_freertos/core/ObjectFactory.h +++ b/bsp_stm32_freertos/core/ObjectFactory.h @@ -4,7 +4,7 @@ namespace ObjectFactory { void setStatics(); - void produce(); + void produce(void* args); }; #endif /* MISSION_CORE_OBJECTFACTORY_H_ */ diff --git a/bsp_stm32_freertos/main.cpp b/bsp_stm32_freertos/main.cpp index 8383bbe..55c4eb1 100644 --- a/bsp_stm32_freertos/main.cpp +++ b/bsp_stm32_freertos/main.cpp @@ -33,8 +33,6 @@ ServiceInterfaceStream sif::warning("WARNING", true); ServiceInterfaceStream sif::error("ERROR", true); #endif -ObjectManagerIF *objectManager = nullptr; - void initTask(void *parameters); /** @@ -70,8 +68,10 @@ void initTask(void *parameters) { sif::printInfo("Creating objects..\n\r"); #endif - objectManager = new ObjectManager(ObjectFactory::produce); - objectManager->initialize(); + ObjectManager* objManager = ObjectManager::instance(); + objManager->setObjectFactoryFunction(ObjectFactory::produce, nullptr); + objManager->initialize(); + #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::info << "Creating tasks.." << std::endl; #else diff --git a/common/stm32_nucleo/networking/UdpTcLwIpPollingTask.cpp b/common/stm32_nucleo/networking/UdpTcLwIpPollingTask.cpp index 4972976..11cd564 100644 --- a/common/stm32_nucleo/networking/UdpTcLwIpPollingTask.cpp +++ b/common/stm32_nucleo/networking/UdpTcLwIpPollingTask.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -18,7 +19,7 @@ UdpTcLwIpPollingTask::~UdpTcLwIpPollingTask() { } ReturnValue_t UdpTcLwIpPollingTask::initialize() { - udpBridge = objectManager->get(bridgeId); + udpBridge = ObjectManager::instance()->get(bridgeId); if(udpBridge == nullptr) { return ObjectManagerIF::CHILD_INIT_FAILED; } diff --git a/fsfw b/fsfw index 070c3f3..145dd33 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 070c3f3bbfdbddbda54b18cdb5d1c9928640a0dd +Subproject commit 145dd33fb1e467ef7370ccd44671a91d96c60e26 diff --git a/fsfw_hal b/fsfw_hal index c50868c..d194b75 160000 --- a/fsfw_hal +++ b/fsfw_hal @@ -1 +1 @@ -Subproject commit c50868c9dc46e27ae59e79f83f27723766656f08 +Subproject commit d194b759c4781f6384786010c460382de97830c2 diff --git a/misc/eclipse/cmake/FreeRTOS/fsfw-stm32-freertos-debug.launch b/misc/eclipse/cmake/FreeRTOS/fsfw-stm32-freertos-debug.launch index c2dbd65..a8c0c1e 100644 --- a/misc/eclipse/cmake/FreeRTOS/fsfw-stm32-freertos-debug.launch +++ b/misc/eclipse/cmake/FreeRTOS/fsfw-stm32-freertos-debug.launch @@ -59,6 +59,6 @@ - + diff --git a/mission/assemblies/TestAssembly.cpp b/mission/assemblies/TestAssembly.cpp index 86dab25..8f4debc 100644 --- a/mission/assemblies/TestAssembly.cpp +++ b/mission/assemblies/TestAssembly.cpp @@ -1,7 +1,7 @@ #include #include -#include +#include TestAssembly::TestAssembly(object_id_t objectId, object_id_t parentId): @@ -149,8 +149,8 @@ ReturnValue_t TestAssembly::initialize() { if(result != RETURN_OK){ return result; } - handler0 = objectManager->get(objects::TEST_DEVICE_HANDLER_0); - handler1 = objectManager->get(objects::TEST_DEVICE_HANDLER_1); + handler0 = ObjectManager::instance()->get(objects::TEST_DEVICE_HANDLER_0); + handler1 = ObjectManager::instance()->get(objects::TEST_DEVICE_HANDLER_1); if((handler0 == nullptr) or (handler1 == nullptr)){ return HasReturnvaluesIF::RETURN_FAILED; } diff --git a/mission/controller/TestController.cpp b/mission/controller/TestController.cpp index 46f75f3..385d07b 100644 --- a/mission/controller/TestController.cpp +++ b/mission/controller/TestController.cpp @@ -1,7 +1,8 @@ #include "TestController.h" -#include +#include "OBSWConfig.h" #include +#include #include TestController::TestController(object_id_t objectId, size_t commandQueueDepth): @@ -161,7 +162,7 @@ ReturnValue_t TestController::initializeLocalDataPool(localpool::DataPool &local ReturnValue_t TestController::initializeAfterTaskCreation() { namespace td = testdevice; - HasLocalDataPoolIF* device0 = objectManager->get( + HasLocalDataPoolIF* device0 = ObjectManager::instance()->get( objects::TEST_DEVICE_HANDLER_0); if(device0 == nullptr) { #if FSFW_CPP_OSTREAM_ENABLED == 1 @@ -183,7 +184,7 @@ ReturnValue_t TestController::initializeAfterTaskCreation() { } - HasLocalDataPoolIF* device1 = objectManager->get( + HasLocalDataPoolIF* device1 = ObjectManager::instance()->get( objects::TEST_DEVICE_HANDLER_1); if(device1 == nullptr) { #if FSFW_CPP_OSTREAM_ENABLED == 1 diff --git a/mission/utility/TmFunnel.cpp b/mission/utility/TmFunnel.cpp index b98c9e9..120cf4a 100644 --- a/mission/utility/TmFunnel.cpp +++ b/mission/utility/TmFunnel.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -81,7 +82,7 @@ ReturnValue_t TmFunnel::handlePacket(TmTcMessage* message) { ReturnValue_t TmFunnel::initialize() { - tmPool = objectManager->get(objects::TM_STORE); + tmPool = ObjectManager::instance()->get(objects::TM_STORE); if(tmPool == nullptr) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "TmFunnel::initialize: TM store not set." << std::endl; @@ -91,8 +92,8 @@ ReturnValue_t TmFunnel::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } - AcceptsTelemetryIF* tmTarget = - objectManager->get(downlinkDestination); + AcceptsTelemetryIF* tmTarget = ObjectManager::instance()-> + get(downlinkDestination); if(tmTarget == nullptr){ #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "TmFunnel::initialize: Downlink Destination not set." << std::endl; @@ -108,8 +109,8 @@ ReturnValue_t TmFunnel::initialize() { return SystemObject::initialize(); } - AcceptsTelemetryIF* storageTarget = - objectManager->get(storageDestination); + AcceptsTelemetryIF* storageTarget = ObjectManager::instance()-> + get(storageDestination); if(storageTarget != nullptr) { storageQueue->setDefaultDestination( storageTarget->getReportReceptionQueue()); diff --git a/test/FsfwExampleTask.cpp b/test/FsfwExampleTask.cpp index 3476ab9..7fe35ac 100644 --- a/test/FsfwExampleTask.cpp +++ b/test/FsfwExampleTask.cpp @@ -1,9 +1,10 @@ #include "FsfwExampleTask.h" -#include -#include -#include +#include "OBSWConfig.h" +#include "commonSystemObjects.h" +#include "objects/systemObjectList.h" #include +#include #include #include #include @@ -83,8 +84,7 @@ object_id_t FsfwExampleTask::getSender() { ReturnValue_t FsfwExampleTask::initialize() { // Get the dataset of the sender. Will be cached for later checks. object_id_t sender = getSender(); - HasLocalDataPoolIF* senderIF = - objectManager->get(sender); + HasLocalDataPoolIF* senderIF = ObjectManager::instance()->get(sender); if(senderIF == nullptr) { #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::error << "FsfwDemoTask::initialize: Sender object invalid!" << std::endl; @@ -163,7 +163,7 @@ ReturnValue_t FsfwExampleTask::performMonitoringDemo() { ReturnValue_t FsfwExampleTask::performSendOperation() { object_id_t nextRecipient = getNextRecipient(); - FsfwExampleTask* target = objectManager->get(nextRecipient); + FsfwExampleTask* target = ObjectManager::instance()->get(nextRecipient); if (target == nullptr) { /* Configuration error */ #if FSFW_CPP_OSTREAM_ENABLED == 1 diff --git a/test/TestTask.cpp b/test/TestTask.cpp index b1353d5..cb1a79d 100644 --- a/test/TestTask.cpp +++ b/test/TestTask.cpp @@ -1,6 +1,6 @@ #include "TestTask.h" -#include +#include #include bool TestTask::oneShotAction = true; @@ -12,7 +12,7 @@ TestTask::TestTask(object_id_t objectId, bool periodicPrintout): if(testLock == nullptr) { testLock = MutexFactory::instance()->createMutex(); } - IPCStore = objectManager->get(objects::IPC_STORE); + IPCStore = ObjectManager::instance()->get(objects::IPC_STORE); } TestTask::~TestTask() {