action
container
contrib
controller
coordinates
datalinklayer
datapool
datapoollocal
defaultcfg
devicehandlers
doc
events
fdir
globalfunctions
health
housekeeping
internalError
ipc
logo
memory
modes
monitoring
objectmanager
osal
FreeRTOS
host
linux
BinarySemaphore.cpp
BinarySemaphore.h
CMakeLists.txt
Clock.cpp
CountingSemaphore.cpp
CountingSemaphore.h
FixedTimeslotTask.cpp
FixedTimeslotTask.h
InternalErrorCodes.cpp
MessageQueue.cpp
MessageQueue.h
Mutex.cpp
Mutex.h
MutexFactory.cpp
PeriodicPosixTask.cpp
PeriodicPosixTask.h
PosixThread.cpp
PosixThread.h
QueueFactory.cpp
SemaphoreFactory.cpp
TaskFactory.cpp
TcUnixUdpPollingTask.cpp
TcUnixUdpPollingTask.h
Timer.cpp
Timer.h
TmTcUnixUdpBridge.cpp
TmTcUnixUdpBridge.h
rtems
windows
CMakeLists.txt
Endiness.h
InternalErrorCodes.h
parameters
power
pus
returnvalues
rmap
serialize
serviceinterface
storagemanager
subsystem
tasks
tcdistribution
thermal
timemanager
tmstorage
tmtcpacket
tmtcservices
unittest
.gitignore
.gitmodules
CHANGELOG
CMakeLists.txt
FSFWVersion.h
LICENSE
NOTICE
README.md
fsfw.mk
35 lines
885 B
C++
35 lines
885 B
C++
#include "BinarySemaphore.h"
|
|
#include "CountingSemaphore.h"
|
|
|
|
#include "../../tasks/SemaphoreFactory.h"
|
|
#include "../../serviceinterface/ServiceInterfaceStream.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 arguments) {
|
|
return new BinarySemaphore();
|
|
}
|
|
|
|
SemaphoreIF* SemaphoreFactory::createCountingSemaphore(const uint8_t maxCount,
|
|
uint8_t initCount, uint32_t arguments) {
|
|
return new CountingSemaphore(maxCount, initCount);
|
|
}
|
|
|
|
void SemaphoreFactory::deleteSemaphore(SemaphoreIF* semaphore) {
|
|
delete semaphore;
|
|
}
|