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..6ffa5f8 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,9 @@ 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 +47,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;