2020-12-14 21:46:33 +01:00
|
|
|
#ifndef FSFW_IPC_MUTEXFACTORY_H_
|
|
|
|
#define FSFW_IPC_MUTEXFACTORY_H_
|
2018-07-12 16:29:32 +02:00
|
|
|
|
2020-08-13 20:53:35 +02:00
|
|
|
#include "MutexIF.h"
|
2018-07-12 16:29:32 +02:00
|
|
|
/**
|
|
|
|
* Creates Mutex.
|
|
|
|
* This class is a "singleton" interface, i.e. it provides an
|
|
|
|
* interface, but also is the base class for a singleton.
|
|
|
|
*/
|
|
|
|
class MutexFactory {
|
|
|
|
public:
|
|
|
|
virtual ~MutexFactory();
|
|
|
|
/**
|
|
|
|
* Returns the single instance of MutexFactory.
|
|
|
|
* The implementation of #instance is found in its subclasses.
|
|
|
|
* Thus, we choose link-time variability of the instance.
|
|
|
|
*/
|
|
|
|
static MutexFactory* instance();
|
|
|
|
|
|
|
|
MutexIF* createMutex();
|
|
|
|
|
|
|
|
void deleteMutex(MutexIF* mutex);
|
|
|
|
|
|
|
|
private:
|
|
|
|
/**
|
|
|
|
* External instantiation is not allowed.
|
|
|
|
*/
|
|
|
|
MutexFactory();
|
|
|
|
static MutexFactory* factoryInstance;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-12-14 21:46:33 +01:00
|
|
|
#endif /* FSFW_IPC_MUTEXFACTORY_H_ */
|