continue rework
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
19
mission/tmtc/PusTmRouteByFilterHelper.cpp
Normal file
19
mission/tmtc/PusTmRouteByFilterHelper.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include "PusTmRouteByFilterHelper.h"
|
||||
|
||||
#include <fsfw/ipc/MessageQueueIF.h>
|
||||
|
||||
PusTmRouteByFilterHelper::PusTmRouteByFilterHelper() = default;
|
||||
|
||||
bool PusTmRouteByFilterHelper::packetMatches(PusTmReader& reader, MessageQueueId_t& destination) {
|
||||
for (const auto filterAndDest : routerMap) {
|
||||
if (filterAndDest.first.packetMatches(reader)) {
|
||||
destination = filterAndDest.second;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void PusTmRouteByFilterHelper::addRouting(PusPacketFilter filter, MessageQueueId_t destination) {
|
||||
routerMap.emplace_back(std::move(filter), destination);
|
||||
}
|
Reference in New Issue
Block a user