fsfw/osal/linux/QueueFactory.cpp

39 lines
969 B
C++
Raw Normal View History

2018-07-13 18:28:26 +02:00
#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;
2018-07-13 18:28:26 +02:00
ReturnValue_t MessageQueueSenderIF::sendMessage(MessageQueueId_t sendTo,
MessageQueueMessage* message, MessageQueueId_t sentFrom,
bool ignoreFault) {
return MessageQueue::sendMessageFromMessageQueue(sendTo,message,
sentFrom,ignoreFault);
2018-07-13 18:28:26 +02:00
}
QueueFactory* QueueFactory::instance() {
if (factoryInstance == nullptr) {
2018-07-13 18:28:26 +02:00
factoryInstance = new QueueFactory;
}
return factoryInstance;
}
QueueFactory::QueueFactory() {
}
QueueFactory::~QueueFactory() {
}
MessageQueueIF* QueueFactory::createMessageQueue(uint32_t messageDepth,
size_t maxMessageSize) {
return new MessageQueue(messageDepth, maxMessageSize);
2018-07-13 18:28:26 +02:00
}
void QueueFactory::deleteMessageQueue(MessageQueueIF* queue) {
delete queue;
}