2020-09-22 16:10:43 +02:00
|
|
|
#ifndef FSFW_IPC_QUEUEFACTORY_H_
|
|
|
|
#define FSFW_IPC_QUEUEFACTORY_H_
|
|
|
|
|
2020-08-13 20:53:35 +02:00
|
|
|
#include "MessageQueueIF.h"
|
2020-09-29 15:22:38 +02:00
|
|
|
#include "MessageQueueMessage.h"
|
2020-12-14 11:22:44 +01:00
|
|
|
|
2020-09-29 15:22:38 +02:00
|
|
|
#include <cstdint>
|
|
|
|
|
2018-07-12 16:29:32 +02:00
|
|
|
/**
|
|
|
|
* Creates message queues.
|
|
|
|
* This class is a "singleton" interface, i.e. it provides an
|
|
|
|
* interface, but also is the base class for a singleton.
|
|
|
|
*/
|
|
|
|
class QueueFactory {
|
|
|
|
public:
|
|
|
|
virtual ~QueueFactory();
|
|
|
|
/**
|
|
|
|
* Returns the single instance of QueueFactory.
|
|
|
|
* The implementation of #instance is found in its subclasses.
|
|
|
|
* Thus, we choose link-time variability of the instance.
|
|
|
|
*/
|
|
|
|
static QueueFactory* instance();
|
|
|
|
|
2020-06-06 15:47:33 +02:00
|
|
|
MessageQueueIF* createMessageQueue(uint32_t messageDepth = 3,
|
|
|
|
size_t maxMessageSize = MessageQueueMessage::MAX_MESSAGE_SIZE);
|
2018-07-12 16:29:32 +02:00
|
|
|
|
|
|
|
void deleteMessageQueue(MessageQueueIF* queue);
|
|
|
|
private:
|
|
|
|
/**
|
|
|
|
* External instantiation is not allowed.
|
|
|
|
*/
|
|
|
|
QueueFactory();
|
|
|
|
static QueueFactory* factoryInstance;
|
|
|
|
};
|
|
|
|
|
2020-09-22 16:10:43 +02:00
|
|
|
#endif /* FSFW_IPC_QUEUEFACTORY_H_ */
|