2021-07-14 00:54:39 +02:00
|
|
|
#include "fsfw/ipc/QueueFactory.h"
|
2018-07-13 15:56:37 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
#include "fsfw/ipc/MessageQueueSenderIF.h"
|
|
|
|
#include "fsfw/osal/freertos/MessageQueue.h"
|
2018-07-13 15:56:37 +02:00
|
|
|
|
2020-09-26 14:24:09 +02:00
|
|
|
QueueFactory* QueueFactory::factoryInstance = nullptr;
|
2018-07-13 15:56:37 +02:00
|
|
|
|
|
|
|
ReturnValue_t MessageQueueSenderIF::sendMessage(MessageQueueId_t sendTo,
|
2022-02-02 10:29:30 +01:00
|
|
|
MessageQueueMessageIF* message,
|
|
|
|
MessageQueueId_t sentFrom, bool ignoreFault) {
|
|
|
|
return MessageQueue::sendMessageFromMessageQueue(sendTo, message, sentFrom, ignoreFault);
|
2018-07-13 15:56:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
QueueFactory* QueueFactory::instance() {
|
2022-02-02 10:29:30 +01:00
|
|
|
if (factoryInstance == nullptr) {
|
|
|
|
factoryInstance = new QueueFactory;
|
|
|
|
}
|
|
|
|
return factoryInstance;
|
2018-07-13 15:56:37 +02:00
|
|
|
}
|
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
QueueFactory::QueueFactory() {}
|
2018-07-13 15:56:37 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
QueueFactory::~QueueFactory() {}
|
2018-07-13 15:56:37 +02:00
|
|
|
|
2022-02-18 14:00:06 +01:00
|
|
|
MessageQueueIF* QueueFactory::createMessageQueue(uint32_t messageDepth, size_t maxMessageSize, void* args) {
|
|
|
|
return new MessageQueue(messageDepth, maxMessageSize, args);
|
2018-07-13 15:56:37 +02:00
|
|
|
}
|
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
void QueueFactory::deleteMessageQueue(MessageQueueIF* queue) { delete queue; }
|