2020-08-13 20:53:35 +02:00
|
|
|
#include "../../ipc/QueueFactory.h"
|
|
|
|
#include "MessageQueue.h"
|
2020-09-22 15:29:28 +02:00
|
|
|
|
|
|
|
#include "../../ipc/messageQueueDefinitions.h"
|
|
|
|
#include "../../ipc/MessageQueueSenderIF.h"
|
2020-08-13 20:53:35 +02:00
|
|
|
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
2020-09-22 15:29:28 +02:00
|
|
|
|
|
|
|
#include <mqueue.h>
|
|
|
|
#include <errno.h>
|
|
|
|
|
|
|
|
|
2018-07-13 18:28:26 +02:00
|
|
|
#include <cstring>
|
|
|
|
|
2020-06-06 15:47:33 +02:00
|
|
|
QueueFactory* QueueFactory::factoryInstance = nullptr;
|
2018-07-13 18:28:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
ReturnValue_t MessageQueueSenderIF::sendMessage(MessageQueueId_t sendTo,
|
2020-09-22 16:10:43 +02:00
|
|
|
MessageQueueMessageIF* message, MessageQueueId_t sentFrom,
|
2020-06-06 15:47:33 +02:00
|
|
|
bool ignoreFault) {
|
|
|
|
return MessageQueue::sendMessageFromMessageQueue(sendTo,message,
|
|
|
|
sentFrom,ignoreFault);
|
2018-07-13 18:28:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
QueueFactory* QueueFactory::instance() {
|
2020-06-06 15:47:33 +02:00
|
|
|
if (factoryInstance == nullptr) {
|
2018-07-13 18:28:26 +02:00
|
|
|
factoryInstance = new QueueFactory;
|
|
|
|
}
|
|
|
|
return factoryInstance;
|
|
|
|
}
|
|
|
|
|
|
|
|
QueueFactory::QueueFactory() {
|
|
|
|
}
|
|
|
|
|
|
|
|
QueueFactory::~QueueFactory() {
|
|
|
|
}
|
|
|
|
|
2020-06-06 15:47:33 +02:00
|
|
|
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;
|
|
|
|
}
|