fsfw/osal/linux/QueueFactory.cpp
2020-05-16 20:58:48 +02:00

39 lines
967 B
C++

#include <framework/ipc/QueueFactory.h>
#include <mqueue.h>
#include <errno.h>
#include <framework/osal/linux/MessageQueue.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h>
#include <cstring>
QueueFactory* QueueFactory::factoryInstance = nullptr;
ReturnValue_t MessageQueueSenderIF::sendMessage(MessageQueueId_t sendTo,
MessageQueueMessage* message, MessageQueueId_t sentFrom,
bool ignoreFault) {
return MessageQueue::sendMessageFromMessageQueue(sendTo,message,
sentFrom,ignoreFault);
}
QueueFactory* QueueFactory::instance() {
if (factoryInstance == nullptr) {
factoryInstance = new QueueFactory;
}
return factoryInstance;
}
QueueFactory::QueueFactory() {
}
QueueFactory::~QueueFactory() {
}
MessageQueueIF* QueueFactory::createMessageQueue(size_t messageDepth,
size_t maxMessageSize) {
return new MessageQueue(messageDepth, maxMessageSize);
}
void QueueFactory::deleteMessageQueue(MessageQueueIF* queue) {
delete queue;
}