added semaphore factory
This commit is contained in:
parent
a65a184083
commit
291a8d4ea3
@ -14,6 +14,7 @@ target_sources(${LIB_FSFW_NAME}
|
|||||||
RTEMSTaskBase.cpp
|
RTEMSTaskBase.cpp
|
||||||
TaskFactory.cpp
|
TaskFactory.cpp
|
||||||
BinarySemaphore.cpp
|
BinarySemaphore.cpp
|
||||||
|
SemaphoreFactory.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
34
src/osal/rtems/SemaphoreFactory.cpp
Normal file
34
src/osal/rtems/SemaphoreFactory.cpp
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#include "fsfw/osal/rtems/BinarySemaphore.h"
|
||||||
|
//#include "fsfw/osal/rtems/CountingSemaphore.h"
|
||||||
|
|
||||||
|
#include "fsfw/tasks/SemaphoreFactory.h"
|
||||||
|
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||||
|
|
||||||
|
SemaphoreFactory* SemaphoreFactory::factoryInstance = nullptr;
|
||||||
|
|
||||||
|
SemaphoreFactory::SemaphoreFactory() {
|
||||||
|
}
|
||||||
|
|
||||||
|
SemaphoreFactory::~SemaphoreFactory() {
|
||||||
|
delete factoryInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
SemaphoreFactory* SemaphoreFactory::instance() {
|
||||||
|
if (factoryInstance == nullptr){
|
||||||
|
factoryInstance = new SemaphoreFactory();
|
||||||
|
}
|
||||||
|
return SemaphoreFactory::factoryInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
SemaphoreIF* SemaphoreFactory::createBinarySemaphore(uint32_t argument) {
|
||||||
|
return new BinarySemaphore();
|
||||||
|
}
|
||||||
|
|
||||||
|
SemaphoreIF* SemaphoreFactory::createCountingSemaphore(uint8_t maxCount,
|
||||||
|
uint8_t initCount, uint32_t argument) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SemaphoreFactory::deleteSemaphore(SemaphoreIF* semaphore) {
|
||||||
|
delete semaphore;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user