added FreeRTOS queue map manager
This commit is contained in:
@ -15,33 +15,36 @@ using QueueMap = std::unordered_map<MessageQueueId_t, MessageQueueIF*>;
|
||||
*/
|
||||
class QueueMapManager {
|
||||
public:
|
||||
//! Returns the single instance of SemaphoreFactory.
|
||||
static QueueMapManager* instance();
|
||||
|
||||
/**
|
||||
* Insert a message queue into the map and returns a message queue ID
|
||||
* @param queue The message queue to insert.
|
||||
* @param id The passed value will be set unless a nullptr is passed
|
||||
* @return
|
||||
*/
|
||||
ReturnValue_t addMessageQueue(MessageQueueIF* queue, MessageQueueId_t*
|
||||
id = nullptr);
|
||||
/**
|
||||
* Get the message queue handle by providing a message queue ID.
|
||||
* @param messageQueueId
|
||||
* @return
|
||||
*/
|
||||
MessageQueueIF* getMessageQueue(MessageQueueId_t messageQueueId) const;
|
||||
|
||||
//! Returns the single instance of QueueMapManager.
|
||||
static QueueMapManager* instance();
|
||||
|
||||
/**
|
||||
* Insert a message queue into the map and returns a message queue ID
|
||||
* @param queue The message queue to insert.
|
||||
* @param id The passed value will be set unless a nullptr is passed
|
||||
* @return
|
||||
*/
|
||||
ReturnValue_t addMessageQueue(MessageQueueIF* queue, MessageQueueId_t*
|
||||
id = nullptr);
|
||||
/**
|
||||
* Get the message queue handle by providing a message queue ID. Returns nullptr
|
||||
* if the queue ID is not contained inside the internal map.
|
||||
* @param messageQueueId
|
||||
* @return
|
||||
*/
|
||||
MessageQueueIF* getMessageQueue(MessageQueueId_t messageQueueId) const;
|
||||
|
||||
private:
|
||||
//! External instantiation is forbidden.
|
||||
QueueMapManager();
|
||||
~QueueMapManager();
|
||||
//! External instantiation is forbidden. Constructor still required for singleton instantiation.
|
||||
QueueMapManager();
|
||||
~QueueMapManager();
|
||||
|
||||
uint32_t queueCounter = 0;
|
||||
MutexIF* mapLock;
|
||||
QueueMap queueMap;
|
||||
static QueueMapManager* mqManagerInstance;
|
||||
uint32_t queueCounter = 0;
|
||||
MutexIF* mapLock;
|
||||
QueueMap queueMap;
|
||||
static QueueMapManager* mqManagerInstance;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user