fsfw/src/fsfw/osal/host/SemaphoreFactory.cpp

32 lines
1.1 KiB
C++
Raw Normal View History

#include "fsfw/tasks/SemaphoreFactory.h"
2022-02-02 10:29:30 +01:00
2022-05-09 00:09:13 +02:00
#include "fsfw/serviceinterface.h"
2020-09-05 20:18:52 +02:00
SemaphoreFactory* SemaphoreFactory::factoryInstance = nullptr;
2022-02-02 10:29:30 +01:00
SemaphoreFactory::SemaphoreFactory() {}
2020-09-05 20:18:52 +02:00
2022-02-02 10:29:30 +01:00
SemaphoreFactory::~SemaphoreFactory() { delete factoryInstance; }
2020-09-05 20:18:52 +02:00
SemaphoreFactory* SemaphoreFactory::instance() {
2022-02-02 10:29:30 +01:00
if (factoryInstance == nullptr) {
factoryInstance = new SemaphoreFactory();
}
return SemaphoreFactory::factoryInstance;
2020-09-05 20:18:52 +02:00
}
SemaphoreIF* SemaphoreFactory::createBinarySemaphore(uint32_t arguments) {
2022-02-02 10:29:30 +01:00
// Just gonna wait for full C++20 for now.
2022-05-09 00:09:13 +02:00
FSFW_LOGE("SemaphoreFactory: Binary Semaphore not implemented yet. Returning nullptr!\n");
2022-02-02 10:29:30 +01:00
return nullptr;
2020-09-05 20:18:52 +02:00
}
2022-02-02 10:29:30 +01:00
SemaphoreIF* SemaphoreFactory::createCountingSemaphore(const uint8_t maxCount, uint8_t initCount,
uint32_t arguments) {
// Just gonna wait for full C++20 for now.
2022-05-09 00:09:13 +02:00
FSFW_LOGE("SemaphoreFactory: Counting Semaphore not implemented yet. Returning nullptr!\n");
2022-02-02 10:29:30 +01:00
return nullptr;
2020-09-05 20:18:52 +02:00
}
2022-02-02 10:29:30 +01:00
void SemaphoreFactory::deleteSemaphore(SemaphoreIF* semaphore) { delete semaphore; }