fsfw/src/fsfw/osal/rtems/SemaphoreFactory.cpp

30 lines
927 B
C++
Raw Normal View History

2021-07-16 12:33:19 +02:00
#include "fsfw/osal/rtems/BinarySemaphore.h"
2023-02-09 15:58:48 +01:00
// #include "fsfw/osal/rtems/CountingSemaphore.h"
2021-07-16 12:33:19 +02:00
#include "fsfw/serviceinterface/ServiceInterface.h"
2022-02-02 10:29:30 +01:00
#include "fsfw/tasks/SemaphoreFactory.h"
2021-07-16 12:33:19 +02:00
SemaphoreFactory* SemaphoreFactory::factoryInstance = nullptr;
2022-02-02 10:29:30 +01:00
SemaphoreFactory::SemaphoreFactory() {}
2021-07-16 12:33:19 +02:00
2022-02-02 10:29:30 +01:00
SemaphoreFactory::~SemaphoreFactory() { delete factoryInstance; }
2021-07-16 12:33:19 +02:00
SemaphoreFactory* SemaphoreFactory::instance() {
2022-02-02 10:29:30 +01:00
if (factoryInstance == nullptr) {
factoryInstance = new SemaphoreFactory();
}
return SemaphoreFactory::factoryInstance;
2021-07-16 12:33:19 +02:00
}
SemaphoreIF* SemaphoreFactory::createBinarySemaphore(uint32_t argument) {
2022-02-02 10:29:30 +01:00
return new BinarySemaphore();
2021-07-16 12:33:19 +02:00
}
2022-02-02 10:29:30 +01:00
SemaphoreIF* SemaphoreFactory::createCountingSemaphore(uint8_t maxCount, uint8_t initCount,
uint32_t argument) {
return nullptr;
2021-07-16 12:33:19 +02:00
}
2022-02-02 10:29:30 +01:00
void SemaphoreFactory::deleteSemaphore(SemaphoreIF* semaphore) { delete semaphore; }