fsfw/osal/FreeRTOS/QueueFactory.cpp

38 lines
871 B
C++
Raw Normal View History

2020-10-20 14:42:58 +02:00
#include "MessageQueue.h"
2020-09-26 14:24:09 +02:00
#include "../../ipc/MessageQueueSenderIF.h"
2020-08-13 20:53:35 +02:00
#include "../../ipc/QueueFactory.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,
2020-09-26 14:24:09 +02: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() {
2020-09-26 14:24:09 +02:00
if (factoryInstance == nullptr) {
2018-07-13 15:56:37 +02:00
factoryInstance = new QueueFactory;
}
return factoryInstance;
}
QueueFactory::QueueFactory() {
}
QueueFactory::~QueueFactory() {
}
2020-09-26 14:24:09 +02:00
MessageQueueIF* QueueFactory::createMessageQueue(uint32_t messageDepth,
size_t maxMessageSize) {
2020-09-26 14:24:09 +02:00
return new MessageQueue(messageDepth, maxMessageSize);
2018-07-13 15:56:37 +02:00
}
void QueueFactory::deleteMessageQueue(MessageQueueIF* queue) {
delete queue;
}