#include #include #include #include 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() { return new BinarySemaphore(); } SemaphoreIF* SemaphoreFactory::createCountingSemaphore(uint8_t count, uint8_t initCount) { return new CountingSemaphore(count, initCount); } void SemaphoreFactory::deleteMutex(SemaphoreIF* semaphore) { delete semaphore; }